Possible duplicate on Open video in iPhone without controls and Playing a video on startup of app without controlshere
How do I start MoviePlayer without controls?
-
21-09-2022 - |
Domanda
I would like to start the MoviePlyer without controls, but if the user touch the screen, the controls are displayed and allow user to go full screen or AirPlay.
self.player = [[MPMoviePlayerController alloc] initWithContentURL:url];
self.player.allowsAirPlay = YES;
self.player.view.frame = self.imageView.frame;
self.player.controlStyle = MPMovieControlStyleNone;
[self.view addSubview:self.player.view];
[self.player play];
self.player.controlStyle = MPMovieControlStyleDefault;
It seems that the only way to remove controls initially is to set to MPMovieControlStyleNone, but no controls will be shown later. If I set to MPMovieControlStyleDefault later, controls will always be shown.
What should I do? Is there a property to set controls to off initially?
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow