When I use the video_player plugin, I use the Navigator.push function to go to another screen where I push a button to display the video. Once the video is over, I push the back button. If I activate the Navigator.push function again and push the button to display the video, no visual is shown and only the audio is played. Can someone tell me what is going on and how to fix this?
Never mind, I found out that the issue was that I needed to call setState before I could display the video the second time.
Related
I have a wkWebView where I display a video. How can I automatically switch to the next screen after the video ends?
It doesn't look like WKWebView has any call back methods to notify when a video has completed. The only suggestions I can provide is if the video lives locally in the app, you can use AVFoundation and take advantage of their call back methods. Other users have also mentioned using Javascript to detect when an online video has finished.
When I am using my app, I have a ListView.builder, and if someone presses an item on that it does a Navigator.push function and leads them to the corresponding video. However, if I pause the video in the middle, when Navigator.pop is called, it pops the window, but if I play another video after that, it resumes the old video and then starts the new video. Can anyone help me on how to stop the issue?
Is there any way to hide only Next and Previous buttons in AVPlayer while playing a video
You can only either hide them all or show them all via the AVPlayerViewController showsPlaybackControls property, so what I would recommend doing is using an open source or third party library or framework that controls AVPlayer for you.
Such as what's suggested by this related question, which ultimately points to this GitHub project. You can then remove or hide the controls you don't want to be visible.
Alternatively, you could create your own controls that call into, and control, AVPlayer.
=> you can get notification when ply or pause and stop
when you got notification of play at that time you can hide both next and preivios button
What can be done to make a Youtube video play properly upon the first attempt to view it?
Most of the time I get dark areas as shown for example in the attached:
https://www.imageupload.co.uk/images/2015/05/28/ytquestion.png
Update your flash player. That is probably corrupt.
So, I just basically want to use AVFoundation Kit for playing my sound. I have the play method set, but I want to be able to hold down the button and play the sound that way rather than tapping it first. Once I release the button, I want the sound to stop. Simple: Hold down to play sound and then release your finger to stop the sound like a piano. Help please! Thanks.
If you right click on the button in IB you should be able to link the
Touch down
and
Touch Cancelled
button links so that it they both call the same method or they each call a different method one to stop the sound and one to start it.
you might also want to check out this
forum
hope this helps