videojs-playlist-ui
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
/*! videojs-playlist-ui - v1.0.0 - 2015-03-30 | ||
/*! videojs-playlist-ui - v1.0.1 - 2015-03-30 | ||
* Copyright (c) 2015 Brightcove; Licensed Apache-2.0 */ | ||
@@ -3,0 +3,0 @@ |
@@ -1,3 +0,3 @@ | ||
/*! videojs-playlist-ui - v1.0.0 - 2015-03-30 | ||
/*! videojs-playlist-ui - v1.0.1 - 2015-03-30 | ||
* Copyright (c) 2015 Brightcove; Licensed Apache-2.0 */ | ||
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},e=function(){var a=document.createElement("x");return a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents}(),f={className:"vjs-playlist",supportsCssPointerEvents:e},g=function(a){if(!a){var b=document.createElement("div");return b.className="vjs-playlist-thumbnail",b}var c=document.createElement("picture");if(c.className="vjs-playlist-thumbnail","string"==typeof a){var d=document.createElement("img");d.src=a,c.appendChild(d)}else{for(var e=0;e<a.length-1;e++){var f=a[e],g=document.createElement("source");for(var h in f)g[h]=f[h];c.appendChild(g)}var i=a[a.length-1],d=document.createElement("img");for(var h in i)d[h]=i[h];c.appendChild(d)}return c};videojs.PlaylistMenuItem=videojs.Component.extend({init:function(a,b){var c=this;if(!b.item)throw new Error("Cannot construct a PlaylistMenuItem without an item option");b.el=!0,videojs.Component.call(this,a,b),this.el_=this.createEl(b.item),this.item=b.item,this.emitTapEvents(),this.on(["click","tap"],function(b){a.playlist.currentItem(d(a.playlist(),c.item))})},createEl:function(a){var b=document.createElement("li");if(b.className="vjs-playlist-item",b.appendChild(g(a.thumbnail)),a.duration){var c=document.createElement("time"),d=videojs.formatTime(a.duration);c.className="vjs-playlist-duration",c.setAttribute("datetime","PT0H0M"+a.duration+"S"),c.appendChild(document.createTextNode(d)),b.appendChild(c)}var e=document.createElement("cite"),f=a.name||this.localize("Untitled Video");if(e.className="vjs-playlist-name",e.appendChild(document.createTextNode(f)),e.setAttribute("title",f),b.appendChild(e),a.description){var h=document.createElement("p");h.className="vjs-playlist-description",h.appendChild(document.createTextNode(a.description)),h.setAttribute("title",a.description),b.appendChild(h)}return b}}),videojs.PlaylistMenu=videojs.Component.extend({init:function(a,b){var c=this;if(!a.playlist)throw new Error("videojs-playlist is required for the playlist component");var d=videojs.util.mergeOptions(f,b);d.el||(this.el_=document.createElement("ol"),this.el_.className=d.className,d.el=this.el_),videojs.Component.call(this,a,d),d.supportsCssPointerEvents&&this.addClass("vjs-csspointerevents"),this.createPlaylist_(),videojs.TOUCH_ENABLED||this.addClass("vjs-mouse"),a.on(["loadstart","playlistchange"],function(a){c.update()}),a.on("adstart",function(){c.addClass("vjs-ad-playing")}),a.on("adend",function(){c.removeClass("vjs-ad-playing")})},createPlaylist_:function(){for(var a=this.player_.playlist()||[],b=0;b<this.items.length;b++)this.removeChild(this.items[b]);this.items.length=0;var c=this.el_.querySelector(".vjs-playlist-ad-overlay");c&&c.parentNode.removeChild(c);for(var b=0;b<a.length;b++){var d=new videojs.PlaylistMenuItem(this.player_,{item:a[b]});this.items.push(d),this.addChild(d)}c=document.createElement("li"),c.className="vjs-playlist-ad-overlay",this.el_.appendChild(c);var e=this.player_.playlist.currentItem();this.items.length&&e>=0&&this.items[e].addClass("vjs-selected")},items:[],update:function(){var a=this.player_.playlist();if(this.items.length!==a.length)return void this.createPlaylist_();for(var b=0;b<this.items;b++)if(this.items[b].item!==a[b])return void this.createPlaylist_();for(var c=this.player_.playlist.currentItem(),b=0;b<this.items.length;b++)b===c?this.items[b].addClass("vjs-selected"):this.items[b].removeClass("vjs-selected")}});var h=function(a){var b=this,c=void 0,d=void 0;if(!b.playlist)throw new Error("videojs-playlist is required for the playlist component");"undefined"!=typeof HTMLElement&&a instanceof HTMLElement||a&&1===a.nodeType?(d=a,c=videojs.util.mergeOptions(f)):(c=videojs.util.mergeOptions(f,a),d=document.querySelector("."+c.className)),c.el=d,b.playlistMenu=new videojs.PlaylistMenu(b,c)};videojs.plugin("playlistUi",h)},{}]},{},[1]); |
{ | ||
"name": "videojs-playlist-ui", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Brightcove", | ||
@@ -16,2 +16,6 @@ "description": "A playlist video picker for video.js", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/brightcove/videojs-playlist-ui" | ||
}, | ||
"dependencies": {}, | ||
@@ -36,4 +40,4 @@ "devDependencies": { | ||
"video.js": "^4.5", | ||
"videojs-playlist": "git+https://github.com/brightcove/videojs-playlist.git#build" | ||
"videojs-playlist": "^1.0.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
44298
4