Skip to content

Commit

Permalink
Fixing another bug with Youtube in lightbox on android
Browse files Browse the repository at this point in the history
  • Loading branch information
moay committed Sep 14, 2015
1 parent 380cfb2 commit 268f03b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
18 changes: 9 additions & 9 deletions dist/afterglow.min.js

Large diffs are not rendered by default.

Binary file added dist/afterglow.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "afterglow",
"description": "An easy to integrate HTML5 video player with lightbox support.",
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/afterglow.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ afterglow = {
// initiate the player and launch it
afterglow.initPlayer(lb_videoel, function(player){

// Prevent autoplay for iOS, won't work anyways...
if(!(/iPad|iPhone|iPod/.test(navigator.platform))){
// Prevent autoplay for mobile devices, won't work anyways...
if(!isMobile){
afterglow.getPlayer(playerid).play();

// Android device, so autoplay didn't work
// If autoplay didn't work
if(afterglow.getPlayer(playerid).paused()){
afterglow.getPlayer(playerid).posterImage.show();
afterglow.getPlayer(playerid).bigPlayButton.show();
Expand Down
15 changes: 14 additions & 1 deletion src/lib/afterglow-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,17 @@ var ie = (function () {
}

return ret;
}()).actualVersion;
}()).actualVersion;

/**
* Sets a variable for mobile devices
*/
var mobileDetect = {
Android: function() { return navigator.userAgent.match(/Android/i); },
BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); },
iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); },
Opera: function() { return navigator.userAgent.match(/Opera Mini/i); },
Windows: function() { return navigator.userAgent.match(/IEMobile/i); },
any: function() { return (mobileDetect.Android() || mobileDetect.BlackBerry() || mobileDetect.iOS() || mobileDetect.Opera() || mobileDetect.Windows()); }
};
var isMobile = mobileDetect.any();
1 change: 0 additions & 1 deletion src/videojs/plugins/Youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ THE SOFTWARE. */
playerVars.html5 = 1;
}


this.activeVideoId = this.url.videoId;
this.activeList = playerVars.list;
this.playerVars = playerVars;
Expand Down

0 comments on commit 268f03b

Please sign in to comment.