Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Android VideoPlayer not setting invisible

$
0
0

Hello, I have been bashing my head with android and its video players for quite a while. After few days on this specific problem I gave up and registered here.

My problem is that I need videoplayer in the top of the screen, and I want it to go fullscreen after button is pressed. Also, I want all this to happen on the same UI stack. Using FormsVideoLibrary I managed to achieve this, sort of.

Now I have this issue on emulator:

Going out of full screen videoplayer does not dissaper (after setting IsVisible= false), instead it freezes, displaying frame on stop, and apears on top of videoplayer that should play.

On Device:
The problem happening on emulator does not occur, instead the first video player is set on top of another, even when it IsVisible = false ( parent view is also IsVisible = false)

Some of the code that is executed after fullscreen button is pressed >

         private void ChangeScape()
                {   
                    if (isitlandscape == false)
                    {
                        isitlandscape = true;
                        MessagingCenter.Send(this, "allowLandScapePortrait");                    
                        videoPlayer.Stop();    // pause() does same
                        CurrentPosition = videoPlayer.Position;
// setting everything invisible                 
                        MainVideoStack.IsVisible = false;
                        videoPlayer.IsEnabled = false;
                        videoPlayer.IsVisible = false;
                        videoPlayer.IsTabStop = false; // trying everything here
                        MainCanvasStack.IsVisible = false;
                        ThirdPageListViewXaml.IsVisible = false;
                        MainStackButtons.IsVisible = false;
                        secondstack.IsVisible = true; // full screen video with its ui elements 

                        VideoPlayerTwoControl(); // runs video

                    }
                    else if(isitlandscape == true)
                    {
                        isitlandscape = false;
                        videoPlayertwo.Stop();
                        CurrentPosition = videoPlayertwo.Position;
//setting elements to false
                        secondstack.IsVisible = false;
                        videoPlayertwo.IsVisible = false;
                        videoPlayertwo.IsEnabled = false;
//turning on elements 
                        MainVideoStack.IsVisible = true;
                        MainCanvasStack.IsVisible = true;
                        ThirdPageListViewXaml.IsVisible = true;
                        MainStackButtons.IsVisible = true;      
                        MessagingCenter.Send(this, "preventLandScape");
                        // TODO should start playing video
                    }
                }

Anyone can give me something? I feel like its some stupid mistake. On the bright side, atleast I can play 2 videos on top of each other, YaY!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>