Custom video controls in GWD

933 views
Skip to first unread message

Vlad Dedov

unread,
Jul 29, 2015, 9:14:58 AM7/29/15
to Google Web Designer beta
Hi guys!

I'm new to GWD and my current task is to create expandable banner with video and custom video/audio controls.
And the question is, when I press my custom play button how to replace it with pause button and vice versa like it works in integrated video controls.
Thanks for the answers!

Carl

unread,
Jul 30, 2015, 7:10:54 AM7/30/15
to Google Web Designer beta, vlad....@gmail.com
I'm pretty new to GWD so there might be a more efficient way of doing this.

But I had to do something similar with a sound on/off button. All I did was create two buttons on top of each other (one with display:none; on it one without) and then attached 2 click events to each of the buttons (one to display:block; the other button, revealing it, and another to display:none; the current, to hide it).

You'll need a 3rd event on both buttons to play/pause.

Hope that helps!

Vlad Dedov

unread,
Jul 30, 2015, 8:08:52 AM7/30/15
to Google Web Designer beta, carlli...@gmail.com
That sounds optimistic. I had same idea but didn't know how to implement it. And it's good to know that you succeed.
Thanks for advice!

Carl

unread,
Jul 30, 2015, 8:47:22 AM7/30/15
to Google Web Designer beta, vlad....@gmail.com
It's important to use display:block/none as opposed to opacity. Otherwise you'll always be clicking the top-most element.

Good luck, let me know how you get on.

Vlad Dedov

unread,
Jul 30, 2015, 9:36:14 AM7/30/15
to Google Web Designer beta, carlli...@gmail.com
Hi Carl!

Actually I need volume controls as well and I did it your way and it works perfect!
So thank you very much for advice!
Now I'll start with play/pause controls. 
Fingers crossed :)

Vlad Dedov

unread,
Jul 30, 2015, 9:53:54 AM7/30/15
to Google Web Designer beta, carlli...@gmail.com, vlad....@gmail.com
Only thing I don't know so far is how to display:none for mute icon from very beginning. I just set opacity to 0. But it works!

Carl

unread,
Jul 30, 2015, 9:56:14 AM7/30/15
to Google Web Designer beta, vlad....@gmail.com
Well, how I did it was click on the element (assuming it has no key frames) at the beginning of your timeline and set the css property to display:none;

See attached file.
Screen Shot 2015-07-30 at 14.55.41.png

Vlad Dedov

unread,
Jul 30, 2015, 10:42:03 AM7/30/15
to Google Web Designer beta, carlli...@gmail.com
This way is better indeed!

Vlad Dedov

unread,
Jul 30, 2015, 10:44:21 AM7/30/15
to Google Web Designer beta, carlli...@gmail.com, vlad....@gmail.com
And I did video controls as well. So your way to do it is works great!
Many thanks for helping me out!

Carl

unread,
Jul 30, 2015, 11:14:43 AM7/30/15
to Google Web Designer beta, vlad....@gmail.com
No problem Vlad.

Would be good if we could attach multiple receivers with multiple configs to a single target (so clicking on one element changes 3 properties on 3 different elements) instead of an event for each.

Maybe there is and I've just missed it!

Happy to help.
Reply all
Reply to author
Forward
0 new messages