thebird / Swipe

Swipe is the most accurate touch slider.
MIT License
6.79k stars 1.69k forks source link

Issue with Vimeo content on Smartphones #345

Open sjoerdoudman opened 11 years ago

sjoerdoudman commented 11 years ago

I've built a site with swipe JS, and it works brilliantly on a Smartphone. However, I load a couple of Vimeo video's in some of the sliders. This also works fine. The problem is though, after you have watched a Vimeo video on mobile, the playbuttons freeze and you cannot watch any other video's until you refresh. Again you can only watch one video then (EVEN stranger, OCCASIONALLY one more).

Greets Sjoerd

trose commented 11 years ago

By play buttons do you mean the video's play controls or the swipe navigation?

sjoerdoudman commented 11 years ago

the video's play buttons. The swipe navigation works fine, but you can't play any more video's. And this problem doesn't occur when you have more then one video outside of the swipe slider on mobile...

sjoerdoudman commented 11 years ago

I just realised I have made a wrong description of the problem. By further study I notice that usually one video will play: The first one in the slider. And this will also play a second or third time....

trose commented 11 years ago

what happens if you swipe to another slide without playing the first?

trose commented 11 years ago

Since Vimeo loads the player in an iframe I'm thinking the swiping action is messing with the iframe's ability to detect touch events or something. Does this problem happen on desktop?

sjoerdoudman commented 11 years ago

Ah, then that one will play and the others won't. No this problem doesn't happen on desktop as far as I know But there is a big difference with how the video's are loaded on the screen version of the site I'm building

sjoerdoudman commented 11 years ago

Yeah, I guess so. I guess the only way to fix this problem is to somehow reload all the Iframes after returning from watching a video. But I cannot figure out what I could use as a trigger. It is alo not a very pretty method...

trose commented 11 years ago

you may have some luck with Vimeo's js api: http://developer.vimeo.com/player/js-api#universal-with-postmessage

Is it possible to create an example with jsfiddle that exhibits this defect?

sjoerdoudman commented 11 years ago

Allright, have a fiddle here. Though strangely enough here I can't get the previous/next buttons to work wich in my real site are working properly...

http://jsfiddle.net/sjoerdoudman/dSkDV/1/

trose commented 11 years ago

hmmm, it might be worth making your own iframe and seeing if it can detect click events. To me it looks like the vimeo iframe isn't getting any.

sjoerdoudman commented 11 years ago

You are very right about that. None of the click events are working. But this would be a bug in the swipe script, being able to put in vimeo-video's is something that should be possible I guess. Strange I couldn't find any posts on this already...

sjoerdoudman commented 11 years ago

It has been discussed at http://stackoverflow.com/questions/16595474/youtube-vimeo-iframe-wont-play-in-firefox , https://github.com/bradbirdsall/Swipe/issues/36 and https://github.com/cubiq/iscroll/issues/41 since the problem extends to other scripts as well. For youtube the addition &HTML5=1 can be added to the src and that solves some of the problems. But for Vimeo there is no solution.

sjoerdoudman commented 11 years ago

ok, to anyone who runs into this problem: flexslider 2 can do this. I like swipe.js, but this one just solved everything...