Skip to content

Commit

Permalink
rm mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
pomianowski committed Dec 2, 2020
1 parent bb87a3e commit 876cd67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ This is an early version so there is still room for improvement.
| **format*** | The aspect ratio of movies in your playlist<br/>Available: **16by9, 21by9, 2by1**<br/>Default: **'16by9'** |
| **container*** | The HTML element that the player will be placed in<br/>Default: **null** |
| **rounded*** | Adds rounded edges to the player and carousel items<br/>Default: **true** |
| **autoplay*** | Start playback automatically<br/>Default: **false** |
| **playnext*** | Automatically play next videos<br/>Default: **true** |
| **showcontrols*** | Show interface elements like play and next buttons<br/>Default: **true** |
| **autoplay*** | Start playback automatically<br/>Default: **false** |
| **showcontrols*** | Show interface elements like play and next buttons<br/>Default: **false** |
| **showtitles*** | Show videos titles below thumbnails<br/>Default: **false** |
| **showinfo*** | Setting this parameter to FALSE causes the Player to not show information such as the movie title or uploader name before the movie starts.<br/>Default: **false** |
| **showrelated*** | This parameter determines whether the player should show similar movies after the video has finished playing.<br/>Default: **false** |
Expand Down
32 changes: 3 additions & 29 deletions src/js/ytpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class YTPP
#_rounded = true;
#_autoplay = false;
#_playnext = true;
#_showControls = true;
#_showControls = false;
#_showTitles = false;
#_showInfo = false;
#_showRelated = false;
Expand Down Expand Up @@ -239,7 +239,8 @@ class YTPP
{
'onReady': function(e)
{
console.log(e);
console.log('CODE: ', e.data);
console.log("target: "+e.target.getIframe().id);
//ready
},
'onStateChange': function(e)
Expand Down Expand Up @@ -358,31 +359,4 @@ class YTPP

//iframeApi.onload = function(){}
}

#MobileDetector()
{
this.#_isMobile = (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/iPhone|iPad|iPod/i) || navigator.userAgent.match(/Opera Mini/i) || navigator.userAgent.match(/IEMobile/i));
this.#_isIos = navigator.userAgent.match(/iPhone|iPad|iPod/i);

if(this.#_debug)
if(this.#_isMobile && this.#_isIos)
YTPP.ConsoleWrite('iOS device');
else if(this.#_isMobile)
YTPP.ConsoleWrite('Mobile device');
else
YTPP.ConsoleWrite('Desktop device');
}

static #ParseTrue( value )
{
return ( value == true || value == 'true' || value == 1 || value == '1' || value > 0 );
}

static ConsoleWrite(message, color="#fff", data = null )
{
if(data != null)
console.log( "%cYTPP: "+"%c" + message, "color:#dc3545;font-weight: bold;", "color: " + color, data );
else
console.log( "%cYTPP: "+"%c" + message, "color:#dc3545;font-weight: bold;", "color: " + color );
}
}

0 comments on commit 876cd67

Please sign in to comment.