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

videojs-hls-source-selector

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

videojs-hls-source-selector - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

build/es5/index.js

@@ -109,3 +109,3 @@ 'use strict';

} else if (player.qualityLevels()[i].bitrate) {
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3) + 'kbps';
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3) + ' kbps';
}

@@ -112,0 +112,0 @@

/*!
* @name videojs-hls-source-selector
* @version 0.0.2
* @version 0.0.3
* @author Justin Fujita <justin@pivotshare.com>

@@ -115,3 +115,3 @@ * @license MIT

} else if (player.qualityLevels()[i].bitrate) {
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3) + 'kbps';
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3) + ' kbps';
}

@@ -211,3 +211,3 @@

// Include the version number.
hlsSourceSelector.VERSION = '0.0.2';
hlsSourceSelector.VERSION = '0.0.3';

@@ -214,0 +214,0 @@ module.exports = hlsSourceSelector;

/*!
* @name videojs-hls-source-selector
* @version 0.0.2
* @version 0.0.3
* @author Justin Fujita <justin@pivotshare.com>
* @license MIT
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsHlsSourceSelector=e()}}(function(){return function e(t,l,o){function n(s,a){if(!l[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var r=new Error("Cannot find module '"+s+"'");throw r.code="MODULE_NOT_FOUND",r}var d=l[s]={exports:{}};t[s][0].call(d.exports,function(e){var l=t[s][1][e];return n(l||e)},d,d.exports,e,t,l,o)}return l[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}({1:[function(e,t,l){(function(e){"use strict";var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e){return e&&"object"===(void 0===e?"undefined":l(e))&&"default"in e?e.default:e}("undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null),n={},i=o.registerPlugin||o.plugin,s=function(e,t){e.addClass("vjs-hls-source-selector"),console.log("videojs-hls-source-selector initialized!");var l=e.qualityLevels();if(console.log("player.techName_:"+e.techName_),"Html5"!=e.techName_)return!1;e.on(["loadedmetadata"],function(n){if(console.warn("VIDEOJS loadedmetadata event"),t&&t.default)if(console.log("options.default: "+t.default),console.log("player.qualityLevels(): "),console.log(e.qualityLevels()),console.log("player.qualityLevels().length: "),console.log(e.qualityLevels().length),"low"==t.default)for(var s=0;s<e.qualityLevels().length;s++)e.qualityLevels()[s].enabled=0==s;else if(t.default="high")for(var s=0;s<e.qualityLevels().length;s++)s==e.qualityLevels().length-1?e.qualityLevels()[s].enabled=!0:e.qualityLevels()[s].enabled=!1;var a=o.getComponent("MenuButton"),u=o.extend(a,{constructor:function(){this.label=document.createElement("span"),t.label="Quality",a.apply(this,arguments),this.el().setAttribute("aria-label","Quality"),this.controlText("Quality");var e=document.createElement("span");o.addClass(e,"vjs-menu-icon"),this.el().appendChild(e),l.on(["change","addqualitylevel"],o.bind(this,this.update))}});u.prototype.update=function(){return a.prototype.update.call(this)},u.prototype.createItems=function(){for(var t=[],l=(e.qualityLevels,0);l<e.qualityLevels().length;l++){console.log(e.qualityLevels()[l].id),console.log(e.qualityLevels()[l]);var o=""+l;e.qualityLevels()[l].height?o=e.qualityLevels()[l].height:e.qualityLevels()[l].bitrate&&(o=Math.floor(e.qualityLevels()[l].bitrate/1e3)+"kbps"),t.push(new i(this.player_,{label:o,index:l,selected:l===(!!e.qualityLevels.selectedIndex&&o)}))}return e.qualityLevels().length>1&&t.push(new i(this.player_,{label:"Auto",index:e.qualityLevels().length,selected:!1})),t},u.prototype.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+"vjs-hls-source-selector-button"},o.registerComponent("ResolutionButton",u),e.getChild("controlBar").addChild("ResolutionButton",{})});var n=o.getComponent("MenuItem"),i=o.extend(n,{constructor:function(e,t){t.selectable=!0,n.call(this,e,t),l.on("change",o.bind(this,this.update)),e.on("resolutionchange",o.bind(this,this.update))}});i.prototype.handleClick=function(e){n.prototype.handleClick.call(this,e),console.log("Change quality to "+this.options_.label),console.log("qualityLevels: "),console.log(this.player_.qualityLevels()),this.selected_=!0,this.selected(!0);for(var t=0;t<this.player_.qualityLevels().length;t++)this.options_.index==this.player_.qualityLevels().length?this.player_.qualityLevels()[t].enabled=!0:t==this.options_.index?this.player_.qualityLevels()[t].enabled=!0:this.player_.qualityLevels()[t].enabled=!1},i.prototype.update=function(){var e=this.player_.qualityLevels().selectedIndex;console.log(this.options_.index+" == "+e),console.log("menuItem.index === qualityLevels().selectedIndex"),this.selected(this.options_.index==e),this.selected_=this.options_.index===e},n.registerComponent("ResolutionMenuItem",i)},a=function(e){var t=this;this.ready(function(){s(t,o.mergeOptions(n,e))})};i("hlsSourceSelector",a),a.VERSION="0.0.2",t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsHlsSourceSelector=e()}}(function(){return function e(t,l,o){function n(s,a){if(!l[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var r=new Error("Cannot find module '"+s+"'");throw r.code="MODULE_NOT_FOUND",r}var d=l[s]={exports:{}};t[s][0].call(d.exports,function(e){var l=t[s][1][e];return n(l||e)},d,d.exports,e,t,l,o)}return l[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}({1:[function(e,t,l){(function(e){"use strict";var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e){return e&&"object"===(void 0===e?"undefined":l(e))&&"default"in e?e.default:e}("undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null),n={},i=o.registerPlugin||o.plugin,s=function(e,t){e.addClass("vjs-hls-source-selector"),console.log("videojs-hls-source-selector initialized!");var l=e.qualityLevels();if(console.log("player.techName_:"+e.techName_),"Html5"!=e.techName_)return!1;e.on(["loadedmetadata"],function(n){if(console.warn("VIDEOJS loadedmetadata event"),t&&t.default)if(console.log("options.default: "+t.default),console.log("player.qualityLevels(): "),console.log(e.qualityLevels()),console.log("player.qualityLevels().length: "),console.log(e.qualityLevels().length),"low"==t.default)for(var s=0;s<e.qualityLevels().length;s++)e.qualityLevels()[s].enabled=0==s;else if(t.default="high")for(var s=0;s<e.qualityLevels().length;s++)s==e.qualityLevels().length-1?e.qualityLevels()[s].enabled=!0:e.qualityLevels()[s].enabled=!1;var a=o.getComponent("MenuButton"),u=o.extend(a,{constructor:function(){this.label=document.createElement("span"),t.label="Quality",a.apply(this,arguments),this.el().setAttribute("aria-label","Quality"),this.controlText("Quality");var e=document.createElement("span");o.addClass(e,"vjs-menu-icon"),this.el().appendChild(e),l.on(["change","addqualitylevel"],o.bind(this,this.update))}});u.prototype.update=function(){return a.prototype.update.call(this)},u.prototype.createItems=function(){for(var t=[],l=(e.qualityLevels,0);l<e.qualityLevels().length;l++){console.log(e.qualityLevels()[l].id),console.log(e.qualityLevels()[l]);var o=""+l;e.qualityLevels()[l].height?o=e.qualityLevels()[l].height:e.qualityLevels()[l].bitrate&&(o=Math.floor(e.qualityLevels()[l].bitrate/1e3)+" kbps"),t.push(new i(this.player_,{label:o,index:l,selected:l===(!!e.qualityLevels.selectedIndex&&o)}))}return e.qualityLevels().length>1&&t.push(new i(this.player_,{label:"Auto",index:e.qualityLevels().length,selected:!1})),t},u.prototype.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+"vjs-hls-source-selector-button"},o.registerComponent("ResolutionButton",u),e.getChild("controlBar").addChild("ResolutionButton",{})});var n=o.getComponent("MenuItem"),i=o.extend(n,{constructor:function(e,t){t.selectable=!0,n.call(this,e,t),l.on("change",o.bind(this,this.update)),e.on("resolutionchange",o.bind(this,this.update))}});i.prototype.handleClick=function(e){n.prototype.handleClick.call(this,e),console.log("Change quality to "+this.options_.label),console.log("qualityLevels: "),console.log(this.player_.qualityLevels()),this.selected_=!0,this.selected(!0);for(var t=0;t<this.player_.qualityLevels().length;t++)this.options_.index==this.player_.qualityLevels().length?this.player_.qualityLevels()[t].enabled=!0:t==this.options_.index?this.player_.qualityLevels()[t].enabled=!0:this.player_.qualityLevels()[t].enabled=!1},i.prototype.update=function(){var e=this.player_.qualityLevels().selectedIndex;console.log(this.options_.index+" == "+e),console.log("menuItem.index === qualityLevels().selectedIndex"),this.selected(this.options_.index==e),this.selected_=this.options_.index===e},n.registerComponent("ResolutionMenuItem",i)},a=function(e){var t=this;this.ready(function(){s(t,o.mergeOptions(n,e))})};i("hlsSourceSelector",a),a.VERSION="0.0.3",t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
//# sourceMappingURL=videojs-hls-source-selector.min.js.map
/*!
* @name videojs-hls-source-selector
* @version 0.0.2
* @version 0.0.3
* @author Justin Fujita <justin@pivotshare.com>

@@ -115,3 +115,3 @@ * @license MIT

} else if (player.qualityLevels()[i].bitrate) {
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3) + 'kbps';
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3) + ' kbps';
}

@@ -211,3 +211,3 @@

// Include the version number.
hlsSourceSelector.VERSION = '0.0.2';
hlsSourceSelector.VERSION = '0.0.3';

@@ -214,0 +214,0 @@ module.exports = hlsSourceSelector;

/*!
* @name videojs-hls-source-selector
* @version 0.0.2
* @version 0.0.3
* @author Justin Fujita <justin@pivotshare.com>
* @license MIT
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsHlsSourceSelector=e()}}(function(){return function e(t,l,o){function n(s,a){if(!l[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var r=new Error("Cannot find module '"+s+"'");throw r.code="MODULE_NOT_FOUND",r}var d=l[s]={exports:{}};t[s][0].call(d.exports,function(e){var l=t[s][1][e];return n(l||e)},d,d.exports,e,t,l,o)}return l[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}({1:[function(e,t,l){(function(e){"use strict";var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e){return e&&"object"===(void 0===e?"undefined":l(e))&&"default"in e?e.default:e}("undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null),n={},i=o.registerPlugin||o.plugin,s=function(e,t){e.addClass("vjs-hls-source-selector"),console.log("videojs-hls-source-selector initialized!");var l=e.qualityLevels();if(console.log("player.techName_:"+e.techName_),"Html5"!=e.techName_)return!1;e.on(["loadedmetadata"],function(n){if(console.warn("VIDEOJS loadedmetadata event"),t&&t.default)if(console.log("options.default: "+t.default),console.log("player.qualityLevels(): "),console.log(e.qualityLevels()),console.log("player.qualityLevels().length: "),console.log(e.qualityLevels().length),"low"==t.default)for(var s=0;s<e.qualityLevels().length;s++)e.qualityLevels()[s].enabled=0==s;else if(t.default="high")for(var s=0;s<e.qualityLevels().length;s++)s==e.qualityLevels().length-1?e.qualityLevels()[s].enabled=!0:e.qualityLevels()[s].enabled=!1;var a=o.getComponent("MenuButton"),u=o.extend(a,{constructor:function(){this.label=document.createElement("span"),t.label="Quality",a.apply(this,arguments),this.el().setAttribute("aria-label","Quality"),this.controlText("Quality");var e=document.createElement("span");o.addClass(e,"vjs-menu-icon"),this.el().appendChild(e),l.on(["change","addqualitylevel"],o.bind(this,this.update))}});u.prototype.update=function(){return a.prototype.update.call(this)},u.prototype.createItems=function(){for(var t=[],l=(e.qualityLevels,0);l<e.qualityLevels().length;l++){console.log(e.qualityLevels()[l].id),console.log(e.qualityLevels()[l]);var o=""+l;e.qualityLevels()[l].height?o=e.qualityLevels()[l].height:e.qualityLevels()[l].bitrate&&(o=Math.floor(e.qualityLevels()[l].bitrate/1e3)+"kbps"),t.push(new i(this.player_,{label:o,index:l,selected:l===(!!e.qualityLevels.selectedIndex&&o)}))}return e.qualityLevels().length>1&&t.push(new i(this.player_,{label:"Auto",index:e.qualityLevels().length,selected:!1})),t},u.prototype.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+"vjs-hls-source-selector-button"},o.registerComponent("ResolutionButton",u),e.getChild("controlBar").addChild("ResolutionButton",{})});var n=o.getComponent("MenuItem"),i=o.extend(n,{constructor:function(e,t){t.selectable=!0,n.call(this,e,t),l.on("change",o.bind(this,this.update)),e.on("resolutionchange",o.bind(this,this.update))}});i.prototype.handleClick=function(e){n.prototype.handleClick.call(this,e),console.log("Change quality to "+this.options_.label),console.log("qualityLevels: "),console.log(this.player_.qualityLevels()),this.selected_=!0,this.selected(!0);for(var t=0;t<this.player_.qualityLevels().length;t++)this.options_.index==this.player_.qualityLevels().length?this.player_.qualityLevels()[t].enabled=!0:t==this.options_.index?this.player_.qualityLevels()[t].enabled=!0:this.player_.qualityLevels()[t].enabled=!1},i.prototype.update=function(){var e=this.player_.qualityLevels().selectedIndex;console.log(this.options_.index+" == "+e),console.log("menuItem.index === qualityLevels().selectedIndex"),this.selected(this.options_.index==e),this.selected_=this.options_.index===e},n.registerComponent("ResolutionMenuItem",i)},a=function(e){var t=this;this.ready(function(){s(t,o.mergeOptions(n,e))})};i("hlsSourceSelector",a),a.VERSION="0.0.2",t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsHlsSourceSelector=e()}}(function(){return function e(t,l,o){function n(s,a){if(!l[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var r=new Error("Cannot find module '"+s+"'");throw r.code="MODULE_NOT_FOUND",r}var d=l[s]={exports:{}};t[s][0].call(d.exports,function(e){var l=t[s][1][e];return n(l||e)},d,d.exports,e,t,l,o)}return l[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}({1:[function(e,t,l){(function(e){"use strict";var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e){return e&&"object"===(void 0===e?"undefined":l(e))&&"default"in e?e.default:e}("undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null),n={},i=o.registerPlugin||o.plugin,s=function(e,t){e.addClass("vjs-hls-source-selector"),console.log("videojs-hls-source-selector initialized!");var l=e.qualityLevels();if(console.log("player.techName_:"+e.techName_),"Html5"!=e.techName_)return!1;e.on(["loadedmetadata"],function(n){if(console.warn("VIDEOJS loadedmetadata event"),t&&t.default)if(console.log("options.default: "+t.default),console.log("player.qualityLevels(): "),console.log(e.qualityLevels()),console.log("player.qualityLevels().length: "),console.log(e.qualityLevels().length),"low"==t.default)for(var s=0;s<e.qualityLevels().length;s++)e.qualityLevels()[s].enabled=0==s;else if(t.default="high")for(var s=0;s<e.qualityLevels().length;s++)s==e.qualityLevels().length-1?e.qualityLevels()[s].enabled=!0:e.qualityLevels()[s].enabled=!1;var a=o.getComponent("MenuButton"),u=o.extend(a,{constructor:function(){this.label=document.createElement("span"),t.label="Quality",a.apply(this,arguments),this.el().setAttribute("aria-label","Quality"),this.controlText("Quality");var e=document.createElement("span");o.addClass(e,"vjs-menu-icon"),this.el().appendChild(e),l.on(["change","addqualitylevel"],o.bind(this,this.update))}});u.prototype.update=function(){return a.prototype.update.call(this)},u.prototype.createItems=function(){for(var t=[],l=(e.qualityLevels,0);l<e.qualityLevels().length;l++){console.log(e.qualityLevels()[l].id),console.log(e.qualityLevels()[l]);var o=""+l;e.qualityLevels()[l].height?o=e.qualityLevels()[l].height:e.qualityLevels()[l].bitrate&&(o=Math.floor(e.qualityLevels()[l].bitrate/1e3)+" kbps"),t.push(new i(this.player_,{label:o,index:l,selected:l===(!!e.qualityLevels.selectedIndex&&o)}))}return e.qualityLevels().length>1&&t.push(new i(this.player_,{label:"Auto",index:e.qualityLevels().length,selected:!1})),t},u.prototype.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+"vjs-hls-source-selector-button"},o.registerComponent("ResolutionButton",u),e.getChild("controlBar").addChild("ResolutionButton",{})});var n=o.getComponent("MenuItem"),i=o.extend(n,{constructor:function(e,t){t.selectable=!0,n.call(this,e,t),l.on("change",o.bind(this,this.update)),e.on("resolutionchange",o.bind(this,this.update))}});i.prototype.handleClick=function(e){n.prototype.handleClick.call(this,e),console.log("Change quality to "+this.options_.label),console.log("qualityLevels: "),console.log(this.player_.qualityLevels()),this.selected_=!0,this.selected(!0);for(var t=0;t<this.player_.qualityLevels().length;t++)this.options_.index==this.player_.qualityLevels().length?this.player_.qualityLevels()[t].enabled=!0:t==this.options_.index?this.player_.qualityLevels()[t].enabled=!0:this.player_.qualityLevels()[t].enabled=!1},i.prototype.update=function(){var e=this.player_.qualityLevels().selectedIndex;console.log(this.options_.index+" == "+e),console.log("menuItem.index === qualityLevels().selectedIndex"),this.selected(this.options_.index==e),this.selected_=this.options_.index===e},n.registerComponent("ResolutionMenuItem",i)},a=function(e){var t=this;this.ready(function(){s(t,o.mergeOptions(n,e))})};i("hlsSourceSelector",a),a.VERSION="0.0.3",t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
{
"name": "videojs-hls-source-selector",
"version": "0.0.2",
"version": "0.0.3",
"description": "VideoJS plugin that leverages videojs-contrib-quality-levels plugin to offer manual user-selectable level selection options for adaptive hls streams. ",

@@ -5,0 +5,0 @@ "main": "build/es5/index.js",

@@ -122,3 +122,3 @@ import videojs from 'video.js';

{
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3)+'kbps';
label = Math.floor(player.qualityLevels()[i].bitrate / 1e3)+' kbps';
}

@@ -125,0 +125,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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