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 override void ViewDidLoad() { base.ViewDidLoad(); //setup fairplay stuffs var fairPlayAuthProxy = new BCOVFPSBrightcoveAuthProxy(null, null); // Create chain of session providers // And upstream session provider to link to. If nil, a BCOVBasicSessionProvider will be used. var fps = sDKManager.CreateFairPlaySessionProviderWithAuthorizationProxy(fairPlayAuthProxy, null); //Create the playback controller playbackController = sDKManager.CreateFairPlayPlaybackControllerWithAuthorizationProxy(fairPlayAuthProxy); playbackController.SetAutoPlay(true); playbackController.SetAutoAdvance(false); playbackController.Delegate = new BCPlaybackControllerDelegate(); // 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 = View.Frame; playerView.ControlsView.ProgressSlider.MinimumTrackTintColor = UIColor.Green; View.AddSubview(playerView); }
public override void ViewDidLoad() { base.ViewDidLoad(); var fairPlayAuthProxy = new BCOVFPSBrightcoveAuthProxy(null, null); // Create chain of session providers // And upstream session provider to link to. If nil, a BCOVBasicSessionProvider will be used. var fps = sdkManager.CreateFairPlaySessionProviderWithAuthorizationProxy(fairPlayAuthProxy, null); // Create the playback controller playbackController = sdkManager.CreateFairPlayPlaybackControllerWithAuthorizationProxy(fairPlayAuthProxy); playbackController.SetAutoPlay(true); playbackController.SetAutoAdvance(false); playbackController.Delegate = new BCPlaybackControllerDelegate(); //create the playerview var options = new BCOVTVPlayerViewOptions() { PresentingViewController = this, }; var playerView = new BCOVTVPlayerView(options); playerView.PlaybackController = playbackController; playerView.ControlsView.ProgressView.MinimumTrackTintColor = UIColor.Blue; playerView.SettingsView.TopTabBarItemViews = new BCOVTVTabBarItemView[0]; playerView.ShowView(BCOVTVShowViewType.Controls); playerView.Frame = View.Frame; View.AddSubview(playerView); playbackService.FindVideoWithVideoID(videoID: videoId, parameters: new NSDictionary(), completionHandler: (arg1, arg2, arg3) => { if (arg1 != null) { playbackController.SetVideos(NSArray.FromObjects(arg1)); } else { Debug.WriteLine($"View Controller Debug - Error retrieving video : {arg3.LocalizedDescription} "); } }); }