public override void LoadView()
        {
            base.LoadView();

            View.BackgroundColor = UIColor.White;

            _downloadProgressLabel = new UILabel()
            {
                Text          = "Download state",
                TextColor     = UIColor.Magenta,
                TextAlignment = UITextAlignment.Center,
            };
            View.AddSubview(_downloadProgressLabel);

            _startButton = new UIButton(UIButtonType.System);
            _startButton.SetTitle("Click me", UIControlState.Normal);
            View.AddSubview(_startButton);

            castManager = OOCastManager.CastManagerWithAppID("4172C76F", "urn:x-cast:ooyala");
            castManager.WeakDelegate = this;

            var options = new OOAssetDownloadOptions();

            options.Pcode     = "c0cTkxOqALQviQIGAHWY5hP0q9gU";
            options.EmbedCode = _embedCode;
            options.Domain    = new OOPlayerDomain("http://www.ooyala.com");
            _videoAsset       = new OODtoAsset(options, "Clear HLS Video");
            _videoAsset.DownloadWithProgressClosure(HandleProgressParameter);
            _videoAsset.FinishWithRelativePath(HandleFinishParameter);
            _videoAsset.OnErrorWithErrorClosure(HandleErrorParameter);
            _downloadProgressLabel.Text = _videoAsset.StateText;
            var castPlayer = new OOOoyalaPlayer(
                pcode: "c0cTkxOqALQviQIGAHWY5hP0q9gU",
                domain: new OOPlayerDomain("http://www.ooyala.com"));

            castPlayer.InitCastManager(castManager);

            var rightButton = new UIBarButtonItem(castManager.CastButton);

            NavigationItem.RightBarButtonItem = rightButton;

            _castVC = new OOOoyalaPlayerViewController(player: castPlayer);
        }
Example #2
0
        public override void LoadView()
        {
            base.LoadView();

            View.BackgroundColor = UIColor.White;

            _startButton = new UIButton(UIButtonType.System);
            _startButton.SetTitle("Click me", UIControlState.Normal);
            View.AddSubview(_startButton);

            castManager = OOCastManager.CastManagerWithAppID("4172C76F", "urn:x-cast:ooyala");
            castManager.WeakDelegate = this;

            var options = new OOAssetDownloadOptions();

            options.Pcode     = "c0cTkxOqALQviQIGAHWY5hP0q9gU";
            options.EmbedCode = _embedCode;
            options.Domain    = new OOPlayerDomain("http://www.ooyala.com");
            //options.EmbedTokenGenerator = new TokenGenerator();
            var manager = new OOAssetDownloadManager(options);

            manager.WeakDelegate = this;
            manager.StartDownload();

            var castPlayer = new OOOoyalaPlayer(
                pcode: "c0cTkxOqALQviQIGAHWY5hP0q9gU",
                domain: new OOPlayerDomain("http://www.ooyala.com"));

            castPlayer.InitCastManager(castManager);

            var rightButton = new UIBarButtonItem(castManager.CastButton);

            NavigationItem.RightBarButtonItem = rightButton;

            _castVC = new OOOoyalaPlayerViewController(player: castPlayer);
        }