I’m using the swipe support mentioned in the official documentation but it’s not working on embedded youtube videos.
I’m using the swipe support mentioned in the official documentation but it’s not working
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem is YouTube videos are actually iframes with HTML5 and embedded video inside. So, swiping across the video doesn’t register with the content outside of the iframe. The easiest solution would be to place an overlay over the video and have it cover just the video. The problem with this is that you can’t tap on the video itself to make it play, you have to use the controls.
In this updated demo, the overlay covers the video and leaves the controls visible (add a
background: #f00;to the swipe overlay css to see it). The controls are 40 pixels tall so you’ll see the height of the overlay takes this into account.Here is the css (the slider is 300 x 200 in size for this demo):
and this is the updated initialization code: