Created
July 15, 2013 13:36
-
-
Save prashantvc/5999982 to your computer and use it in GitHub Desktop.
This file contains 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
using System; | |
using System.Drawing; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using MonoTouch.MediaPlayer; | |
using MonoTouch.ObjCRuntime; | |
using MonoTouch.MessageUI; | |
namespace VideoPlayer | |
{ | |
public partial class VideoPlayerViewController : UIViewController | |
{ | |
public VideoPlayerViewController () : base ("VideoPlayerViewController", null) | |
{ | |
} | |
public override void DidReceiveMemoryWarning () | |
{ | |
// Releases the view if it doesn't have a superview. | |
base.DidReceiveMemoryWarning (); | |
// Release any cached data, images, etc that aren't in use. | |
} | |
public override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); | |
} | |
MPMoviePlayerViewController player; | |
//MPMoviePlayerViewController player; | |
partial void PlayButtonPressed (NSObject sender) | |
{ | |
var url = NSUrl.FromFilename("candle.mp4"); | |
player = new MPMoviePlayerViewController (url); | |
player.MoviePlayer.RepeatMode= MPMovieRepeatMode.One; | |
NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("finishPlayback:"), MPMoviePlayerController.PlaybackDidFinishNotification, player.MoviePlayer); | |
PresentMoviePlayerViewController(player); | |
} | |
[Export("finishPlayback:")] | |
public void Method (NSNotification notification) | |
{ | |
Console.WriteLine ("Notification"); | |
player.MoviePlayer.Play (); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment