Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Foundation;
- using RTSPPlayer;
- using UIKit;
- namespace rtsptest
- {
- public partial class ViewController : UIViewController
- {
- FFAVPlayerController player;
- protected ViewController(IntPtr handle) : base(handle)
- {
- }
- public override void ViewDidLoad()
- {
- base.ViewDidLoad();
- try
- {
- var options = new NSMutableDictionary();
- options[Constants.AVOptionNameAVProbeSize] = NSObject.FromObject(256 * 1024);
- options[Constants.AVOptionNameAVAnalyzeduration] = NSObject.FromObject(1);
- options[Constants.AVOptionNameHttpUserAgent] = NSObject.FromObject("Mozilla/5.0");
- var url = NSUrl.FromString(@"rtsp://myrtspurl");
- // Note: this .ctor should not contain any initialization logic.
- player = new FFAVPlayerController();
- player.ShouldAutoPlay = true;
- player.OpenMedia(url, options);
- }
- catch (Exception ex)
- {
- }
- //PresentViewController(player, true, () => { });
- // Perform any additional setup after loading the view, typically from a nib.
- }
- public override void DidReceiveMemoryWarning()
- {
- base.DidReceiveMemoryWarning();
- // Release any cached data, images, etc that aren't in use.
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement