Open video on iPhone without controls

I am trying to play a video without displaying the controls (volume and other buttons), but it should also be possible to make them visible by clicking on the video.

Code: theMovie.scalingMode = MPMovieScalingModeAspectFill; theMovie.movieControlMode = MPMovieControlModeDefault; In this case, it shows the default controls and records the video that they hide.

If I change the mode to MPMovieControlModeHidden, then I can not see the controls, but also can not return them.

Is there a way to start a video without controls, but not completely disable them?

+4
source share
2 answers

Good news Dmitry!

I found a solution that will do this work for you, hopefully.

It looks like this:

  • Initialize MPMoviePlayerController object movieControlMode property with MPMovieControlModeHidden Value
  • Play movie
  • After movie playback starts, set the MPMoviePlayerController object movieControlMode to MPMoviePlayerController

The third step can be performed by observing the MPMoviePlayerContentPreloadDidFinishNotification notification. Although this may cause an unresponsive black screen (or another color that you set as the MPMoviePlayerController backgroundColor object), in case you play streaming video that must be preloaded using MPMoviePlayerController . I currently do not have any compatible format movie on the remote server, so I can’t check this scenario, and so it’s a mess to see if there is anything that can be done to avoid this side effect (although I think I I will do this if you publish or find such a movie for testing somewhere on the Internet).

+2
source

Tip. Look at the bold piece of text, if you don’t want to know my long story about how boring I really start to study the problem by reading the documentation and looking at the sample code that it offers.

Your question interested me, so I started by searching for the Link to the MPMoviePlayerController class on the iPhone Dev Center . I actually did not find anything related to the problem you came across, so I decided to play with this example project. MPMoviePlayerController Link - MoviePlayer . I am trying to reproduce your situation and maybe try to deal with it by simulating one touch event or by initiating the same method that reacts to this event manually.

But it turned out that the Apple project example really behaves as if you want to . It starts playing the video, and overlay controls are automatically displayed from the screen from the very beginning. I looked at the code, it is quite simple and actually does not "cope" with this problem. So maybe this is what you are doing (or doing in a slightly wrong order) that is causing the problem. Check it out and come back to us with the medicine, because judging by the utility indicator, there are people who have similar problems.

0
source

All Articles