Skip to content

Commit

Permalink
Release v3.3.8 stable
Browse files Browse the repository at this point in the history
  • Loading branch information
pupunzi committed Dec 4, 2020
1 parent 6495793 commit f6e45c0
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 53 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery.mb.ytplayer",
"version": "3.3.7",
"version": "3.3.8",
"homepage": "http://pupunzi.open-lab.com/mb-jquery-components/jquery-mb-ytplayer",
"authors": [
"pupunzi <[email protected]>"
Expand All @@ -22,5 +22,5 @@
"test",
"tests"
],
"buildnum": "7557"
"buildnum": "7561"
}
2 changes: 1 addition & 1 deletion dist/css/jquery.mb.YTPlayer.min.css

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
file: index.tmpl
last modified: 10/25/18 8:00 PM
Version: 3.3.7
Build: 7557
Version: 3.3.8
Build: 7561
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=7557" media="all" rel="stylesheet" type="text/css">
<link href="css/jquery.mb.YTPlayer.min.css?_bn=7561" 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=7557"></script>
<script src="jquery.mb.YTPlayer.js?_bn=7561"></script>
<script src="../examples/assets/apikey.js"></script>
<style>
*:focus {
Expand Down Expand Up @@ -373,7 +373,6 @@
var $slaider = $( slider );
if ( slider.value ) applFilters.push( $slaider.data( "filter" ) + ": " + ( +( slider.value ).toFixed( 0 ) ) );
}

for ( var y in applFilters ) {
var comma = y < applFilters.length - 1 ? "," : "<br>";
desc += "<br> &nbsp;&nbsp;&nbsp;" + applFilters[ y ] + comma;
Expand Down
52 changes: 29 additions & 23 deletions dist/jquery.mb.YTPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

var ytp = ytp || {};

let YTPrndSuffix = new Date().getTime();
let YTPtimerLabels = {
init : "YTPlayerInit_" + YTPrndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPrndSuffix
}
let YTPRndSuffix = new Date().getTime();
let YTPTimerLabels = {
init : "YTPlayerInit_" + YTPRndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPRndSuffix
};

function onYouTubeIframeAPIReady() {
if (ytp.YTAPIReady)
Expand Down Expand Up @@ -61,8 +61,8 @@ function iOSversion() {

jQuery.mbYTPlayer = {
name : 'jquery.mb.YTPlayer',
version: '3.3.7',
build : '7557',
version: '3.3.8',
build : '7561',
author : 'Matteo Bicocchi (pupunzi)',
apiKey : '',

Expand Down Expand Up @@ -268,6 +268,12 @@ function iOSversion() {
*/
addFilters: false,

/**
useNoCookie (bool)
use https://www.youtube-nocookie.com host to serve the video
*/
useNoCookie: true,

/**
onReady (function)
a callback function fired once the player is ready
Expand Down Expand Up @@ -373,14 +379,14 @@ function iOSversion() {

YTPlayer.opt = jQuery.extend(true, {}, jQuery.mbYTPlayer.defaults, YTPlayer.opt, options, property);

YTPrndSuffix = getYTPVideoID(YTPlayer.opt.videoURL).videoID
YTPtimerLabels = {
init : "YTPlayerInit_" + YTPrndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPrndSuffix
}
YTPRndSuffix = getYTPVideoID(YTPlayer.opt.videoURL).videoID;
YTPTimerLabels = {
init : "YTPlayerInit_" + YTPRndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPRndSuffix
};

console.time(YTPtimerLabels.init);
console.time(YTPtimerLabels.startPlaying);
console.time(YTPTimerLabels.init);
console.time(YTPTimerLabels.startPlaying);

YTPlayer.opt.elementId = YTPlayer.id;

Expand Down Expand Up @@ -698,7 +704,7 @@ function iOSversion() {

new YT.Player(YTPlayer.playerID, {
//videoId: YTPlayer.videoID.toString(),
host : 'https://www.youtube-nocookie.com',
host : YTPlayer.opt.useNoCookie? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com',
playerVars: playerVars,
events : {
'onReady' : function (event) {
Expand Down Expand Up @@ -893,11 +899,11 @@ function iOSversion() {
$YTPlayer.off('YTPTime.mask');
jQuery.mbYTPlayer.applyMask(YTPlayer);

console.timeEnd(YTPtimerLabels.init)
console.timeEnd(YTPTimerLabels.init);

setTimeout(function () {
if (!ytp.YTAPIReady && typeof window.YT == "object") {
jQuery(document).trigger('YTAPIReady')
jQuery(document).trigger('YTAPIReady');
ytp.YTAPIReady = true;

console.error("YTPlayer: More then a call to the YT API has been detected")
Expand Down Expand Up @@ -1071,11 +1077,11 @@ function iOSversion() {
setVideoQuality: function (quality) {

let YTPlayer = this.get(0);
let time = YTPlayer.player.getCurrentTime()
let time = YTPlayer.player.getCurrentTime();
jQuery(YTPlayer).YTPPause();
YTPlayer.opt.quality = quality;
YTPlayer.player.setPlaybackQuality(quality);
YTPlayer.player.seekTo(time) // or set to CurrentTime using player.getCurrentTime()
YTPlayer.player.seekTo(time); // or set to CurrentTime using player.getCurrentTime()
jQuery(YTPlayer).YTPPlay();
return this;
},
Expand Down Expand Up @@ -2415,7 +2421,7 @@ function iOSversion() {
*/
jQuery(document).on('mousedown.YTPstartAudio', function () {
if (YTPlayer.forcedMuted){
console.debug("AAAAAAA")
console.debug("AAAAAAA");
YTPlayer.player.unMute();
YTPlayer.forcedMuted=false;
jQuery(document).off('mousedown.YTPstartAudio')
Expand Down Expand Up @@ -2454,7 +2460,7 @@ function iOSversion() {
})
}
$YTPlayer.YTPPlay();
console.timeEnd(YTPtimerLabels.startPlaying)
console.timeEnd(YTPTimerLabels.startPlaying)
} else {
YTPlayer.preventTrigger = true;
$YTPlayer.YTPPause();
Expand Down Expand Up @@ -2858,8 +2864,8 @@ 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.7
Build: 7557
Version: 3.3.8
Build: 7561
Open Lab s.r.l., Florence - Italy
email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.mb.YTPlayer.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"player",
"custom"
],
"version": "3.3.7",
"version": "3.3.8",
"author": "Pupunzi <[email protected]> (Matteo Bicocchi)",
"maintainers": [
"Pupunzi <[email protected]> (Matteo Bicocchi)"
Expand Down Expand Up @@ -55,5 +55,5 @@
"directories": {
"example": "examples"
},
"buildnum": "7557"
"buildnum": "7561"
}
44 changes: 25 additions & 19 deletions src/jquery.mb.YTPlayer.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ alert('This is the \'jquery.mb.YTPlayer.src.js\' javascript file and can\'t be i

var ytp = ytp || {};

let YTPrndSuffix = new Date().getTime();
let YTPtimerLabels = {
init : "YTPlayerInit_" + YTPrndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPrndSuffix
}
let YTPRndSuffix = new Date().getTime();
let YTPTimerLabels = {
init : "YTPlayerInit_" + YTPRndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPRndSuffix
};

function onYouTubeIframeAPIReady() {
if (ytp.YTAPIReady)
Expand Down Expand Up @@ -271,6 +271,12 @@ function iOSversion() {
*/
addFilters: false,

/**
useNoCookie (bool)
use https://www.youtube-nocookie.com host to serve the video
*/
useNoCookie: true,

/**
onReady (function)
a callback function fired once the player is ready
Expand Down Expand Up @@ -376,14 +382,14 @@ function iOSversion() {

YTPlayer.opt = jQuery.extend(true, {}, jQuery.mbYTPlayer.defaults, YTPlayer.opt, options, property);

YTPrndSuffix = getYTPVideoID(YTPlayer.opt.videoURL).videoID
YTPtimerLabels = {
init : "YTPlayerInit_" + YTPrndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPrndSuffix
}
YTPRndSuffix = getYTPVideoID(YTPlayer.opt.videoURL).videoID;
YTPTimerLabels = {
init : "YTPlayerInit_" + YTPRndSuffix,
startPlaying: "YTPlayerStartPlay_" + YTPRndSuffix
};

console.time(YTPtimerLabels.init);
console.time(YTPtimerLabels.startPlaying);
console.time(YTPTimerLabels.init);
console.time(YTPTimerLabels.startPlaying);

YTPlayer.opt.elementId = YTPlayer.id;

Expand Down Expand Up @@ -701,7 +707,7 @@ function iOSversion() {

new YT.Player(YTPlayer.playerID, {
//videoId: YTPlayer.videoID.toString(),
host : 'https://www.youtube-nocookie.com',
host : YTPlayer.opt.useNoCookie? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com',
playerVars: playerVars,
events : {
'onReady' : function (event) {
Expand Down Expand Up @@ -896,11 +902,11 @@ function iOSversion() {
$YTPlayer.off('YTPTime.mask');
jQuery.mbYTPlayer.applyMask(YTPlayer);

console.timeEnd(YTPtimerLabels.init)
console.timeEnd(YTPTimerLabels.init);

setTimeout(function () {
if (!ytp.YTAPIReady && typeof window.YT == "object") {
jQuery(document).trigger('YTAPIReady')
jQuery(document).trigger('YTAPIReady');
ytp.YTAPIReady = true;

console.error("YTPlayer: More then a call to the YT API has been detected")
Expand Down Expand Up @@ -1074,11 +1080,11 @@ function iOSversion() {
setVideoQuality: function (quality) {

let YTPlayer = this.get(0);
let time = YTPlayer.player.getCurrentTime()
let time = YTPlayer.player.getCurrentTime();
jQuery(YTPlayer).YTPPause();
YTPlayer.opt.quality = quality;
YTPlayer.player.setPlaybackQuality(quality);
YTPlayer.player.seekTo(time) // or set to CurrentTime using player.getCurrentTime()
YTPlayer.player.seekTo(time); // or set to CurrentTime using player.getCurrentTime()
jQuery(YTPlayer).YTPPlay();
return this;
},
Expand Down Expand Up @@ -2418,7 +2424,7 @@ function iOSversion() {
*/
jQuery(document).on('mousedown.YTPstartAudio', function () {
if (YTPlayer.forcedMuted){
console.debug("AAAAAAA")
console.debug("AAAAAAA");
YTPlayer.player.unMute();
YTPlayer.forcedMuted=false;
jQuery(document).off('mousedown.YTPstartAudio')
Expand Down Expand Up @@ -2457,7 +2463,7 @@ function iOSversion() {
})
}
$YTPlayer.YTPPlay();
console.timeEnd(YTPtimerLabels.startPlaying)
console.timeEnd(YTPTimerLabels.startPlaying)
} else {
YTPlayer.preventTrigger = true;
$YTPlayer.YTPPause();
Expand Down

0 comments on commit f6e45c0

Please sign in to comment.