Closed HyundongHwang closed 1 week ago
There is a simple example of an event listener here. You don't need to worry about looking at bitrate etc. You'll know its working due to the ResolutionChanged events.
Thank you for your kind reply. When I checked on iOS, I confirmed that the resolution changed (= ResolutionChanged) according to the network status. Are you saying that I can infer the currently playing profile with this resolution size?
I have an additional question. I set the MediaPlayer settings to correspond to the above 5 profiles as follows. When I didn't set anything, 720p was selected first even if the network was good, but if I do this, will 1080p be selected first? Do you have a recommended setting method?
mp.PlatformOptionsWindows.startWithHighestBitrate = true;
mp.PlatformOptionsWindows.StartWithHighestBandwidth();
mp.PlatformOptions_macOS.StartWithHighestBandwidth();
mp.PlatformOptions_macOS.preferredMaximumResolution = MediaPlayer.PlatformOptions.Resolution._2160p;
mp.PlatformOptions_macOS.preferredPeakBitRateUnits = MediaPlayer.PlatformOptions.BitRateUnits.Mbps;
mp.PlatformOptions_iOS.StartWithHighestBandwidth();
mp.PlatformOptions_iOS.preferredMaximumResolution = MediaPlayer.PlatformOptions.Resolution._2160p;
mp.PlatformOptions_iOS.flags = MediaPlayer.OptionsApple.Flags.PlayWithoutBuffering | MediaPlayer.OptionsApple.Flags.AllowExternalPlayback;
mp.PlatformOptions_iOS.preferredPeakBitRate = 100F;
mp.PlatformOptions_iOS.preferredPeakBitRateUnits = MediaPlayer.PlatformOptions.BitRateUnits.Mbps;
mp.PlatformOptionsAndroid.videoApi = Android.VideoApi.ExoPlayer;
mp.PlatformOptionsAndroid.startWithHighestBitrate = true;
mp.PlatformOptionsAndroid.StartWithHighestBandwidth();
mp.PlatformOptionsAndroid.preferredMaximumResolution = MediaPlayer.PlatformOptions.Resolution._2160p;
mp.PlatformOptionsAndroid.preferredPeakBitRate = 100F;
mp.PlatformOptionsAndroid.preferredPeakBitRateUnits = MediaPlayer.PlatformOptions.BitRateUnits.Mbps;
For your simple adaptive HLS manifest, yes. But this is not always the case. The HLS standard allows you to have streams with different codecs, bitrates (etc) with the same resolution.
Each platform API uses a set heuristics to determine current bandwidth status. This is something not exposed to developers at any level. Very much a magic black box. This is used regardless of what settings you choose, save with the exception of 'starting with highest bitrate. If you set that, I believe we are in essence tricking the API bandwidth meter to think it is 'excellent'. That is not to say that it does not kick in and will limit back down the adaptive streams until it is satisfied.
'Preferred maximum' is an upper clamp on resolution and/or bitrate. Streams that exceed the set values will never be selected for playback no matter how much bandwidth the APIs think they have available (in an upper sense).
Does this answer your questions?
Do you have a recommended setting method?
No, because we are not coding your project/use-case. Only you know what you need...we just simple (hopefully) provide all the tools in the asset for you to implement solution(s) to your projects needs.
Thank you for your kind reply. It was very helpful.
AVPro Video Version
3.1.2
Which platform is your question for?
macOS
Your question
Hello. As you previously informed me (#2072), I prepared the hls stream by configuring it with master and various profiles. First, thank you for your kind reply. I haven't tested it on a mobile device yet, but I tested it on MacOS Editor. I want to check whether the hls adaptive play function is working properly in the log, but I can't find it easily. As shown below, the length of Buffer is output normally, but VideoBitrate and AudioBitrate are always output as 0. I would like to be able to check the currently loaded m3u8 profile url in real time in the log. Is this function not testable in the Editor and only works on mobile devices?