-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Binding click events to container/video does not work while playing (GC) #545
Comments
There's a mix of vars here that I'm not following. $video_element and video_element, are supposed to be the same? But either way, try videojs_player.on('click', function(){}) |
Thanks! However, videojs_player.on('click', function(){}); also does not work in GC (Version 27.0.1453.94 m, Win7) while the movie is playing http://jsbin.com/ijigac/3/edit After the movie stops, it works. P.S. Is it an idea to add this event type to this list add the bottom of https://github.com/videojs/video.js/blob/master/docs/api.md? |
That example works for me, assuming it's supposed to log event X/Y. What platform/browser version? Click could be added to the event list, though it will capture every click, including those on buttons, so I'm not sure how useful it'd be. On May 28, 2013, at 11:18 PM, koosvanderkolk [email protected] wrote:
|
GC / Win7 (Weird, this is mentioned in the post on github, but not in the e-mail
|
Every windows machine + Chrome I check seems to be working, for both your example and this new one I threw together just to check. |
This specific page http://jsbin.com/apigoh/1/edit clicking the video works for me in the following Chrome browsers on Windows 7: Although if you have Emulate touch events enabled it doesn't work. Also tested in IE 10 - it doesn't work (don't know if you care, thought I would test anyway): Hope this helps. |
Ah, so it's a touch events issue. Ok, we're running into those elsewhere too. On May 31, 2013, at 3:53 PM, Dean Taylor [email protected] wrote:
|
If touchevents are available, we disable the click event while playing so that we can toggle the controls. https://github.com/videojs/video.js/blob/master/src/js/control-bar/control-bar.js#L49-L51 |
Perhaps @koosvanderkolk can confirm it's related to touch events? |
For this specific issue, it sounds like we're doing this on purpose. When you're on a touch device, you need to be able to click the video to show the controls after they've hidden, and I think the idea is we don't want that playing/pausing the video at the same time. If you're using a mouse while emulating touch events, I bet that would feel wrong. But that's probably not a use case we can account for. |
Supporting both touch and mouse at the same time is very tough. That's why Microsoft invented PointerEvents, though, I'd rather they'd have just built on top of our current touch events. |
Disabling the 'Emulate touch events' (http://martinkool.com/post/24459554064/emulate-touch-events-in-chrome) solved the problem 👍 (enabled that feature a loooooong time ago and forgot about it) |
@gkatsev I using videojs on a mobile device and need to capture tap events on the video (e.g. for X/Y position of the tap); how can I re-enable the click event for mobile? |
@GFoley83 if you're listening on the player, you can listen to a 'tap' event that we generate, otherwise, you should just listen to touch events on mobile devices. Why do you mean to listen to click directly? |
@gkatsev Just a business requirement; we need to know exactly where on the video has been clicked or tapped as it is playing. And thanks, 'tap' worked as needed. If only I Safari on iOS would support it too... sigh |
@GFoley83 ios safari does support it if the |
@gkatsev Really? I'll have to retest so, thanks for the heads-up. At least that's a step in the right direction. Complete pain the arse that Sarari still goes fullscreen when the video plays though (outside of uiwebview) as that is what's really mucking us up at the moment. |
@GFoley83 only iphones will always go fullscreen. iPads will play in-line just fine. But fullscreen in ipads is native as well. |
@gkatsev do you know if the behavior has changed with respect to listening to 'tap' events? I have the same business case as GFoley83 and wasn't able to get the touch events to work |
I haven't tested this on iphones in recent versions but it probably still behaves in the same manner. |
Using the latest version of the code, in Google Chrome.
http://jsbin.com/ijigac/1/
The text was updated successfully, but these errors were encountered: