Jump to content
Search Community

Lose volume control when draggable enabled.

jimeast test
Moderator Tag

Go to solution Solved by jimeast,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

If I knew ho to identify just the screen maybe I could use it as a trigger.  If I could create a trigger div that contains both screen and controls that's over the screen and also same dimensions as the screen.  Otherwise if I could manipulate the bubbling/capture properties of the control bar so it responds only as a control bar?

Link to comment
Share on other sites

Hey Jim :)

 

I always use a 3rd party player (flowplayer) so I'm not terribly familiar with using the standard video controls, but I think you're on the right track. Preventing the bubbling or at least setting a different z-index seems like it would work. 

 

I wonder if this link might help with setting up your controls?

 

https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Video_player_styling_basics

 

Sorry I can't be of more help, but maybe others will jump in here.

 

Happy tweening.

:)

  • Like 1
Link to comment
Share on other sites

Interesting behaviour... I haven't got much time to muck about with this but I would suggest a quick and dirty way around it being creating an empty div as a parent of the video area, using that as the draggable trigger, make sure the video is taller than the div itself so that the controls are outside the div.

 

If it doesn't work as parent/child combo, it should as siblings.

  • Like 2
Link to comment
Share on other sites

I've not used it, but you could try video.js. It's open source.

 

http://videojs.com/

 

I think flowplayer still allows free use too. (at least they used to) You'll just have their logo on the player. I don't have a whole lot of experience with other players as I've used flowplayer for many years. We produce a lot of videos and they're rock solid and always updating things. They're kind of like the GreenSock of video players.

 

Other than that, you can try rolling your own player and controls with that link I posted in #3 above. You'll also be able to find a lot of tutorials about creating your own with a quick Google search.  I wish I could offer more advice, but that's about all I have for now.

 

Good luck.

:)

  • Like 1
Link to comment
Share on other sites

Hello jimeast

 

You can use all the various built in native API of the <video> element to control playback. And use GSAP to control those controls for volume and playback.

 

This way you can control parts of the video controls by clicking on custom HTML elements, like a custom UI for the <video> element. And then run code that triggers the <video> elements API using JS.

 

For example you can control the volume like this:

// event listener for controlling volume 
customVolumeBar.addEventListener("change", function() {
  // Update the video volume
  video.volume = customVolumeBar.value;
});

// or setting the volume
var videoElement = document.getElementById("video");
videoElement.volume = 0.5;

List of <video> element events:

 

https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events

 

<video> element spec:

 

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video

 

The <video> element is widely supported in all modern browsers:

 

http://caniuse.com/#feat=video

 

And if you need to support older versions of browsers you can use mediaelements.js as a polyfill

 

:)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...