public void Update(Observable o, Java.Lang.Object arg) { if (arg != _player) { return; } OoyalaNotification notification = null; if (arg is OoyalaNotification) { notification = arg as OoyalaNotification; } var argString = OoyalaNotification.GetNameOrUnknown(arg); if (argString == OoyalaPlayer.TimeChangedNotificationName) { return; } if (argString == OoyalaPlayer.CurrentItemChangedNotificationName) { UpdateCustView(notification); } else if (argString == OoyalaPlayer.ErrorNotificationName) { var msg = "Error Event Received"; if (_player != null && _player.Error != null) { System.Diagnostics.Debug.WriteLine($"{msg}, {_player.Error}"); } else { System.Diagnostics.Debug.WriteLine(msg); } } if (argString == OoyalaPlayer.StateChangedNotificationName) { if (_player.IsInCastMode) { OoyalaPlayer.State state = _player.GetState(); _castViewManager.UpdateCastState(this, state); } } // Automation Hook: to write Notifications to a temporary file on the device/emulator var text = "Notification Received: " + argString + " - state: " + _player.GetState(); System.Diagnostics.Debug.WriteLine(text); }
private void UpdateCustView(OoyalaNotification notification) { if (notification?.Data is VideoData data) { _castViewManager.ConfigureCastView(data.Title, data.Description, data.Url); } //else if (_player.getCurrentItem() != null) //{ //castViewManager.configureCastView( // player.getCurrentItem().getTitle(), // player.getCurrentItem().getDescription(), // player.getCurrentItem().getPromoImageURL(0, 0) //); //} }