Will this work as a solution to the 'videos in slides' issue? #1264

jamminjames opened this Issue Jan 4, 2017 · 0 comments


None yet

1 participant


I believe I've come up with a way to show youtube videos within a slide gracefully.

Take a look at my Android app. (Download apk: https://build.phonegap.com/apps/953229/download/android - it's a 'private' app, so not sure this link will work. Use the "YouTube Test" button. The app is constantly changing, so if that button isn't there anymore, this method will likely have been integrated into the regular 'News in Cartoons' pages, so try those buttons.)

I'm using a fork of the 'Cordova / Phonegap YouTube Android Player API plugin' (https://github.com/jamminjames/cordova-phonegap_youtube_player_api_android), and within an html slide, I use the video's image linked to the 'onclick' function of the plugin, like so:

<div class="ytvideo"><a href="#" onclick="window.youtube.playVideo(\'cBUeipXFisQ\')"><img class="ctr" src="http://img.youtube.com/vi/cBUeipXFisQ/0.jpg" width="370" height="auto" /></a></div>

Note that for the video number inside the parenthesis, you have to use the \ before the single quotes.

The slide is swipe-able, and the video plays and stops without leaving an instance of YouTube open on the device.

The only problem I see is that when you tap on the video jpeg, it zooms in, and then the video player kicks in. It's a little disorienting to the viewer. Is there a way to disable zoom for a single slide?

Does this not solve the video issue for PhotoSwipe? Or am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment