RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

Adaptive streaming #1890

Closed AmalBabuM closed 3 weeks ago

AmalBabuM commented 3 weeks ago

Hi ,

I am using AVPro Video in my Unity project, and I would like to know if there is a way to adjust the preferred maximum resolution for the Android platform through a script. Specifically, I'm looking for guidance on how to set this parameter programmatically rather than through the Unity editor.

Could you please provide detailed instructions or an example script on how to achieve this?

Thank you for your support!

Best regards, Amal

Chris-RH commented 3 weeks ago

// Set the maximum adaptive resolution to 1080p - ExoPlayer only mediaPlayer.PlatformOptionsAndroid.videoApi = Android.VideoApi.ExoPlayer; mediaPlayer.PlatformOptionsAndroid.preferredMaximumResolution = OptionsAndroid.Resolution._1080p;

AmalBabuM commented 3 weeks ago

// Set the maximum adaptive resolution to 1080p - ExoPlayer only mediaPlayer.PlatformOptionsAndroid.videoApi = Android.VideoApi.ExoPlayer; mediaPlayer.PlatformOptionsAndroid.preferredMaximumResolution = OptionsAndroid.Resolution._1080p;

when i change the resolution while on run time in my android device its not getting triggered in the below event

void HandleEvent(MediaPlayer mp, MediaPlayerEvent.EventType eventType, ErrorCode code) { if (eventType == MediaPlayerEvent.EventType.ResolutionChanged) { IsVideoReady.text = "Resolution Changed"; Debug.LogError("Resolution Changed"); } }

Chris-RH commented 3 weeks ago

"when i change the resolution while on run time in my android device" what do you mean? These settings can only be called before OpenMedia. Are you sure that ResolutionChanged events have actually occurred?
I've used this teststream, and I'm getting ResolutionChanged events : https://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8