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.0 to 0.0.1

1

build/es5/index.js

@@ -37,2 +37,3 @@ 'use strict';

var qualityLevels = player.qualityLevels();
console.log("player.techName_:" + player.techName_);

@@ -39,0 +40,0 @@ //This plugin only supports level selection for HLS playback

5

dist/videojs-hls-source-selector-with-map.js
/*!
* @name videojs-hls-source-selector
* @version 0.0.0
* @version 0.0.1
* @author Justin Fujita <justin@pivotshare.com>

@@ -43,2 +43,3 @@ * @license MIT

var qualityLevels = player.qualityLevels();
console.log("player.techName_:" + player.techName_);

@@ -210,3 +211,3 @@ //This plugin only supports level selection for HLS playback

// Include the version number.
hlsSourceSelector.VERSION = '0.0.0';
hlsSourceSelector.VERSION = '0.0.1';

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

/*!
* @name videojs-hls-source-selector
* @version 0.0.0
* @version 0.0.1
* @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){if(e.addClass("vjs-hls-source-selector"),console.log("videojs-hls-source-selector initialized!"),console.log("player.techName_:"+e.techName_),"Html5"!=e.techName_)return!1;e.on(["loadedmetadata"],function(l){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 i=0;i<e.qualityLevels().length;i++)e.qualityLevels()[i].enabled=0==i;else if(t.default="high")for(var i=0;i<e.qualityLevels().length;i++)i==e.qualityLevels().length-1?e.qualityLevels()[i].enabled=!0:e.qualityLevels()[i].enabled=!1;var s=o.getComponent("MenuButton"),a=o.extend(s,{constructor:function(){this.label=document.createElement("span"),t.label="Quality",s.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),qualityLevels.on(["change","addqualitylevel"],o.bind(this,this.update))}});a.prototype.update=function(){return s.prototype.update.call(this)},a.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=e.qualityLevels()[l].bitrate),t.push(new n(this.player_,{label:o,index:l,selected:l===(!!e.qualityLevels.selectedIndex&&o)}))}return e.qualityLevels().length>1&&t.push(new n(this.player_,{label:"Auto",index:e.qualityLevels().length,selected:!1})),t},a.prototype.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+"vjs-hls-source-selector-button"},o.registerComponent("ResolutionButton",a),e.getChild("controlBar").addChild("ResolutionButton",{})});var l=o.getComponent("MenuItem"),n=o.extend(l,{constructor:function(e,t){t.selectable=!0,l.call(this,e,t),qualityLevels.on("change",o.bind(this,this.update)),e.on("resolutionchange",o.bind(this,this.update))}});n.prototype.handleClick=function(e){l.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},n.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},l.registerComponent("ResolutionMenuItem",n)},a=function(e){var t=this;this.ready(function(){s(t,o.mergeOptions(n,e))})};i("hlsSourceSelector",a),a.VERSION="0.0.0",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=e.qualityLevels()[l].bitrate),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.1",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.0
* @version 0.0.1
* @author Justin Fujita <justin@pivotshare.com>

@@ -43,2 +43,3 @@ * @license MIT

var qualityLevels = player.qualityLevels();
console.log("player.techName_:" + player.techName_);

@@ -210,3 +211,3 @@ //This plugin only supports level selection for HLS playback

// Include the version number.
hlsSourceSelector.VERSION = '0.0.0';
hlsSourceSelector.VERSION = '0.0.1';

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

/*!
* @name videojs-hls-source-selector
* @version 0.0.0
* @version 0.0.1
* @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){if(e.addClass("vjs-hls-source-selector"),console.log("videojs-hls-source-selector initialized!"),console.log("player.techName_:"+e.techName_),"Html5"!=e.techName_)return!1;e.on(["loadedmetadata"],function(l){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 i=0;i<e.qualityLevels().length;i++)e.qualityLevels()[i].enabled=0==i;else if(t.default="high")for(var i=0;i<e.qualityLevels().length;i++)i==e.qualityLevels().length-1?e.qualityLevels()[i].enabled=!0:e.qualityLevels()[i].enabled=!1;var s=o.getComponent("MenuButton"),a=o.extend(s,{constructor:function(){this.label=document.createElement("span"),t.label="Quality",s.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),qualityLevels.on(["change","addqualitylevel"],o.bind(this,this.update))}});a.prototype.update=function(){return s.prototype.update.call(this)},a.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=e.qualityLevels()[l].bitrate),t.push(new n(this.player_,{label:o,index:l,selected:l===(!!e.qualityLevels.selectedIndex&&o)}))}return e.qualityLevels().length>1&&t.push(new n(this.player_,{label:"Auto",index:e.qualityLevels().length,selected:!1})),t},a.prototype.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+"vjs-hls-source-selector-button"},o.registerComponent("ResolutionButton",a),e.getChild("controlBar").addChild("ResolutionButton",{})});var l=o.getComponent("MenuItem"),n=o.extend(l,{constructor:function(e,t){t.selectable=!0,l.call(this,e,t),qualityLevels.on("change",o.bind(this,this.update)),e.on("resolutionchange",o.bind(this,this.update))}});n.prototype.handleClick=function(e){l.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},n.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},l.registerComponent("ResolutionMenuItem",n)},a=function(e){var t=this;this.ready(function(){s(t,o.mergeOptions(n,e))})};i("hlsSourceSelector",a),a.VERSION="0.0.0",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=e.qualityLevels()[l].bitrate),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.1",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.0",
"version": "0.0.1",
"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",

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

var qualityLevels = player.qualityLevels();
console.log("player.techName_:"+player.techName_);

@@ -29,0 +30,0 @@ //This plugin only supports level selection for HLS playback

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