Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airplay not resuming original video playback after the playing the last ad in the ad pod #46

Open
Venkata-Maniteja opened this issue Aug 14, 2020 · 0 comments

Comments

@Venkata-Maniteja
Copy link

I'm using brightcove player in my project along with goolge IMA to play ads. When the device is connected to airplay, it plays the video and even it plays all the ads included in the ad pod.

However after finishing up the last ad, it stays there and is unable to resume the original video playback.

Here is the method, which gets called when all ads gets finished:

-(void)adsManagerDidRequestContentResume:(IMAAdsManager *)adsManager{
if ([[AirPlayDetector defaultDetector]isConnectedToAirplay]) {
[adsManager destroy];
[_playbackController play];
}
}
This didnot work. I even tried replacing the playback controller session by

[self.playbackController setVideos:@[OriginalVideoToPlay]];
just to check if it atleast plays the original video .

But I get the player terminate event right after replacing the session again.

I did set the "allowsExternalPlayback" to YES for the playback controller.

The ads were fetched from the vmap ad tag url and is fed into the "BCOVIMAAdsRequestPolicy"

The playback controller is created using:

BCOVPlayerSDKManager *playbackManager = [BCOVPlayerSDKManager sharedManager];
BCOVBasicSessionProviderOptions *opts = [[BCOVBasicSessionProviderOptions alloc] init];
id<BCOVPlaybackSessionProvider> sessionProvider = [playbackManager createBasicSessionProviderWithOptions:opts];
id<BCOVPlaybackSessionProvider> basicSessionProvider = [playbackManager createSidecarSubtitlesSessionProviderWithUpstreamSessionProvider:sessionProvider];

IMASettings *imaSettings = [[IMASettings alloc] init];
imaSettings.ppid = [self getUniqueIdentifierForAdvertising];
imaSettings.language = @"en";
imaSettings.enableBackgroundPlayback = YES;

IMAAdsRenderingSettings *renderSettings = [[IMAAdsRenderingSettings alloc] init];
renderSettings.webOpenerPresentingController = nil;
renderSettings.bitrate = RDM_IMA_BITRATE; //set this how you see fit.

BCOVIMAAdsRequestPolicy *adsRequestPolicy = [BCOVIMAAdsRequestPolicy videoPropertiesVMAPAdTagUrlAdsRequestPolicy];

id<BCOVPlaybackSessionProvider> imaSessionProvider = [playbackManager createIMASessionProviderWithSettings:imaSettings adsRenderingSettings:renderSettings adsRequestPolicy:adsRequestPolicy adContainer:_adContainerView companionSlots:nil upstreamSessionProvider:basicSessionProvider];

// We use the ima session (and pipeline) to create a playback controller
// that can play content and provide ads through IMA.
_playbackController = [playbackManager createPlaybackControllerWithSessionProvider:imaSessionProvider viewStrategy:[self  createCustomViewStrategyWithFrame:frame]];

_playbackController.delegate = self;
_playbackController.autoPlay = YES;
_playbackController.allowsExternalPlayback = YES;

Is it possible to ad airplay support with google ima (other than SSAI ads) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant