Skip to content

Commit

Permalink
Added "YTPUnavailable" event if player is as background on mobile dev…
Browse files Browse the repository at this point in the history
…ices
  • Loading branch information
mb.jquery.components committed Jun 17, 2016
1 parent 944032f commit a85999e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"test",
"tests"
],
"buildnum": "6005"
"buildnum": "6006"
}
4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
<meta charset="UTF-8">
<title>youtube Chromeless Player - mb.YTPlayer</title>
<link href='http://fonts.googleapis.com/css?family=Lekton|Lobster' rel='stylesheet' type='text/css'>
<link href="css/jquery.mb.YTPlayer.min.css?_bn=5841" media="all" rel="stylesheet" type="text/css">
<link href="css/jquery.mb.YTPlayer.min.css?_bn=5842" media="all" rel="stylesheet" type="text/css">
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js"></script>-->
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script src="jquery.mb.YTPlayer.min.js?_bn=5841"></script>
<script src="jquery.mb.YTPlayer.min.js?_bn=5842"></script>
<script src="../examples/assets/apikey.js"></script>
<style>
*:focus {
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.mb.YTPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var getYTPVideoID = function( url ) {
jQuery.mbYTPlayer = {
name: "jquery.mb.YTPlayer",
version: "3.0.3",
build: "5841",
build: "5842",
author: "Matteo Bicocchi",
apiKey: "",
defaults: {
Expand Down Expand Up @@ -317,6 +317,7 @@ var getYTPVideoID = function( url ) {

if( jQuery.browser.mobile && !YTPlayer.canPlayOnMobile ) {
$YTPlayer.remove();
jQuery( document ).trigger( "YTPUnavailable" );
return;
}

Expand All @@ -336,7 +337,6 @@ var getYTPVideoID = function( url ) {

YTPlayer.isInit = true;


//if is mobile && isPlayer fallback to the default YT player
if( jQuery.browser.mobile && YTPlayer.canPlayOnMobile ) {
// Try to adjust the player dimention
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.mb.YTPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@
"directories": {
"example": "examples"
},
"buildnum": "5841"
"buildnum": "5842"
}
1 change: 1 addition & 0 deletions src/jquery.mb.YTPlayer.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ var getYTPVideoID = function( url ) {

if( jQuery.browser.mobile && !YTPlayer.canPlayOnMobile ) {
$YTPlayer.remove();
jQuery( document ).trigger( "YTPUnavailable" );
return;
}

Expand Down

0 comments on commit a85999e

Please sign in to comment.