Created
September 7, 2017 16:53
-
-
Save sjehutch/f29edfd92b3ced0f896b3cc9f4bdad32 to your computer and use it in GitHub Desktop.
play video Xamarin IOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void onPrimaryViewClick(object sender, EventArgs e) | |
{ | |
var pathOfVideoFile = NSBundle.MainBundle.PathForResource("Videos/sizzlereel", "mov"); | |
NSUrl pathUrl = NSUrl.FromFilename (pathOfVideoFile); | |
AVPlayer player = new AVPlayer(pathUrl); | |
AVPlayerViewController playerController = new AVPlayerViewController(); | |
this.moviePlayer = new MPMoviePlayerController(pathUrl); | |
this.moviePlayer.ControlStyle = MPMovieControlStyle.Embedded; | |
this.moviePlayer.SourceType = MPMovieSourceType.File; | |
this.AddSubview(this.moviePlayer.View); | |
this.moviePlayer.Fullscreen = true; | |
this.moviePlayer.Play(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment