Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
pupunzi committed Jan 9, 2021
1 parent 8614a07 commit e42dbab
Show file tree
Hide file tree
Showing 7 changed files with 3,542 additions and 54 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": "7562"
"buildnum": "7566"
}
2 changes: 1 addition & 1 deletion dist/css/jquery.mb.YTPlayer.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
file: index.tmpl
last modified: 10/25/18 8:00 PM
Version: 3.3.8
Build: 7562
Build: 7566
Open Lab s.r.l., Florence - Italy
email: [email protected]
Expand All @@ -27,9 +27,9 @@
<meta charset="UTF-8">
<title>youtube Chromeless Player - mb.YTPlayer</title>
<link href='//fonts.googleapis.com/css?family=Lekton|Lobster' rel='stylesheet' type='text/css'>
<link href="css/jquery.mb.YTPlayer.min.css?_bn=7562" media="all" rel="stylesheet" type="text/css">
<link href="css/jquery.mb.YTPlayer.min.css?_bn=7566" media="all" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="jquery.mb.YTPlayer.js?_bn=7562"></script>
<script src="jquery.mb.YTPlayer.js?_bn=7566"></script>
<script src="../examples/assets/apikey.js"></script>
<style>
*:focus {
Expand Down
87 changes: 42 additions & 45 deletions dist/jquery.mb.YTPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let getYTPVideoID = function (url) {
jQuery.mbYTPlayer = {
name : 'jquery.mb.YTPlayer',
version: '3.3.8',
build : '7562',
build : '7566',
author : 'Matteo Bicocchi (pupunzi)',
apiKey : '',

Expand Down Expand Up @@ -364,8 +364,8 @@ let getYTPVideoID = function (url) {
Set properties
*/
let property = $YTPlayer.data('property') && typeof $YTPlayer.data('property') == 'string' ?
eval('(' + $YTPlayer.data('property') + ')') :
$YTPlayer.data('property');
eval('(' + $YTPlayer.data('property') + ')') :
$YTPlayer.data('property');

if (typeof property !== 'object')
property = {};
Expand Down Expand Up @@ -444,17 +444,17 @@ let getYTPVideoID = function (url) {
YTPlayer.isAlone = false;
YTPlayer.hasFocus = true;
YTPlayer.videoID = YTPlayer.opt.videoURL ?
getYTPVideoID(YTPlayer.opt.videoURL).videoID : $YTPlayer.attr('href') ?
getYTPVideoID($YTPlayer.attr('href')).videoID :
false;
getYTPVideoID(YTPlayer.opt.videoURL).videoID : $YTPlayer.attr('href') ?
getYTPVideoID($YTPlayer.attr('href')).videoID :
false;

/**
Check if it is a video list
*/
YTPlayer.playlistID = YTPlayer.opt.videoURL ?
getYTPVideoID(YTPlayer.opt.videoURL).playlistID : $YTPlayer.attr('href') ?
getYTPVideoID($YTPlayer.attr('href')).playlistID :
false;
getYTPVideoID(YTPlayer.opt.videoURL).playlistID : $YTPlayer.attr('href') ?
getYTPVideoID($YTPlayer.attr('href')).playlistID :
false;

let start_from_last = 0;
if (jQuery.mbCookie.get('YTPlayer_start_from' + YTPlayer.videoID))
Expand Down Expand Up @@ -697,10 +697,10 @@ let getYTPVideoID = function (url) {

new YT.Player(YTPlayer.playerID, {
//videoId: YTPlayer.videoID.toString(),
host : YTPlayer.opt.useNoCookie? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com',
host : YTPlayer.opt.useNoCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com',
playerVars: playerVars,
events : {
'onReady' : function (event) {
'onReady' : function (event) {
YTPlayer.player = event.target;
YTPlayer.player.loadVideoById({
videoId : YTPlayer.videoID.toString(),
Expand All @@ -720,7 +720,7 @@ let getYTPVideoID = function (url) {
* 3 (buffering)
* 5 (video cued)
*/
'onStateChange' : function (event) {
'onStateChange': function (event) {

if (typeof event.target.getPlayerState != 'function')
return;
Expand All @@ -735,25 +735,24 @@ let getYTPVideoID = function (url) {
YTPlayer.state = state;
// console.debug(YTPlayer.state);


if (event.data === YT.PlayerState.PLAYING) {
event.target.setPlaybackQuality(YTPlayer.opt.quality)
}

let eventType;
switch (state) {

/** unstarted */
/** unstarted */
case -1:
eventType = 'YTPUnstarted';
break;

/** unstarted */
/** unstarted */
case 0:
eventType = 'YTPRealEnd';
break;

/** play */
/** play */
case 1:
eventType = 'YTPPlay';
if (YTPlayer.controlBar.length)
Expand All @@ -765,7 +764,7 @@ let getYTPVideoID = function (url) {
jQuery(document).off('mousedown.YTPstart');
break;

/** pause */
/** pause */
case 2:
eventType = 'YTPPause';
if (YTPlayer.controlBar.length)
Expand All @@ -775,7 +774,7 @@ let getYTPVideoID = function (url) {
YTPlayer.inlinePlayButton.show();
break;

/** buffer */
/** buffer */
case 3:
// YTPlayer.player.setPlaybackQuality('default');
YTPlayer.player.setPlaybackQuality(YTPlayer.opt.quality);
Expand All @@ -784,7 +783,7 @@ let getYTPVideoID = function (url) {
YTPlayer.controlBar.find('.mb_YTPPlayPause').html(jQuery.mbYTPlayer.controls.play);
break;

/** cued */
/** cued */
case 5:
eventType = 'YTPCued';
break;
Expand All @@ -800,6 +799,7 @@ let getYTPVideoID = function (url) {
YTPEvent.time = YTPlayer.currentTime;
jQuery(YTPlayer).trigger(YTPEvent)
},

/**
* onPlaybackQualityChange
* @param e
Expand All @@ -810,6 +810,7 @@ let getYTPVideoID = function (url) {
YTPQualityChange.quality = quality;
jQuery(YTPlayer).trigger(YTPQualityChange)
},

/**
* onError
* @param err
Expand All @@ -820,7 +821,7 @@ let getYTPVideoID = function (url) {
101 – The owner of the requested video does not allow it to be played in embedded players.
150 – This error is the same as 101. It's just a 101 error in disguise!
*/
'onError' : function (err) {
'onError': function (err) {

if (typeof YTPlayer.opt.onError == 'function')
YTPlayer.opt.onError($YTPlayer, err);
Expand All @@ -845,7 +846,6 @@ let getYTPVideoID = function (url) {

if (YTPlayer.isList)
jQuery(YTPlayer).YTPPlayNext()

}
}
});
Expand Down Expand Up @@ -898,11 +898,9 @@ let getYTPVideoID = function (url) {
if (!ytp.YTAPIReady && typeof window.YT == "object") {
jQuery(document).trigger('YTAPIReady');
ytp.YTAPIReady = true;

console.error("YTPlayer: More then a call to the YT API has been detected")
}
}, YTPlayer.opt.delayAtStart)

})
},

Expand Down Expand Up @@ -998,15 +996,15 @@ let getYTPVideoID = function (url) {
for (let x in YTPlayer.videoData) YTPData.prop[x] = YTPlayer.videoData[x];
jQuery(YTPlayer).trigger(YTPData)
})
.fail(function (jqxhr) {
console.error("YT data error:: ", jqxhr);
YTPlayer.hasData = false;

let YTPChanged = jQuery.Event('YTPChanged');
YTPChanged.time = YTPlayer.currentTime;
YTPChanged.videoId = YTPlayer.videoID;
jQuery(YTPlayer).trigger(YTPChanged)
})
.fail(function (jqxhr) {
console.error("YT data error:: ", jqxhr);
YTPlayer.hasData = false;

let YTPChanged = jQuery.Event('YTPChanged');
YTPChanged.time = YTPlayer.currentTime;
YTPChanged.videoId = YTPlayer.videoID;
jQuery(YTPlayer).trigger(YTPChanged)
})
} else {

setTimeout(function () {
Expand Down Expand Up @@ -1383,10 +1381,10 @@ let getYTPVideoID = function (url) {
function RunPrefixMethod(obj, method) {
let pfx = ['webkit', 'moz', 'ms', 'o', ''];
let p = 0,
m, t;
m, t;
while (p < pfx.length && !obj[m]) {
m = method;
if (pfx[p] == '') {
if (pfx[p] === '') {
m = m.substr(0, 1).toLowerCase() + m.substr(1)
}
m = pfx[p] + m;
Expand Down Expand Up @@ -1480,7 +1478,7 @@ let getYTPVideoID = function (url) {
if (!YTPlayer.isReady)
return this;

if (YTPlayer.state == 1)
if (YTPlayer.state === 1)
this.YTPPause();
else
this.YTPPlay();
Expand Down Expand Up @@ -1956,8 +1954,7 @@ let getYTPVideoID = function (url) {
for (let time in YTPlayer.opt.mask) {

if (YTPlayer.opt.mask[time])
img = jQuery('<img/>').attr('src', YTPlayer.opt.mask[time])

let img = jQuery('<img/>').attr('src', YTPlayer.opt.mask[time])
}

if (YTPlayer.opt.mask[0])
Expand All @@ -1966,7 +1963,7 @@ let getYTPVideoID = function (url) {
$YTPlayer.on('YTPTime.mask', function (e) {

for (let time in YTPlayer.opt.mask) {
if (e.time == time)
if (e.time === time)
if (!YTPlayer.opt.mask[time]) {
$YTPlayer.YTPRemoveMask()
} else {
Expand Down Expand Up @@ -2338,8 +2335,8 @@ let getYTPVideoID = function (url) {
YTPlayer.overlay.removeClass(function (index, classNames) {
// change the list into an array
let current_classes = classNames.split(' '),
// array of classes which are to be removed
classes_to_remove = [];
// array of classes which are to be removed
classes_to_remove = [];
jQuery.each(current_classes, function (index, class_name) {
// if the classname begins with bg add it to the classes_to_remove array
if (/raster.*/.test(class_name)) {
Expand Down Expand Up @@ -2404,7 +2401,7 @@ let getYTPVideoID = function (url) {

if (YTPlayer.opt.autoPlay) {
console.debug('We muted the audio to make the video \'auto-play\' according with the latest vendor policy. ' +
'The audio will unmute at the first user interaction with the page');
'The audio will unmute at the first user interaction with the page');
YTPlayer.player.mute();
YTPlayer.forcedMuted = true;
/**
Expand All @@ -2413,15 +2410,15 @@ let getYTPVideoID = function (url) {
* Start playing audio after the first click
*/
jQuery(document).on('mousedown.YTPstartAudio', function () {
if (YTPlayer.forcedMuted){
if (YTPlayer.forcedMuted) {
console.debug("AAAAAAA");
YTPlayer.player.unMute();
YTPlayer.forcedMuted=false;
YTPlayer.forcedMuted = false;
jQuery(document).off('mousedown.YTPstartAudio')
}
});

jQuery(window).on("scroll", function(){
jQuery(window).on("scroll", function () {
console.debug("AAAAA")
})

Expand Down Expand Up @@ -2858,7 +2855,7 @@ jQuery.fn.css3=function(d){return this.each(function(){var a=jQuery(this),b=jQue
file: jquery.mb.simpleSlider.js
last modified: 11/18/17 7:19 PM
Version: 3.3.8
Build: 7562
Build: 7566
Open Lab s.r.l., Florence - Italy
email: [email protected]
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.mb.YTPlayer.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit e42dbab

Please sign in to comment.