зеркало из https://github.com/xamarin/ios-samples.git
MoviePlayback - Fix bug #7223
Disable pinch-to-zoom from the MoviePlaybackController
This commit is contained in:
Родитель
b167164c5b
Коммит
d42ffd768c
|
@ -28,30 +28,29 @@ namespace MoviePlaybackSample
|
|||
//Button Events
|
||||
playMovieButton.TouchUpInside += delegate {
|
||||
|
||||
try{
|
||||
|
||||
//Set already instantiated MPMoviePlayerController to playback from Movies/file.m4v
|
||||
mp = new MPMoviePlayerController (NSUrl.FromFilename("Movies/file.m4v"));
|
||||
|
||||
//enable AirPlay
|
||||
mp.AllowsAirPlay = true;
|
||||
|
||||
//Add the MPMoviePlayerController View
|
||||
this.View.AddSubview(mp.View);
|
||||
|
||||
//set the view to be full screen and show animated
|
||||
mp.SetFullscreen(true, true);
|
||||
try{
|
||||
//Set already instantiated MPMoviePlayerController to playback from Movies/file.m4v
|
||||
mp = new MPMoviePlayerController (NSUrl.FromFilename("Movies/file.m4v"));
|
||||
|
||||
//enable AirPlay
|
||||
mp.AllowsAirPlay = true;
|
||||
|
||||
//Add the MPMoviePlayerController View
|
||||
this.View.AddSubview(mp.View);
|
||||
|
||||
//set the view to be full screen and show animated
|
||||
mp.SetFullscreen(true, true);
|
||||
|
||||
//Disable the pinch-to-zoom gesture
|
||||
mp.ControlStyle = MPMovieControlStyle.Fullscreen;
|
||||
|
||||
//MPMoviePlayer must be set to PrepareToPlay before playback
|
||||
mp.PrepareToPlay();
|
||||
|
||||
//Play Movie
|
||||
mp.Play();
|
||||
|
||||
}catch{
|
||||
|
||||
Console.WriteLine("There was a problem playing back Video");
|
||||
//MPMoviePlayer must be set to PrepareToPlay before playback
|
||||
mp.PrepareToPlay();
|
||||
|
||||
//Play Movie
|
||||
mp.Play();
|
||||
} catch {
|
||||
Console.WriteLine("There was a problem playing back Video");
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче