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

Ads in the player #4481

Closed
hiren3897 opened this issue Sep 13, 2022 · 11 comments · Fixed by #4424
Closed

Ads in the player #4481

hiren3897 opened this issue Sep 13, 2022 · 11 comments · Fixed by #4424
Labels
component: ads The issue involves the Shaka Player ads API or the use of other ad SDKs status: archived Archived and locked; will not be updated type: question A question from the community

Comments

@hiren3897
Copy link

Have you read the Tutorials?
YES

Have you read the FAQ and checked for duplicate open issues?
YES

What version of Shaka Player are you using?
3.2

Please ask your question
Can you please give me a quick brief on inserting the ads in the shaka-player?

I have already read this documentation: https://shaka-player-demo.appspot.com/docs/api/tutorial-ad_monetization.html

It says after v3.1+ shaka player will support other ads providers, do we have it as we can see we have 4.2 released?

If yes, how we should integrate that?

@hiren3897 hiren3897 added the type: question A question from the community label Sep 13, 2022
@joeyparrish
Copy link
Member

It says after v3.1+ shaka player will support other ads providers

Unfortunately, we never implemented that. I would be happy to discuss the design with you if you want to be part of the solution to extend it. Currently, this is not on our roadmap. Unless you are interested in the work, I think we should remove that mention from the docs.

@hiren3897
Copy link
Author

Okay, thanks for the response
I will talk with my team and let you know :)

@hiren3897
Copy link
Author

hiren3897 commented Sep 16, 2022

"TypeError: Cannot read properties of null (reading 'isLinear')

When I tried to follow your tutorial, I am getting this error above.

My questions:

We can request ads anytime during the presentation?
After the ad gets end does the player have the capability to switch back to the original video automatically?
Do we have a skip button UI or do I need to work on that to create a button to skip the ads?

@theodab
Copy link
Contributor

theodab commented Sep 16, 2022

It's hard to say without the full stack trace, but that TypeError looks like we are getting a CONTENT_PAUSE_REQUESTED or STARTED event from the IMA SDK, but the event has no associated ad.
I don't know why that would happen, admittedly. I'm not an IMA SDK expert or anything.
We should probably have a more useful error for if that happens. I'll put in an assert, maybe.

As to your questions,

  1. I believe you can request ads at any time during the presentation, yes.
  2. The player should automatically return to the original video after an ad.
  3. The UI has a skip ad button. It shows up based on the getAdSkippableState method of the IMA AdsManager.

@hiren3897
Copy link
Author

hiren3897 commented Sep 20, 2022

Thanks, @theodab for the response

Can you send me any adsTagURl that is working because I am using the ads URL from this google sample source:
https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags

None of them are working for me!!

It also gives me an error when I run it on localhost. Does it require only https?

@theodab
Copy link
Contributor

theodab commented Sep 20, 2022

The ad tag URIs we are using for demo content are here:

/** @enum {string} */
shakaAssets.AdTag = {
SINGLE_LINEAR_AD: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480' +
'&iu=/124319096/external/' +
'single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&' +
'unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%' +
'3Dlinear&correlator=',
SINGLE_NON_LINEAR_AD: 'https://pubads.g.doubleclick.net/gampad/ads?' +
'sz=480x70&iu=/124319096/external/single_ad_samples&ciu_szs=300x250 ' +
'&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1' +
'&cust_params=deployment%3Ddevsite%26sample_ct%3Dnonlinear&correlator=',
SINGLE_SKIPPABLE_AD: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/' +
'124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&' +
'gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=' +
'deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=',
AD_POD_PREROLL_MIDROLL_POSTROLL: 'https://pubads.g.doubleclick.net/gampad/ads?' +
'sz=640x480&iu=/124319096/external/ad_rule_samples&' +
'ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=' +
'vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite' +
'%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&correlator=',
};

I'm... not sure where they come from, to be honest. I didn't make the ad stuff. I assume they are some kind of sample ads.

It should work when hosted on localhost. I test things over localhost, most of the time.

@hiren3897
Copy link
Author

errorADS
When running on localhost I have this error :'/

@avelad avelad added the component: ads The issue involves the Shaka Player ads API or the use of other ad SDKs label Sep 20, 2022
@hiren3897
Copy link
Author

Did the fix made by you resolve the problem of "TypeError: Cannot read properties of null (reading 'isLinear') ?

@joeyparrish
Copy link
Member

@hiren3897, please try again with the latest source from the main branch and let us know your results.

theodab added a commit to theodab/shaka-player that referenced this issue Sep 22, 2022
@hiren3897
Copy link
Author

hiren3897 commented Sep 22, 2022

Hello @joeyparrish,

The error seems to be resolved but I am not able to see the ad on the player.

    requestAds() {
        this.adManager.initClientSide(this.clientSideAdContainer, this.video_);

        const adsRequest = new google.ima.AdsRequest();

        // Your ad tag url should go here. We are using a sample ad tag from the
        // IMA HTML5 SDK implementation guide for this tutorial.
        adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480' +
            '&iu=/124319096/external/' +
            'single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&' +
            'unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%' +
            '3Dlinear&correlator=';

        this.adManager.requestClientSideAds(adsRequest);
    }

If I debug my DOM elements, I do have contents in shaka-client-side-ad-container
clientSideAdContainer

But the ad doesn't play!!
Am I doing something wrong?

theodab added a commit that referenced this issue Sep 23, 2022
@hiren3897
Copy link
Author

It was an issue of cors but the bug has been resolved!!

I am not able to request multiple ads in the player.

For example, I want to display 3 ads in the player at any time during the video is played.

Can you tell me how can I do that with the cue points on the UI?

I tried to request the ads but the second request doesn't work.

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jan 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: ads The issue involves the Shaka Player ads API or the use of other ad SDKs status: archived Archived and locked; will not be updated type: question A question from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants