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

            var castButton = new UICastButton(new CGRect(0, 0, 24, 24));

            NavigationItem.RightBarButtonItem = new UIBarButtonItem(castButton);

            NSNotificationCenter aNotificationCenter = NSNotificationCenter.DefaultCenter;

            aNotificationCenter.AddObserver(this, new ObjCRuntime.Selector("castDidChangeState:"), CastContext.CastStateDidChangeNotification, CastContext.SharedInstance);

            //setup fairplay stuffs
            var fairPlayAuthProxy = new BCOVFPSBrightcoveAuthProxy(null, null);
            var fps = sDKManager.CreateFairPlaySessionProviderWithAuthorizationProxy(fairPlayAuthProxy, null);

            //Create the playback controller
            playbackController = sDKManager.CreateFairPlayPlaybackControllerWithAuthorizationProxy(fairPlayAuthProxy);
            playbackController.SetAutoPlay(true);
            playbackController.SetAutoAdvance(false);
            playbackController.Delegate = new BCPlaybackControllerDelegate();

            //USING CUSTOM GoogleCastManager
            GoogleCastManager googleCastManager = new GoogleCastManager();

            googleCastManager.gcmDelegate = new XamGoogleCastManagerDelegate(playbackController);
            var gcmPlaybackSession = new XamBCPlaybackSessionConsumer(googleCastManager);

            playbackController.AddSessionConsumer(gcmPlaybackSession);

            // Set up our player view. Create with a standard VOD layout.
            var options = new BCOVPUIPlayerViewOptions()
            {
                ShowPictureInPictureButton = true
            };
            var playerView = new BCOVPUIPlayerView(playbackController, options, BCOVPUIBasicControlView.BasicControlViewWithVODLayout());

            playerView.Delegate = new BCUIPlaybackViewController();

            playbackService.FindVideoWithVideoID(videoID: videoId, parameters: new NSDictionary(), completionHandler: (arg0, arg1, arg2) =>
            {
                if (arg0 != null)
                {
                    playbackController.SetVideos(NSArray.FromObjects(arg0));
                }
                else
                {
                    Debug.WriteLine($"View Controller Debug - Error retrieving video : {arg2.LocalizedDescription} ");
                }
            });

            playerView.PlaybackController = playbackController;
            playerView.Frame = new CGRect(0, 100, 375, 207.5);
            playerView.ControlsView.ProgressSlider.MinimumTrackTintColor = UIColor.Green;
            View.AddSubview(playerView);
        }
 public XamMediaControllerDelegate(GoogleCastManager gcm)
 {
     this.googleCastManager = gcm;
 }
 public XamBCPlaybackSessionConsumer(GoogleCastManager gcm)
 {
     this.googleCastManager = gcm;
 }
 public XamSessionManagerListener(GoogleCastManager gcm)
 {
     this.googleCastManager = gcm;
 }