Adding mute/unmute function to YT video via custom code - jQuery I guess

133 views
Skip to first unread message

noaz...@gmail.com

unread,
May 20, 2016, 3:40:33 AM5/20/16
to Google Web Designer beta
Hello.

There is a YT video loading in my banner ad.
I am wondering if possible do do the following:

It should be unmute on mouseover, and mute on mouseout.
If mouseover and you reload the page (with mouseover, without moving), it should recognise this state as mouseover and play the sound.

As GWD doesn"t allow it for YT object, I am trying to add custom code to the page, but it is not working.

Got this script (not even sure if is correct) and wrote it as an event, for the entire page.
>>>>

gwd.auto_Gwd_gesture_1Hover = function(event) {

gwd.actions.gwdYoutube.toggleMute('gwd-youtube_1');

};

gwd.auto_Gwd_gesture_1Hoverend = function(event) {

gwd.actions.gwdYoutube.toggleMute('gwd-youtube_1');

}

Screen Shot 2016-05-20 at 09.24.01.png

Svein-Tore Narvestad

unread,
May 20, 2016, 4:47:25 AM5/20/16
to Google Web Designer beta
Hi!

 It is not so easy to know, but when you add a custom funciton, GWD will automatically add the sentence


gwd.auto_Gwd_gesture_1Hoverend=function(event)

So try to remove this line in your custom code, and, even better:

After adding your function see what changes GWD makes in code view.

Svein-Tore

noaz...@gmail.com

unread,
May 20, 2016, 6:20:06 AM5/20/16
to Google Web Designer beta
Thank you S-T,
I am trying considering your tip.
regards,
N.
Reply all
Reply to author
Forward
0 new messages