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

Add Mute is not working #40

Open
rajneesh594 opened this issue Jul 30, 2021 · 3 comments
Open

Add Mute is not working #40

rajneesh594 opened this issue Jul 30, 2021 · 3 comments
Assignees

Comments

@rajneesh594
Copy link

rajneesh594 commented Jul 30, 2021

HI, I am trying to mute the add but it's not working.
Following is my code so that you can understand what I have tried maybe this is some issue with the plugin.

`(function (){
        console.log("50001");
        var vd_scr = 'song.webm?t=1';
        var TAG_VMAP = '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=';
        var player = new Clappr.Player({
            parentId: ".player",
            source: vd_scr,
            width: '100%',
            height: '100%',
            autoPlay:true,
            //mute: true,
            plugins: [
              ClapprImaPlugin,
            ],
            imaPlugin:{
              playInline: true,
              isableNonLinear: true,
              isableNonLinearForIOS: true,
              resetAdOnEnded: true,
              requestAdIfNoAutoplay: true,//always set it to true, to undertand please follow this https://github.com/kslimani/clappr-ima-plugin
              resetAdOnEnded: true,
              imaAdPlayer:{
                  adWillAutoPlay:true,
                  tag: TAG_VMAP,
                  locale: 'us',
                  adWillPlayMuted: true,
                  timeout:300, //The duration in milliseconds to wait for the IMA SDK library to be loaded.
                  maxDuration: 300000,//The maximum duration in milliseconds an ad is displayed
                  
              },
          },
        });
        
      })();`
@kslimani kslimani self-assigned this Jul 30, 2021
@kslimani
Copy link
Owner

Like described in #20, the player mute option must be set to true. (in your code example, it is commented).

Is any error message displayed in browser console ? (are you testing on desktop, or mobile device ?)

Also do you have a demo/test page to share ? (easier for me to debug/reproduce your issue)

@rajneesh594
Copy link
Author

rajneesh594 commented Jul 30, 2021

Here is the code,
https://codepen.io/rdk594/pen/vYmjREK,
And I have commented on the mute because I don't want to mute the vds, I just want to mute ads.
To mute the ad I am using
adWillPlayMuted=true,
You can check in the code that I have set it true but still, it's not working.
Please let me know if I am doing something wrong.

@kslimani
Copy link
Owner

kslimani commented Jul 30, 2021

I forked your code, and i added https to video source and set the mute option to true and it work for me.

https://codepen.io/kslimani/pen/MWmGXxX

Technically, setting mute player option to true adds the muted attribute to the internal video element (which is required to autoplay)

EDIT:

And I have commented on the mute because I don't want to mute the vds, I just want to mute ads.

To my knowledge, you can't mute only the ad and have sound on video content (at least without user consent).

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

No branches or pull requests

2 participants