/// <summary> /// Setup the Brightcove IMA Plugin: add some cue points; establish a factory object to /// obtain the Google IMA SDK instance. /// </summary> private void setupGoogleIMA() { // Defer adding cue points until the set video event is triggered. eventEmitter.on(EventType.DID_SET_SOURCE, new EventListenerAnonymousInnerClassHelper(this)); // Establish the Google IMA SDK factory instance. //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final com.google.ads.interactivemedia.v3.api.ImaSdkFactory sdkFactory = com.google.ads.interactivemedia.v3.api.ImaSdkFactory.getInstance(); ImaSdkFactory sdkFactory = ImaSdkFactory.Instance; // Enable logging of ad starts eventEmitter.on(GoogleIMAEventType.DID_START_AD, new EventListenerAnonymousInnerClassHelper2(this)); // Enable logging of any failed attempts to play an ad. eventEmitter.on(GoogleIMAEventType.DID_FAIL_TO_PLAY_AD, new EventListenerAnonymousInnerClassHelper3(this)); // Enable logging of ad completions. eventEmitter.on(GoogleIMAEventType.DID_COMPLETE_AD, new EventListenerAnonymousInnerClassHelper4(this)); // Set up a listener for initializing AdsRequests. The Google IMA plugin emits an ad // request event in response to each cue point event. The event processor (handler) // illustrates how to play ads back to back. eventEmitter.on(GoogleIMAEventType.ADS_REQUEST_FOR_VIDEO, new EventListenerAnonymousInnerClassHelper5(this, sdkFactory)); // Create the Brightcove IMA Plugin and register the event emitter so that the plugin // can deal with video events. googleIMAComponent = new GoogleIMAComponent(brightcoveVideoView, eventEmitter); }
/// <summary> /// Setup the Brightcove IMA Plugin. /// </summary> private void setupGoogleIMA() { // Establish the Google IMA SDK factory instance. //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final com.google.ads.interactivemedia.v3.api.ImaSdkFactory sdkFactory = com.google.ads.interactivemedia.v3.api.ImaSdkFactory.getInstance(); ImaSdkFactory sdkFactory = ImaSdkFactory.Instance; // Enable logging up ad start. eventEmitter.on(GoogleIMAEventType.DID_START_AD, new EventListenerAnonymousInnerClassHelper2(this)); // Enable logging any failed attempts to play an ad. eventEmitter.on(GoogleIMAEventType.DID_FAIL_TO_PLAY_AD, new EventListenerAnonymousInnerClassHelper3(this)); // Enable Logging upon ad completion. eventEmitter.on(GoogleIMAEventType.DID_COMPLETE_AD, new EventListenerAnonymousInnerClassHelper4(this)); // Set up a listener for initializing AdsRequests. The Google // IMA plugin emits an ad request event as a result of // initializeAdsRequests() being called. eventEmitter.on(GoogleIMAEventType.ADS_REQUEST_FOR_VIDEO, new EventListenerAnonymousInnerClassHelper5(this, sdkFactory)); // Create the Brightcove IMA Plugin and pass in the event // emitter so that the plugin can integrate with the SDK. googleIMAComponent = new GoogleIMAComponent(brightcoveVideoView, eventEmitter, true); // Calling GoogleIMAComponent.initializeAdsRequests() is no longer necessary. }
/// <summary> /// Setup the Brightcove IMA Plugin: add some cue points; establish a factory object to /// obtain the Google IMA SDK instance. /// </summary> private void setupGoogleIMA() { // Defer adding cue points until the set video event is triggered. eventEmitter.on(EventType.DID_SET_SOURCE, new EventListenerAnonymousInnerClassHelper(this)); // Establish the Google IMA SDK factory instance. //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final com.google.ads.interactivemedia.v3.api.ImaSdkFactory sdkFactory = com.google.ads.interactivemedia.v3.api.ImaSdkFactory.getInstance(); ImaSdkFactory sdkFactory = ImaSdkFactory.Instance; // Enable logging of ad starts. eventEmitter.on(GoogleIMAEventType.DID_START_AD, new EventListenerAnonymousInnerClassHelper2(this)); // Enable logging of any failed attempts to play an ad. eventEmitter.on(GoogleIMAEventType.DID_FAIL_TO_PLAY_AD, new EventListenerAnonymousInnerClassHelper3(this)); // Enable logging of ad completions. eventEmitter.on(GoogleIMAEventType.DID_COMPLETE_AD, new EventListenerAnonymousInnerClassHelper4(this)); // Set up a listener for initializing AdsRequests. The Google IMA plugin emits an ad // request event in response to each cue point event. The event processor (handler) // illustrates how to play ads back to back. eventEmitter.on(GoogleIMAEventType.ADS_REQUEST_FOR_VIDEO, new EventListenerAnonymousInnerClassHelper5(this, sdkFactory)); // Create the Brightcove IMA Plugin and register the event emitter so that the plugin // can deal with video events. googleIMAComponent = new GoogleIMAComponent(brightcoveVideoView, eventEmitter); }