Help YT + DC .isMuted

33 views
Skip to first unread message

primak...@gmail.com

unread,
Mar 1, 2017, 5:47:02 AM3/1/17
to Google Web Designer beta
console.log(document.getElementById('gwd-youtube_1').muted);

//undefined

Help
I do audio switching
all realized
I appeal to the player to listen to sound or not //undefined

line GWD

<gwd-youtube id="gwd-youtube_1" video-url="XXXXXXXX" related="" class="gwd-youtube-zd7p" data-gwd-name="osnovnoe" autoplay="standard" pause-on-end=""></gwd-youtube>

San Khong

unread,
Mar 2, 2017, 2:43:48 PM3/2/17
to Google Web Designer beta
Unfortunately, the mute and unmute attributes are not exposed in the GWD's public API. I've filed a feature request for it. 

However, there's a workaround by using the YouTube iframe player API:

console.log(document.getElementById('gwd-youtube_1').a.isMuted());

Where 'a' is the "minified" name for the YouTube player object. 

Hope it helps.
San
Google Web Designer team

Reply all
Reply to author
Forward
0 new messages