public override void ViewDidLoad() { base.ViewDidLoad(); // Set up our player view. Create with a standard VOD layout. var options = new BCOVPUIPlayerViewOptions() { ShowPictureInPictureButton = true }; playbackController = sDKManager.CreatePlaybackController(); playbackController.SetAutoPlay(true); playbackController.SetAutoAdvance(true); playbackController.Delegate = new BCPlaybackControllerDelegate(); 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 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} "); } }); }
public override void ViewDidLoad() { base.ViewDidLoad(); //Google Cast button var castButton = new UICastButton(new CGRect(0, 0, 24, 24)); NavigationItem.RightBarButtonItem = new UIBarButtonItem(castButton); //NSNotificationCenter.DefaultCenter.AddObserver(this, castDidChangeState(), CastContext.CastStateDidChangeNotification, CastContext.SharedInstance); sessionManager = CastContext.SharedInstance.SessionManager; CastContext.SharedInstance.SessionManager.AddListener(this); NSNotificationCenter aNotificationCenter = NSNotificationCenter.DefaultCenter; aNotificationCenter.AddObserver(this, new ObjCRuntime.Selector("castDidChangeState:"), CastContext.CastStateDidChangeNotification, CastContext.SharedInstance); videoController = new UIView(); videoController.BackgroundColor = UIColor.Red; videoController.Frame = new CGRect(0, 100, 375, 207.5); //table = new UITableView(); // defaults to Plain style //table.Frame = new CGRect(0, 335, View.Frame.Width, View.Frame.Height - 215); //string[] tableItems = new string[] { "Basic Video", "DRM Video" }; //table.Source = new TableSource(tableItems, this); //playbackController Setup playbackController = sDKManager.CreatePlaybackController(); playbackController.SetAutoPlay(true); playbackController.SetAutoAdvance(true); playbackController.Delegate = new BCPlaybackControllerDelegate(); BCOVGoogleCastManager googleCastManager = new BCOVGoogleCastManager(); googleCastManager.Delegate = new BCGoogleCastManagerDelegate(playbackController); playbackController.AddSessionConsumer(googleCastManager); //playerView Setup var options = new BCOVPUIPlayerViewOptions() { PresentingViewController = this }; var playerView = new BCOVPUIPlayerView(playbackController, options, BCOVPUIBasicControlView.BasicControlViewWithVODLayout()); playerView.Frame = new CGRect(0, 0, 375, 207.5); 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; videoController.AddSubview(playerView); View.AddSubview(videoController); //View.AddSubview(table); }