Skip to content

Commit

Permalink
Release v3.3.3 stable
Browse files Browse the repository at this point in the history
  • Loading branch information
pupunzi committed Jun 6, 2020
1 parent b8a726c commit 08a7d13
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 78 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.2",
"version": "3.3.3",
"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": "7501"
"buildnum": "7515"
}
2 changes: 1 addition & 1 deletion dist/css/jquery.mb.YTPlayer.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 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.2
Build: 7501
Version: 3.3.3
Build: 7515
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=7501" media="all" rel="stylesheet" type="text/css">
<link href="css/jquery.mb.YTPlayer.min.css?_bn=7515" 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=7501"></script>
<script src="jquery.mb.YTPlayer.js?_bn=7515"></script>
<script src="../examples/assets/apikey.js"></script>
<style>
*:focus {
Expand Down
76 changes: 42 additions & 34 deletions dist/jquery.mb.YTPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function iOSversion() {

jQuery.mbYTPlayer = {
name : 'jquery.mb.YTPlayer',
version: '3.3.2',
build : '7501',
version: '3.3.3',
build : '7515',
author : 'Matteo Bicocchi (pupunzi)',
apiKey : '',

Expand Down Expand Up @@ -957,40 +957,49 @@ function iOSversion() {
* Get video info from API3 (needs api key)
* snippet,player,contentDetails,statistics,status
*/
jQuery.getJSON('https://www.googleapis.com/youtube/v3/videos?id=' + YTPlayer.videoID + '&key=' + jQuery.mbYTPlayer.apiKey + '&part=snippet', function (data) {
YTPlayer.dataReceived = true;

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

function parseYTPlayer_data(data) {
YTPlayer.videoData = {};
YTPlayer.videoData.id = YTPlayer.videoID;
YTPlayer.videoData.channelTitle = data.channelTitle;
YTPlayer.videoData.title = data.title;
YTPlayer.videoData.description = data.description.length < 400 ? data.description : data.description.substring(0, 400) + ' ...';
YTPlayer.videoData.thumb_max = data.thumbnails.maxres ? data.thumbnails.maxres.url : null;
YTPlayer.videoData.thumb_high = data.thumbnails.high ? data.thumbnails.high.url : null;
YTPlayer.videoData.thumb_medium = data.thumbnails.medium ? data.thumbnails.medium.url : null;
jQuery.mbStorage.set('YTPlayer_data_' + YTPlayer.videoID, YTPlayer.videoData)
}

if (!data.items[0]) {
YTPlayer.videoData = {};
YTPlayer.hasData = false
} else {
parseYTPlayer_data(data.items[0].snippet);
YTPlayer.hasData = true
}
jQuery.getJSON('https://www.googleapis.com/youtube/v3/videos?id=' + YTPlayer.videoID + '&key=' + jQuery.mbYTPlayer.apiKey + '&part=snippet', function (data) {
YTPlayer.dataReceived = true;

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

function parseYTPlayer_data(data) {
YTPlayer.videoData = {};
YTPlayer.videoData.id = YTPlayer.videoID;
YTPlayer.videoData.channelTitle = data.channelTitle;
YTPlayer.videoData.title = data.title;
YTPlayer.videoData.description = data.description.length < 400 ? data.description : data.description.substring(0, 400) + ' ...';
YTPlayer.videoData.thumb_max = data.thumbnails.maxres ? data.thumbnails.maxres.url : null;
YTPlayer.videoData.thumb_high = data.thumbnails.high ? data.thumbnails.high.url : null;
YTPlayer.videoData.thumb_medium = data.thumbnails.medium ? data.thumbnails.medium.url : null;
jQuery.mbStorage.set('YTPlayer_data_' + YTPlayer.videoID, YTPlayer.videoData)
}

let YTPData = jQuery.Event('YTPData');
YTPData.prop = {};
for (let x in YTPlayer.videoData) YTPData.prop[x] = YTPlayer.videoData[x];
jQuery(YTPlayer).trigger(YTPData)
})
if (!data.items[0]) {
YTPlayer.videoData = {};
YTPlayer.hasData = false
} else {
parseYTPlayer_data(data.items[0].snippet);
YTPlayer.hasData = true
}

let YTPData = jQuery.Event('YTPData');
YTPData.prop = {};
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)
})
} else {

setTimeout(function () {
Expand All @@ -1000,7 +1009,6 @@ function iOSversion() {
jQuery(YTPlayer).trigger(YTPChanged)
}, 10);
YTPlayer.videoData = null

}

YTPlayer.opt.ratio = YTPlayer.opt.ratio == 'auto' ? 16 / 9 : YTPlayer.opt.ratio;
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.mb.YTPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/test-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div style="text-align: center">
<button id="playVid" style="font-size: 40px; margin: 20px" >INIT YTPLAYER</button>
</div>
<div id="p1" class="player" data-property="{videoURL:'qRSPVj1ldVQ',containment:'#v1', showControls:true, autoPlay:true, loop:2, mute:true, startAt:9, stopAt:100, opacity:1, addRaster:true, quality:'default', playOnlyIfVisible: false}"></div>
<div id="p1" class="player" data-property="{videoURL:'sPyAQQklc1s',containment:'#v1', showControls:true, autoPlay:true, loop:2, mute:true, startAt:9, stopAt:100, opacity:1, addRaster:true, quality:'default', playOnlyIfVisible: false}"></div>
</div>
<script>
function play(){
Expand Down
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.2",
"version": "3.3.3",
"author": "Pupunzi <[email protected]> (Matteo Bicocchi)",
"maintainers": [
"Pupunzi <[email protected]> (Matteo Bicocchi)"
Expand Down Expand Up @@ -55,5 +55,5 @@
"directories": {
"example": "examples"
},
"buildnum": "7501"
"buildnum": "7515"
}
72 changes: 40 additions & 32 deletions src/jquery.mb.YTPlayer.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,40 +960,49 @@ function iOSversion() {
* Get video info from API3 (needs api key)
* snippet,player,contentDetails,statistics,status
*/
jQuery.getJSON('https://www.googleapis.com/youtube/v3/videos?id=' + YTPlayer.videoID + '&key=' + jQuery.mbYTPlayer.apiKey + '&part=snippet', function (data) {
YTPlayer.dataReceived = true;

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

function parseYTPlayer_data(data) {
YTPlayer.videoData = {};
YTPlayer.videoData.id = YTPlayer.videoID;
YTPlayer.videoData.channelTitle = data.channelTitle;
YTPlayer.videoData.title = data.title;
YTPlayer.videoData.description = data.description.length < 400 ? data.description : data.description.substring(0, 400) + ' ...';
YTPlayer.videoData.thumb_max = data.thumbnails.maxres ? data.thumbnails.maxres.url : null;
YTPlayer.videoData.thumb_high = data.thumbnails.high ? data.thumbnails.high.url : null;
YTPlayer.videoData.thumb_medium = data.thumbnails.medium ? data.thumbnails.medium.url : null;
jQuery.mbStorage.set('YTPlayer_data_' + YTPlayer.videoID, YTPlayer.videoData)
}

if (!data.items[0]) {
YTPlayer.videoData = {};
YTPlayer.hasData = false
} else {
parseYTPlayer_data(data.items[0].snippet);
YTPlayer.hasData = true
}
jQuery.getJSON('https://www.googleapis.com/youtube/v3/videos?id=' + YTPlayer.videoID + '&key=' + jQuery.mbYTPlayer.apiKey + '&part=snippet', function (data) {
YTPlayer.dataReceived = true;

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

function parseYTPlayer_data(data) {
YTPlayer.videoData = {};
YTPlayer.videoData.id = YTPlayer.videoID;
YTPlayer.videoData.channelTitle = data.channelTitle;
YTPlayer.videoData.title = data.title;
YTPlayer.videoData.description = data.description.length < 400 ? data.description : data.description.substring(0, 400) + ' ...';
YTPlayer.videoData.thumb_max = data.thumbnails.maxres ? data.thumbnails.maxres.url : null;
YTPlayer.videoData.thumb_high = data.thumbnails.high ? data.thumbnails.high.url : null;
YTPlayer.videoData.thumb_medium = data.thumbnails.medium ? data.thumbnails.medium.url : null;
jQuery.mbStorage.set('YTPlayer_data_' + YTPlayer.videoID, YTPlayer.videoData)
}

let YTPData = jQuery.Event('YTPData');
YTPData.prop = {};
for (let x in YTPlayer.videoData) YTPData.prop[x] = YTPlayer.videoData[x];
jQuery(YTPlayer).trigger(YTPData)
})
if (!data.items[0]) {
YTPlayer.videoData = {};
YTPlayer.hasData = false
} else {
parseYTPlayer_data(data.items[0].snippet);
YTPlayer.hasData = true
}

let YTPData = jQuery.Event('YTPData');
YTPData.prop = {};
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)
})
} else {

setTimeout(function () {
Expand All @@ -1003,7 +1012,6 @@ function iOSversion() {
jQuery(YTPlayer).trigger(YTPChanged)
}, 10);
YTPlayer.videoData = null

}

YTPlayer.opt.ratio = YTPlayer.opt.ratio == 'auto' ? 16 / 9 : YTPlayer.opt.ratio;
Expand Down

0 comments on commit 08a7d13

Please sign in to comment.