Can't play video in android when using pushmodelaasync method but it's working in PushAsync method

60 views Asked by At

I have a video files that I unzipped from apk expansion method for android, I can view and play this video using PushAsync method with custom renderer using VideoView, but when I try to do PushModelAsync for batter user experience then it showing black window, and also in the error I can see log that file not found, but nothing wrong with my code.

GetVideo function just return the Video filename

string uri = ""; VideoPlayer_CustomRenderer.videoView = new VideoView(Context);

                uri = (Path.Combine(documentsPath, GetVideo()));

            VideoPlayer_CustomRenderer.mMediaPlayer = new MediaPlayer();
            VideoPlayer_CustomRenderer.mMediaPlayer.SetDataSource(Context, Android.Net.Uri.Parse(uri));
            VideoPlayer_CustomRenderer.mMediaPlayer.Prepare();

            MainActivity.MainActivityInstance.Window.AddFlags(WindowManagerFlags.KeepScreenOn);
            base.SetNativeControl(VideoPlayer_CustomRenderer.videoView);


            SetCallBack();
            Control.Layout(0, 200, VideoPlayer_CustomRenderer.mMediaPlayer.VideoHeight, VideoPlayer_CustomRenderer.mMediaPlayer.VideoWidth);
0

There are 0 answers