videojs-playlist-ui
Advanced tools
Comparing version 4.2.0 to 4.2.1
@@ -0,1 +1,13 @@ | ||
<a name="4.2.1"></a> | ||
## [4.2.1](https://github.com/videojs/videojs-playlist-ui/compare/v4.2.0...v4.2.1) (2023-05-01) | ||
### Bug Fixes | ||
* Avoid triggering deprecation warning ([#149](https://github.com/videojs/videojs-playlist-ui/issues/149)) ([5facd9f](https://github.com/videojs/videojs-playlist-ui/commit/5facd9f)) | ||
* resolve more deprecation warnings ([#150](https://github.com/videojs/videojs-playlist-ui/issues/150)) ([02dab88](https://github.com/videojs/videojs-playlist-ui/commit/02dab88)) | ||
### Chores | ||
* Updated org in package.json ([#145](https://github.com/videojs/videojs-playlist-ui/issues/145)) ([726c97d](https://github.com/videojs/videojs-playlist-ui/commit/726c97d)) | ||
<a name="4.2.0"></a> | ||
@@ -2,0 +14,0 @@ # [4.2.0](https://github.com/brightcove/videojs-playlist-ui/compare/v4.1.0...v4.2.0) (2023-04-14) |
@@ -1,2 +0,2 @@ | ||
/*! @name videojs-playlist-ui @version 4.2.0 @license Apache-2.0 */ | ||
/*! @name videojs-playlist-ui @version 4.2.1 @license Apache-2.0 */ | ||
'use strict'; | ||
@@ -12,6 +12,7 @@ | ||
var version = "4.2.0"; | ||
var version = "4.2.1"; | ||
const dom = videojs__default["default"].dom || videojs__default["default"]; | ||
const registerPlugin = videojs__default["default"].registerPlugin || videojs__default["default"].plugin; // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
const dom = videojs__default["default"].dom; | ||
const merge = videojs__default["default"].obj ? videojs__default["default"].obj.merge : videojs__default["default"].mergeOptions; | ||
const formatTime = videojs__default["default"].time ? videojs__default["default"].time.formatTime : videojs__default["default"].formatTime; // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
@@ -154,3 +155,3 @@ const supportsCssPointerEvents = (() => { | ||
const duration = document__default["default"].createElement('time'); | ||
const time = videojs__default["default"].formatTime(item.duration); | ||
const time = formatTime(item.duration); | ||
duration.className = 'vjs-playlist-duration'; | ||
@@ -433,3 +434,3 @@ duration.setAttribute('datetime', 'PT0H0M' + item.duration + 'S'); | ||
options = videojs__default["default"].mergeOptions(defaults, options); // If the player is already using this plugin, remove the pre-existing | ||
options = merge(defaults, options); // If the player is already using this plugin, remove the pre-existing | ||
// PlaylistMenu, but retain the element and its location in the DOM because | ||
@@ -471,5 +472,5 @@ // it will be re-used. | ||
registerPlugin('playlistUi', playlistUi); | ||
videojs__default["default"].registerPlugin('playlistUi', playlistUi); | ||
playlistUi.VERSION = version; | ||
module.exports = playlistUi; |
@@ -1,9 +0,10 @@ | ||
/*! @name videojs-playlist-ui @version 4.2.0 @license Apache-2.0 */ | ||
/*! @name videojs-playlist-ui @version 4.2.1 @license Apache-2.0 */ | ||
import document from 'global/document'; | ||
import videojs from 'video.js'; | ||
var version = "4.2.0"; | ||
var version = "4.2.1"; | ||
const dom = videojs.dom || videojs; | ||
const registerPlugin = videojs.registerPlugin || videojs.plugin; // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
const dom = videojs.dom; | ||
const merge = videojs.obj ? videojs.obj.merge : videojs.mergeOptions; | ||
const formatTime = videojs.time ? videojs.time.formatTime : videojs.formatTime; // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
@@ -146,3 +147,3 @@ const supportsCssPointerEvents = (() => { | ||
const duration = document.createElement('time'); | ||
const time = videojs.formatTime(item.duration); | ||
const time = formatTime(item.duration); | ||
duration.className = 'vjs-playlist-duration'; | ||
@@ -425,3 +426,3 @@ duration.setAttribute('datetime', 'PT0H0M' + item.duration + 'S'); | ||
options = videojs.mergeOptions(defaults, options); // If the player is already using this plugin, remove the pre-existing | ||
options = merge(defaults, options); // If the player is already using this plugin, remove the pre-existing | ||
// PlaylistMenu, but retain the element and its location in the DOM because | ||
@@ -463,5 +464,5 @@ // it will be re-used. | ||
registerPlugin('playlistUi', playlistUi); | ||
videojs.registerPlugin('playlistUi', playlistUi); | ||
playlistUi.VERSION = version; | ||
export { playlistUi as default }; |
@@ -1,2 +0,2 @@ | ||
/*! @name videojs-playlist-ui @version 4.2.0 @license Apache-2.0 */ | ||
/*! @name videojs-playlist-ui @version 4.2.1 @license Apache-2.0 */ | ||
(function (global, factory) { | ||
@@ -12,6 +12,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js')) : | ||
var version = "4.2.0"; | ||
var version = "4.2.1"; | ||
const dom = videojs__default["default"].dom || videojs__default["default"]; | ||
const registerPlugin = videojs__default["default"].registerPlugin || videojs__default["default"].plugin; // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
const dom = videojs__default["default"].dom; | ||
const merge = videojs__default["default"].obj ? videojs__default["default"].obj.merge : videojs__default["default"].mergeOptions; | ||
const formatTime = videojs__default["default"].time ? videojs__default["default"].time.formatTime : videojs__default["default"].formatTime; // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
@@ -154,3 +155,3 @@ const supportsCssPointerEvents = (() => { | ||
const duration = document.createElement('time'); | ||
const time = videojs__default["default"].formatTime(item.duration); | ||
const time = formatTime(item.duration); | ||
duration.className = 'vjs-playlist-duration'; | ||
@@ -433,3 +434,3 @@ duration.setAttribute('datetime', 'PT0H0M' + item.duration + 'S'); | ||
options = videojs__default["default"].mergeOptions(defaults, options); // If the player is already using this plugin, remove the pre-existing | ||
options = merge(defaults, options); // If the player is already using this plugin, remove the pre-existing | ||
// PlaylistMenu, but retain the element and its location in the DOM because | ||
@@ -471,3 +472,3 @@ // it will be re-used. | ||
registerPlugin('playlistUi', playlistUi); | ||
videojs__default["default"].registerPlugin('playlistUi', playlistUi); | ||
playlistUi.VERSION = version; | ||
@@ -474,0 +475,0 @@ |
@@ -1,2 +0,2 @@ | ||
/*! @name videojs-playlist-ui @version 4.2.0 @license Apache-2.0 */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).videojsPlaylistUi=e(t.videojs)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=e(t);const i=s.default.dom||s.default,l=s.default.registerPlugin||s.default.plugin,n={className:"vjs-playlist",playOnSelect:!1,supportsCssPointerEvents:(()=>{const t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents})()},a=function(t){t.addClass("vjs-selected")},o=function(t){t.removeClass("vjs-selected"),t.thumbnail&&i.removeClass(t.thumbnail,"vjs-playlist-now-playing")},d=function(t){t.removeClass("vjs-up-next")},r=s.default.getComponent("Component");class p extends r{constructor(t,e,s){if(!e.item)throw new Error("Cannot construct a PlaylistMenuItem without an item option");e.showDescription=s.showDescription,super(t,e),this.item=e.item,this.playOnSelect=s.playOnSelect,this.emitTapEvents(),this.on(["click","tap"],this.switchPlaylistItem_),this.on("keydown",this.handleKeyDown_)}handleKeyDown_(t){13!==t.which&&32!==t.which||this.switchPlaylistItem_()}switchPlaylistItem_(t){this.player_.playlist.currentItem(this.player_.playlist().indexOf(this.item)),this.playOnSelect&&this.player_.play()}createEl(){const t=document.createElement("li"),e=this.options_.item,i=this.options_.showDescription;if("object"==typeof e.data){Object.keys(e.data).forEach((s=>{const i=e.data[s];t.dataset[s]=i}))}if(t.className="vjs-playlist-item",t.setAttribute("tabIndex",0),this.thumbnail=function(t){if(!t){const t=document.createElement("div");return t.className="vjs-playlist-thumbnail vjs-playlist-thumbnail-placeholder",t}const e=document.createElement("picture");if(e.className="vjs-playlist-thumbnail","string"==typeof t){const s=document.createElement("img");s.loading="lazy",s.src=t,s.alt="",e.appendChild(s)}else{for(let s=0;s<t.length-1;s++){const i=t[s],l=document.createElement("source");for(const t in i)l[t]=i[t];e.appendChild(l)}const s=t[t.length-1],i=document.createElement("img");i.loading="lazy",i.alt="";for(const t in s)i[t]=s[t];e.appendChild(i)}return e}(e.thumbnail),t.appendChild(this.thumbnail),e.duration){const i=document.createElement("time"),l=s.default.formatTime(e.duration);i.className="vjs-playlist-duration",i.setAttribute("datetime","PT0H0M"+e.duration+"S"),i.appendChild(document.createTextNode(l)),t.appendChild(i)}const l=document.createElement("span"),n=this.localize("Now Playing");l.className="vjs-playlist-now-playing-text",l.appendChild(document.createTextNode(n)),l.setAttribute("title",n),this.thumbnail.appendChild(l);const a=document.createElement("div");a.className="vjs-playlist-title-container",this.thumbnail.appendChild(a);const o=document.createElement("span"),d=this.localize("Up Next");o.className="vjs-up-next-text",o.appendChild(document.createTextNode(d)),o.setAttribute("title",d),a.appendChild(o);const r=document.createElement("cite"),p=e.name||this.localize("Untitled Video");if(r.className="vjs-playlist-name",r.appendChild(document.createTextNode(p)),r.setAttribute("title",p),a.appendChild(r),this.thumbnail.getElementsByTagName("img").alt=p,i){const t=document.createElement("div"),s=e.description||"";t.className="vjs-playlist-description",t.appendChild(document.createTextNode(s)),t.setAttribute("title",s),a.appendChild(t)}return t}}class c extends r{constructor(t,e){if(!t.playlist)throw new Error("videojs-playlist is required for the playlist component");super(t,e),this.items=[],e.horizontal?this.addClass("vjs-playlist-horizontal"):this.addClass("vjs-playlist-vertical"),e.supportsCssPointerEvents&&this.addClass("vjs-csspointerevents"),this.createPlaylist_(),s.default.browser.TOUCH_ENABLED||this.addClass("vjs-mouse"),this.on(t,["loadstart","playlistchange","playlistsorted"],(t=>{this.update()})),this.on(t,"adstart",(()=>{this.addClass("vjs-ad-playing")})),this.on(t,"adend",(()=>{this.removeClass("vjs-ad-playing")})),this.on("dispose",(()=>{this.empty_(),t.playlistMenu=null})),this.on(t,"dispose",(()=>{this.dispose()}))}createEl(){return i.createEl("div",{className:this.options_.className})}empty_(){this.items&&this.items.length&&(this.items.forEach((t=>t.dispose())),this.items.length=0)}createPlaylist_(){const t=this.player_.playlist()||[];let e=this.el_.querySelector(".vjs-playlist-item-list"),s=this.el_.querySelector(".vjs-playlist-ad-overlay");e||(e=document.createElement("ol"),e.className="vjs-playlist-item-list",this.el_.appendChild(e)),this.empty_();for(let s=0;s<t.length;s++){const i=new p(this.player_,{item:t[s]},this.options_);this.items.push(i),e.appendChild(i.el_)}s||(s=document.createElement("li"),s.className="vjs-playlist-ad-overlay"),e.appendChild(s);const l=this.player_.playlist.currentItem();if(this.items.length&&l>=0){a(this.items[l]);const t=this.items[l].$(".vjs-playlist-thumbnail");t&&i.addClass(t,"vjs-playlist-now-playing")}}update(){const t=this.player_.playlist();if(this.items.length!==t.length)return void this.createPlaylist_();for(let e=0;e<this.items.length;e++)if(this.items[e].item!==t[e])return void this.createPlaylist_();const e=this.player_.playlist.currentItem();for(let t=0;t<this.items.length;t++){const s=this.items[t];t===e?(a(s),document.activeElement!==s.el()&&i.addClass(s.thumbnail,"vjs-playlist-now-playing"),d(s)):t===e+1?(o(s),s.addClass("vjs-up-next")):(o(s),d(s))}}}const h=t=>{for(let e=0;e<t.childNodes.length;e++)if(i.isEl(t.childNodes[e]))return!0;return!1},m=function(t){const e=this;if(!e.playlist)throw new Error("videojs-playlist plugin is required by the videojs-playlist-ui plugin");if(i.isEl(t)&&(s.default.log.warn('videojs-playlist-ui: Passing an element directly to playlistUi() is deprecated, use the "el" option instead!'),t={el:t}),t=s.default.mergeOptions(n,t),e.playlistMenu){const s=e.playlistMenu.el();if(s){const l=s.parentNode,n=s.nextSibling;e.playlistMenu.dispose(),i.emptyEl(s),n?l.insertBefore(s,n):l.appendChild(s),t.el=s}}i.isEl(t.el)||(t.el=(t=>{const e=document.querySelectorAll("."+t);let s;for(let t=0;t<e.length;t++)if(!h(e[t])){s=e[t];break}return s})(t.className)),e.playlistMenu=new c(e,t)};return s.default.registerComponent("PlaylistMenu",c),s.default.registerComponent("PlaylistMenuItem",p),l("playlistUi",m),m.VERSION="4.2.0",m})); | ||
/*! @name videojs-playlist-ui @version 4.2.1 @license Apache-2.0 */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).videojsPlaylistUi=e(t.videojs)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=e(t);const i=s.default.dom,l=s.default.obj?s.default.obj.merge:s.default.mergeOptions,a=s.default.time?s.default.time.formatTime:s.default.formatTime,n={className:"vjs-playlist",playOnSelect:!1,supportsCssPointerEvents:(()=>{const t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents})()},o=function(t){t.addClass("vjs-selected")},d=function(t){t.removeClass("vjs-selected"),t.thumbnail&&i.removeClass(t.thumbnail,"vjs-playlist-now-playing")},r=function(t){t.removeClass("vjs-up-next")},c=s.default.getComponent("Component");class p extends c{constructor(t,e,s){if(!e.item)throw new Error("Cannot construct a PlaylistMenuItem without an item option");e.showDescription=s.showDescription,super(t,e),this.item=e.item,this.playOnSelect=s.playOnSelect,this.emitTapEvents(),this.on(["click","tap"],this.switchPlaylistItem_),this.on("keydown",this.handleKeyDown_)}handleKeyDown_(t){13!==t.which&&32!==t.which||this.switchPlaylistItem_()}switchPlaylistItem_(t){this.player_.playlist.currentItem(this.player_.playlist().indexOf(this.item)),this.playOnSelect&&this.player_.play()}createEl(){const t=document.createElement("li"),e=this.options_.item,s=this.options_.showDescription;if("object"==typeof e.data){Object.keys(e.data).forEach((s=>{const i=e.data[s];t.dataset[s]=i}))}if(t.className="vjs-playlist-item",t.setAttribute("tabIndex",0),this.thumbnail=function(t){if(!t){const t=document.createElement("div");return t.className="vjs-playlist-thumbnail vjs-playlist-thumbnail-placeholder",t}const e=document.createElement("picture");if(e.className="vjs-playlist-thumbnail","string"==typeof t){const s=document.createElement("img");s.loading="lazy",s.src=t,s.alt="",e.appendChild(s)}else{for(let s=0;s<t.length-1;s++){const i=t[s],l=document.createElement("source");for(const t in i)l[t]=i[t];e.appendChild(l)}const s=t[t.length-1],i=document.createElement("img");i.loading="lazy",i.alt="";for(const t in s)i[t]=s[t];e.appendChild(i)}return e}(e.thumbnail),t.appendChild(this.thumbnail),e.duration){const s=document.createElement("time"),i=a(e.duration);s.className="vjs-playlist-duration",s.setAttribute("datetime","PT0H0M"+e.duration+"S"),s.appendChild(document.createTextNode(i)),t.appendChild(s)}const i=document.createElement("span"),l=this.localize("Now Playing");i.className="vjs-playlist-now-playing-text",i.appendChild(document.createTextNode(l)),i.setAttribute("title",l),this.thumbnail.appendChild(i);const n=document.createElement("div");n.className="vjs-playlist-title-container",this.thumbnail.appendChild(n);const o=document.createElement("span"),d=this.localize("Up Next");o.className="vjs-up-next-text",o.appendChild(document.createTextNode(d)),o.setAttribute("title",d),n.appendChild(o);const r=document.createElement("cite"),c=e.name||this.localize("Untitled Video");if(r.className="vjs-playlist-name",r.appendChild(document.createTextNode(c)),r.setAttribute("title",c),n.appendChild(r),this.thumbnail.getElementsByTagName("img").alt=c,s){const t=document.createElement("div"),s=e.description||"";t.className="vjs-playlist-description",t.appendChild(document.createTextNode(s)),t.setAttribute("title",s),n.appendChild(t)}return t}}class h extends c{constructor(t,e){if(!t.playlist)throw new Error("videojs-playlist is required for the playlist component");super(t,e),this.items=[],e.horizontal?this.addClass("vjs-playlist-horizontal"):this.addClass("vjs-playlist-vertical"),e.supportsCssPointerEvents&&this.addClass("vjs-csspointerevents"),this.createPlaylist_(),s.default.browser.TOUCH_ENABLED||this.addClass("vjs-mouse"),this.on(t,["loadstart","playlistchange","playlistsorted"],(t=>{this.update()})),this.on(t,"adstart",(()=>{this.addClass("vjs-ad-playing")})),this.on(t,"adend",(()=>{this.removeClass("vjs-ad-playing")})),this.on("dispose",(()=>{this.empty_(),t.playlistMenu=null})),this.on(t,"dispose",(()=>{this.dispose()}))}createEl(){return i.createEl("div",{className:this.options_.className})}empty_(){this.items&&this.items.length&&(this.items.forEach((t=>t.dispose())),this.items.length=0)}createPlaylist_(){const t=this.player_.playlist()||[];let e=this.el_.querySelector(".vjs-playlist-item-list"),s=this.el_.querySelector(".vjs-playlist-ad-overlay");e||(e=document.createElement("ol"),e.className="vjs-playlist-item-list",this.el_.appendChild(e)),this.empty_();for(let s=0;s<t.length;s++){const i=new p(this.player_,{item:t[s]},this.options_);this.items.push(i),e.appendChild(i.el_)}s||(s=document.createElement("li"),s.className="vjs-playlist-ad-overlay"),e.appendChild(s);const l=this.player_.playlist.currentItem();if(this.items.length&&l>=0){o(this.items[l]);const t=this.items[l].$(".vjs-playlist-thumbnail");t&&i.addClass(t,"vjs-playlist-now-playing")}}update(){const t=this.player_.playlist();if(this.items.length!==t.length)return void this.createPlaylist_();for(let e=0;e<this.items.length;e++)if(this.items[e].item!==t[e])return void this.createPlaylist_();const e=this.player_.playlist.currentItem();for(let t=0;t<this.items.length;t++){const s=this.items[t];t===e?(o(s),document.activeElement!==s.el()&&i.addClass(s.thumbnail,"vjs-playlist-now-playing"),r(s)):t===e+1?(d(s),s.addClass("vjs-up-next")):(d(s),r(s))}}}const m=t=>{for(let e=0;e<t.childNodes.length;e++)if(i.isEl(t.childNodes[e]))return!0;return!1},u=function(t){const e=this;if(!e.playlist)throw new Error("videojs-playlist plugin is required by the videojs-playlist-ui plugin");if(i.isEl(t)&&(s.default.log.warn('videojs-playlist-ui: Passing an element directly to playlistUi() is deprecated, use the "el" option instead!'),t={el:t}),t=l(n,t),e.playlistMenu){const s=e.playlistMenu.el();if(s){const l=s.parentNode,a=s.nextSibling;e.playlistMenu.dispose(),i.emptyEl(s),a?l.insertBefore(s,a):l.appendChild(s),t.el=s}}i.isEl(t.el)||(t.el=(t=>{const e=document.querySelectorAll("."+t);let s;for(let t=0;t<e.length;t++)if(!m(e[t])){s=e[t];break}return s})(t.className)),e.playlistMenu=new h(e,t)};return s.default.registerComponent("PlaylistMenu",h),s.default.registerComponent("PlaylistMenuItem",p),s.default.registerPlugin("playlistUi",u),u.VERSION="4.2.1",u})); |
{ | ||
"name": "videojs-playlist-ui", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"author": "Brightcove, Inc.", | ||
@@ -40,3 +40,3 @@ "description": "A user interface for the videojs-playlist API", | ||
"type": "git", | ||
"url": "https://github.com/brightcove/videojs-playlist-ui" | ||
"url": "https://github.com/videojs/videojs-playlist-ui" | ||
}, | ||
@@ -43,0 +43,0 @@ "dependencies": { |
@@ -5,4 +5,5 @@ import document from 'global/document'; | ||
const dom = videojs.dom || videojs; | ||
const registerPlugin = videojs.registerPlugin || videojs.plugin; | ||
const dom = videojs.dom; | ||
const merge = videojs.obj ? videojs.obj.merge : videojs.mergeOptions; | ||
const formatTime = videojs.time ? videojs.time.formatTime : videojs.formatTime; | ||
@@ -156,3 +157,3 @@ // see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/pointerevents.js | ||
const duration = document.createElement('time'); | ||
const time = videojs.formatTime(item.duration); | ||
const time = formatTime(item.duration); | ||
@@ -442,3 +443,3 @@ duration.className = 'vjs-playlist-duration'; | ||
options = videojs.mergeOptions(defaults, options); | ||
options = merge(defaults, options); | ||
@@ -485,3 +486,3 @@ // If the player is already using this plugin, remove the pre-existing | ||
// register the plugin | ||
registerPlugin('playlistUi', playlistUi); | ||
videojs.registerPlugin('playlistUi', playlistUi); | ||
@@ -488,0 +489,0 @@ playlistUi.VERSION = VERSION; |
@@ -45,4 +45,6 @@ /* eslint-disable no-console */ | ||
function setup() { | ||
const merge = videojs.obj ? videojs.obj.merge : videojs.mergeOptions; | ||
this.oldVideojsBrowser = videojs.browser; | ||
videojs.browser = videojs.mergeOptions({}, videojs.browser); | ||
videojs.browser = merge({}, videojs.browser); | ||
@@ -49,0 +51,0 @@ this.fixture = document.querySelector('#qunit-fixture'); |
Sorry, the diff of this file is too big to display
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
395310
8478