SHARE
TWEET

ViewController.cs

a guest Mar 28th, 2017 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using Foundation;
  3. using RTSPPlayer;
  4.  
  5. using UIKit;
  6.  
  7. namespace rtsptest
  8. {
  9.     public partial class ViewController : UIViewController
  10.     {
  11.         FFAVPlayerController player;
  12.  
  13.         protected ViewController(IntPtr handle) : base(handle)
  14.         {
  15.         }
  16.  
  17.         public override void ViewDidLoad()
  18.         {
  19.             base.ViewDidLoad();
  20.             try
  21.             {
  22.                 var options = new NSMutableDictionary();
  23.                 options[Constants.AVOptionNameAVProbeSize] = NSObject.FromObject(256 * 1024);
  24.                 options[Constants.AVOptionNameAVAnalyzeduration] = NSObject.FromObject(1);
  25.                 options[Constants.AVOptionNameHttpUserAgent] = NSObject.FromObject("Mozilla/5.0");
  26.  
  27.                 var url = NSUrl.FromString(@"rtsp://myrtspurl");
  28.  
  29.                 // Note: this .ctor should not contain any initialization logic.
  30.                 player = new FFAVPlayerController();
  31.                 player.ShouldAutoPlay = true;
  32.                 player.OpenMedia(url, options);
  33.             }
  34.             catch (Exception ex)
  35.             {
  36.             }
  37.             //PresentViewController(player, true, () => { });
  38.             // Perform any additional setup after loading the view, typically from a nib.
  39.         }
  40.  
  41.         public override void DidReceiveMemoryWarning()
  42.         {
  43.             base.DidReceiveMemoryWarning();
  44.             // Release any cached data, images, etc that aren't in use.
  45.         }
  46.     }
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top