Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

videojs-playlist

Package Overview
Dependencies
Maintainers
180
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

videojs-playlist - npm Package Compare versions

Comparing version 5.1.1 to 5.1.2

3

CHANGELOG.md

@@ -0,1 +1,4 @@

<a name="5.1.2"></a>
## [5.1.2](https://github.com/brightcove/videojs-playlist/compare/v5.1.1...v5.1.2) (2024-05-20)
<a name="5.1.1"></a>

@@ -2,0 +5,0 @@ ## [5.1.1](https://github.com/brightcove/videojs-playlist/compare/v5.1.0...v5.1.1) (2024-04-23)

@@ -1,2 +0,2 @@

/*! @name videojs-playlist @version 5.1.1 @license Apache-2.0 */
/*! @name videojs-playlist @version 5.1.2 @license Apache-2.0 */
'use strict';

@@ -123,2 +123,9 @@

const replay = !player.paused() || player.ended();
const displayPoster = () => {
if (player.audioPosterMode()) {
player.poster(item.poster || '');
}
};
player.trigger('beforeplaylistitem', item.originalValue || item);

@@ -131,2 +138,4 @@

player.poster(suppressPoster ? '' : item.poster || '');
player.off('audiopostermodechange', displayPoster);
player.one('audiopostermodechange', displayPoster);
player.src(item.sources);

@@ -966,3 +975,3 @@ clearTracks(player);

var version = "5.1.1";
var version = "5.1.2";

@@ -969,0 +978,0 @@ const registerPlugin = videojs__default["default"].registerPlugin || videojs__default["default"].plugin;

@@ -1,2 +0,2 @@

/*! @name videojs-playlist @version 5.1.1 @license Apache-2.0 */
/*! @name videojs-playlist @version 5.1.2 @license Apache-2.0 */
import videojs from 'video.js';

@@ -117,2 +117,9 @@

const replay = !player.paused() || player.ended();
const displayPoster = () => {
if (player.audioPosterMode()) {
player.poster(item.poster || '');
}
};
player.trigger('beforeplaylistitem', item.originalValue || item);

@@ -125,2 +132,4 @@

player.poster(suppressPoster ? '' : item.poster || '');
player.off('audiopostermodechange', displayPoster);
player.one('audiopostermodechange', displayPoster);
player.src(item.sources);

@@ -960,3 +969,3 @@ clearTracks(player);

var version = "5.1.1";
var version = "5.1.2";

@@ -963,0 +972,0 @@ const registerPlugin = videojs.registerPlugin || videojs.plugin;

@@ -1,2 +0,2 @@

/*! @name videojs-playlist @version 5.1.1 @license Apache-2.0 */
/*! @name videojs-playlist @version 5.1.2 @license Apache-2.0 */
(function (global, factory) {

@@ -125,2 +125,9 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js')) :

const replay = !player.paused() || player.ended();
const displayPoster = () => {
if (player.audioPosterMode()) {
player.poster(item.poster || '');
}
};
player.trigger('beforeplaylistitem', item.originalValue || item);

@@ -133,2 +140,4 @@

player.poster(suppressPoster ? '' : item.poster || '');
player.off('audiopostermodechange', displayPoster);
player.one('audiopostermodechange', displayPoster);
player.src(item.sources);

@@ -968,3 +977,3 @@ clearTracks(player);

var version = "5.1.1";
var version = "5.1.2";

@@ -971,0 +980,0 @@ const registerPlugin = videojs__default["default"].registerPlugin || videojs__default["default"].plugin;

4

dist/videojs-playlist.min.js

@@ -1,2 +0,2 @@

/*! @name videojs-playlist @version 5.1.1 @license Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsPlaylist=t(e.videojs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e);let n=e=>{const t=e.playlist.autoadvance_;t.timeout&&e.clearTimeout(t.timeout),t.trigger&&e.off("ended",t.trigger),t.timeout=null,t.trigger=null};const l=(e,t)=>{var r;(n(e),"number"==typeof(r=t)&&!isNaN(r)&&r>=0&&r<1/0)?(e.playlist.autoadvance_.delay=t,e.playlist.autoadvance_.trigger=function(){const r=()=>l(e,t);e.one("play",r),e.playlist.autoadvance_.timeout=e.setTimeout((()=>{n(e),e.off("play",r),e.playlist.next(!0)}),1e3*t)},e.one("ended",e.playlist.autoadvance_.trigger)):e.playlist.autoadvance_.delay=null};let i=1;const a=e=>{let t=e;return e&&"object"==typeof e||(t=Object(e),t.originalValue=e),t.playlistItemId_=i++,t},o=e=>e.map(a),s=(e,t)=>{let r=e,n=t;return"object"==typeof e&&(r=e.src),"object"==typeof t&&(n=t.src),/^\/\//.test(r)&&(n=n.slice(n.indexOf("//"))),/^\/\//.test(n)&&(r=r.slice(r.indexOf("//"))),r===n},u=(e,t)=>{for(let r=0;r<e.length;r++){const n=e[r].sources;if(Array.isArray(n))for(let e=0;e<n.length;e++){const l=n[e];if(l&&s(l,t))return r}}return-1};function c(e,t,i=0){let a=null,s=!1;const c=e.playlist=(t,r=0)=>{if(s)throw new Error("do not call playlist() during a playlist change");if(Array.isArray(t)){const n=Array.isArray(a)?a.slice():null;a=o(t),s=!0,e.trigger({type:"duringplaylistchange",nextIndex:r,nextPlaylist:t,previousIndex:c.currentIndex_,previousPlaylist:n||[]}),s=!1,-1!==r&&c.currentItem(r),n&&e.setTimeout((()=>{e.trigger({type:"playlistchange",action:"change"})}),0)}return a.map((e=>e.originalValue||e))};return e.on("loadstart",(()=>{-1===c.currentItem()&&n(e)})),c.currentIndex_=-1,c.player_=e,c.autoadvance_={},c.repeat_=!1,c.currentPlaylistItemId_=null,c.currentItem=(e,t)=>{if(s)return c.currentIndex_;if("number"==typeof e&&c.currentIndex_!==e&&e>=0&&e<a.length)return c.currentIndex_=e,((e,t,r=!1)=>{const n=!e.paused()||e.ended();e.trigger("beforeplaylistitem",t.originalValue||t),t.playlistItemId_&&(e.playlist.currentPlaylistItemId_=t.playlistItemId_),e.poster(r?"":t.poster||""),e.src(t.sources),(e=>{const t=e.remoteTextTracks();let r=t&&t.length||0;for(;r--;)e.removeRemoteTextTrack(t[r])})(e),e.ready((()=>{if((t.textTracks||[]).forEach(e.addRemoteTextTrack.bind(e)),e.trigger("playlistitem",t.originalValue||t),n){const t=e.play();void 0!==t&&"function"==typeof t.then&&t.then(null,(e=>{}))}l(e,e.playlist.autoadvance_.delay)}))})(c.player_,a[c.currentIndex_],t),c.currentIndex_;const r=c.player_.currentSrc()||"";if(c.currentPlaylistItemId_){const e=((e,t)=>{for(let r=0;r<e.length;r++)if(e[r].playlistItemId_===t)return r;return-1})(a,c.currentPlaylistItemId_),t=a[e];if(t&&Array.isArray(t.sources)&&u([t],r)>-1)return c.currentIndex_=e,c.currentIndex_;c.currentPlaylistItemId_=null}return c.currentIndex_=c.indexOf(r),c.currentIndex_},c.add=(t,r)=>{if(s)throw new Error("cannot modify a playlist that is currently changing");("number"!=typeof r||r<0||r>a.length)&&(r=a.length),Array.isArray(t)||(t=[t]),a.splice(r,0,...o(t)),e.trigger({type:"playlistchange",action:"add"}),e.trigger({type:"playlistadd",count:t.length,index:r})},c.remove=(t,r=1)=>{if(s)throw new Error("cannot modify a playlist that is currently changing");"number"!=typeof t||t<0||t>a.length||(a.splice(t,r),e.trigger({type:"playlistchange",action:"remove"}),e.trigger({type:"playlistremove",count:r,index:t}))},c.contains=e=>-1!==c.indexOf(e),c.indexOf=e=>{if("string"==typeof e)return u(a,e);const t=Array.isArray(e)?e:e.sources;for(let e=0;e<t.length;e++){const r=t[e];if("string"==typeof r)return u(a,r);if(r.src)return u(a,r.src)}return-1},c.currentIndex=()=>c.currentItem(),c.lastIndex=()=>a.length-1,c.nextIndex=()=>{const e=c.currentItem();if(-1===e)return-1;const t=c.lastIndex();return c.repeat_&&e===t?0:Math.min(e+1,t)},c.previousIndex=()=>{const e=c.currentItem();return-1===e?-1:c.repeat_&&0===e?c.lastIndex():Math.max(e-1,0)},c.first=()=>{if(s)return;const e=c.currentItem(0);if(a.length)return a[e].originalValue||a[e];c.currentIndex_=-1},c.last=()=>{if(s)return;const e=c.currentItem(c.lastIndex());if(a.length)return a[e].originalValue||a[e];c.currentIndex_=-1},c.next=(e=!1)=>{if(s)return;const t=c.nextIndex();if(t!==c.currentIndex_){const r=c.currentItem(t,e);return a[r].originalValue||a[r]}},c.previous=()=>{if(s)return;const e=c.previousIndex();if(e!==c.currentIndex_){const t=c.currentItem(e);return a[t].originalValue||a[t]}},c.autoadvance=e=>{l(c.player_,e)},c.repeat=e=>void 0===e?c.repeat_:"boolean"==typeof e?(c.repeat_=!!e,c.repeat_):void r.default.log.error("videojs-playlist: Invalid value for repeat",e),c.sort=t=>{a.length&&(a.sort(t),s||e.trigger("playlistsorted"))},c.reverse=()=>{a.length&&(a.reverse(),s||e.trigger("playlistsorted"))},c.shuffle=({rest:t}={})=>{let r=0,n=a;t&&(r=c.currentIndex_+1,n=a.slice(r)),n.length<=1||((e=>{let t=-1;const r=e.length-1;for(;++t<e.length;){const n=t+Math.floor(Math.random()*(r-t+1)),l=e[n];e[n]=e[t],e[t]=l}})(n),t&&a.splice(...[r,n.length].concat(n)),s||e.trigger("playlistsorted"))},Array.isArray(t)?c(t,i):a=[],c}const d=function(e,t){c(this,e,t)};return(r.default.registerPlugin||r.default.plugin)("playlist",d),d.VERSION="5.1.1",d}));
/*! @name videojs-playlist @version 5.1.2 @license Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsPlaylist=t(e.videojs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e);let n=e=>{const t=e.playlist.autoadvance_;t.timeout&&e.clearTimeout(t.timeout),t.trigger&&e.off("ended",t.trigger),t.timeout=null,t.trigger=null};const l=(e,t)=>{var r;(n(e),"number"==typeof(r=t)&&!isNaN(r)&&r>=0&&r<1/0)?(e.playlist.autoadvance_.delay=t,e.playlist.autoadvance_.trigger=function(){const r=()=>l(e,t);e.one("play",r),e.playlist.autoadvance_.timeout=e.setTimeout((()=>{n(e),e.off("play",r),e.playlist.next(!0)}),1e3*t)},e.one("ended",e.playlist.autoadvance_.trigger)):e.playlist.autoadvance_.delay=null};let i=1;const a=e=>{let t=e;return e&&"object"==typeof e||(t=Object(e),t.originalValue=e),t.playlistItemId_=i++,t},o=e=>e.map(a),s=(e,t)=>{let r=e,n=t;return"object"==typeof e&&(r=e.src),"object"==typeof t&&(n=t.src),/^\/\//.test(r)&&(n=n.slice(n.indexOf("//"))),/^\/\//.test(n)&&(r=r.slice(r.indexOf("//"))),r===n},u=(e,t)=>{for(let r=0;r<e.length;r++){const n=e[r].sources;if(Array.isArray(n))for(let e=0;e<n.length;e++){const l=n[e];if(l&&s(l,t))return r}}return-1};function c(e,t,i=0){let a=null,s=!1;const c=e.playlist=(t,r=0)=>{if(s)throw new Error("do not call playlist() during a playlist change");if(Array.isArray(t)){const n=Array.isArray(a)?a.slice():null;a=o(t),s=!0,e.trigger({type:"duringplaylistchange",nextIndex:r,nextPlaylist:t,previousIndex:c.currentIndex_,previousPlaylist:n||[]}),s=!1,-1!==r&&c.currentItem(r),n&&e.setTimeout((()=>{e.trigger({type:"playlistchange",action:"change"})}),0)}return a.map((e=>e.originalValue||e))};return e.on("loadstart",(()=>{-1===c.currentItem()&&n(e)})),c.currentIndex_=-1,c.player_=e,c.autoadvance_={},c.repeat_=!1,c.currentPlaylistItemId_=null,c.currentItem=(e,t)=>{if(s)return c.currentIndex_;if("number"==typeof e&&c.currentIndex_!==e&&e>=0&&e<a.length)return c.currentIndex_=e,((e,t,r=!1)=>{const n=!e.paused()||e.ended(),i=()=>{e.audioPosterMode()&&e.poster(t.poster||"")};e.trigger("beforeplaylistitem",t.originalValue||t),t.playlistItemId_&&(e.playlist.currentPlaylistItemId_=t.playlistItemId_),e.poster(r?"":t.poster||""),e.off("audiopostermodechange",i),e.one("audiopostermodechange",i),e.src(t.sources),(e=>{const t=e.remoteTextTracks();let r=t&&t.length||0;for(;r--;)e.removeRemoteTextTrack(t[r])})(e),e.ready((()=>{if((t.textTracks||[]).forEach(e.addRemoteTextTrack.bind(e)),e.trigger("playlistitem",t.originalValue||t),n){const t=e.play();void 0!==t&&"function"==typeof t.then&&t.then(null,(e=>{}))}l(e,e.playlist.autoadvance_.delay)}))})(c.player_,a[c.currentIndex_],t),c.currentIndex_;const r=c.player_.currentSrc()||"";if(c.currentPlaylistItemId_){const e=((e,t)=>{for(let r=0;r<e.length;r++)if(e[r].playlistItemId_===t)return r;return-1})(a,c.currentPlaylistItemId_),t=a[e];if(t&&Array.isArray(t.sources)&&u([t],r)>-1)return c.currentIndex_=e,c.currentIndex_;c.currentPlaylistItemId_=null}return c.currentIndex_=c.indexOf(r),c.currentIndex_},c.add=(t,r)=>{if(s)throw new Error("cannot modify a playlist that is currently changing");("number"!=typeof r||r<0||r>a.length)&&(r=a.length),Array.isArray(t)||(t=[t]),a.splice(r,0,...o(t)),e.trigger({type:"playlistchange",action:"add"}),e.trigger({type:"playlistadd",count:t.length,index:r})},c.remove=(t,r=1)=>{if(s)throw new Error("cannot modify a playlist that is currently changing");"number"!=typeof t||t<0||t>a.length||(a.splice(t,r),e.trigger({type:"playlistchange",action:"remove"}),e.trigger({type:"playlistremove",count:r,index:t}))},c.contains=e=>-1!==c.indexOf(e),c.indexOf=e=>{if("string"==typeof e)return u(a,e);const t=Array.isArray(e)?e:e.sources;for(let e=0;e<t.length;e++){const r=t[e];if("string"==typeof r)return u(a,r);if(r.src)return u(a,r.src)}return-1},c.currentIndex=()=>c.currentItem(),c.lastIndex=()=>a.length-1,c.nextIndex=()=>{const e=c.currentItem();if(-1===e)return-1;const t=c.lastIndex();return c.repeat_&&e===t?0:Math.min(e+1,t)},c.previousIndex=()=>{const e=c.currentItem();return-1===e?-1:c.repeat_&&0===e?c.lastIndex():Math.max(e-1,0)},c.first=()=>{if(s)return;const e=c.currentItem(0);if(a.length)return a[e].originalValue||a[e];c.currentIndex_=-1},c.last=()=>{if(s)return;const e=c.currentItem(c.lastIndex());if(a.length)return a[e].originalValue||a[e];c.currentIndex_=-1},c.next=(e=!1)=>{if(s)return;const t=c.nextIndex();if(t!==c.currentIndex_){const r=c.currentItem(t,e);return a[r].originalValue||a[r]}},c.previous=()=>{if(s)return;const e=c.previousIndex();if(e!==c.currentIndex_){const t=c.currentItem(e);return a[t].originalValue||a[t]}},c.autoadvance=e=>{l(c.player_,e)},c.repeat=e=>void 0===e?c.repeat_:"boolean"==typeof e?(c.repeat_=!!e,c.repeat_):void r.default.log.error("videojs-playlist: Invalid value for repeat",e),c.sort=t=>{a.length&&(a.sort(t),s||e.trigger("playlistsorted"))},c.reverse=()=>{a.length&&(a.reverse(),s||e.trigger("playlistsorted"))},c.shuffle=({rest:t}={})=>{let r=0,n=a;t&&(r=c.currentIndex_+1,n=a.slice(r)),n.length<=1||((e=>{let t=-1;const r=e.length-1;for(;++t<e.length;){const n=t+Math.floor(Math.random()*(r-t+1)),l=e[n];e[n]=e[t],e[t]=l}})(n),t&&a.splice(...[r,n.length].concat(n)),s||e.trigger("playlistsorted"))},Array.isArray(t)?c(t,i):a=[],c}const d=function(e,t){c(this,e,t)};return(r.default.registerPlugin||r.default.plugin)("playlist",d),d.VERSION="5.1.2",d}));
{
"name": "videojs-playlist",
"version": "5.1.1",
"version": "5.1.2",
"description": "Playlist plugin for Video.js",

@@ -5,0 +5,0 @@ "main": "dist/videojs-playlist.cjs.js",

@@ -36,2 +36,7 @@ import {setup} from './auto-advance.js';

const replay = !player.paused() || player.ended();
const displayPoster = () => {
if (player.audioPosterMode()) {
player.poster(item.poster || '');
}
};

@@ -45,2 +50,6 @@ player.trigger('beforeplaylistitem', item.originalValue || item);

player.poster(suppressPoster ? '' : item.poster || '');
player.off('audiopostermodechange', displayPoster);
player.one('audiopostermodechange', displayPoster);
player.src(item.sources);

@@ -47,0 +56,0 @@ clearTracks(player);

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc