Socket
Socket
Sign inDemoInstall

@videogular/ngx-videogular

Package Overview
Dependencies
10
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.1.0

2

bundles/videogular-ngx-videogular-buffering.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@videogular/ngx-videogular/core')) :
typeof define === 'function' && define.amd ? define('@videogular/ngx-videogular/buffering', ['exports', '@angular/core', '@angular/common', '@videogular/ngx-videogular/core'], factory) :
(global = global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular'].buffering = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular'].buffering = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
}(this, (function (exports, core, common, core$1) { 'use strict';

@@ -6,0 +6,0 @@

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

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/buffering",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],e):e(((n=n||self).videogular=n.videogular||{},n.videogular["ngx-videogular"]=n.videogular["ngx-videogular"]||{},n.videogular["ngx-videogular"].buffering={}),n.ng.core,n.ng.common,n.videogular["ngx-videogular"].core)}(this,(function(n,e,i,o){"use strict";var r=function(){function n(n,e){this.API=e,this.checkInterval=50,this.currentPlayPos=0,this.lastPlayPos=0,this.subscriptions=[],this.isBuffering=!1,this.elem=n.nativeElement}return n.prototype.ngOnInit=function(){var n=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return n.onPlayerReady()})))},n.prototype.onPlayerReady=function(){var n=this;this.target=this.API.getMediaById(this.vgFor),this.subscriptions.push(this.target.subscriptions.bufferDetected.subscribe((function(e){return n.onUpdateBuffer(e)})))},n.prototype.onUpdateBuffer=function(n){this.isBuffering=n},n.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(n){return n.unsubscribe()}))},n}();r.decorators=[{type:e.Component,args:[{selector:"vg-buffering",encapsulation:e.ViewEncapsulation.None,template:'<div class="vg-buffering">\n <div class="bufferingContainer">\n <div class="loadingSpinner"></div>\n </div>\n </div>',styles:["\n vg-buffering {\n display: none;\n z-index: 201;\n }\n vg-buffering.is-buffering {\n display: block;\n }\n\n .vg-buffering {\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n }\n .vg-buffering .bufferingContainer {\n width: 100%;\n position: absolute;\n cursor: pointer;\n top: 50%;\n margin-top: -50px;\n zoom: 1;\n filter: alpha(opacity=60);\n opacity: 0.6;\n }\n /* Loading Spinner\n * http://www.alessioatzeni.com/blog/css3-loading-animation-loop/\n */\n .vg-buffering .loadingSpinner {\n background-color: rgba(0, 0, 0, 0);\n border: 5px solid rgba(255, 255, 255, 1);\n opacity: 0.9;\n border-top: 5px solid rgba(0, 0, 0, 0);\n border-left: 5px solid rgba(0, 0, 0, 0);\n border-radius: 50px;\n box-shadow: 0 0 35px #ffffff;\n width: 50px;\n height: 50px;\n margin: 0 auto;\n -moz-animation: spin 0.5s infinite linear;\n -webkit-animation: spin 0.5s infinite linear;\n }\n .vg-buffering .loadingSpinner .stop {\n -webkit-animation-play-state: paused;\n -moz-animation-play-state: paused;\n }\n @-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(360deg);\n }\n }\n @-moz-keyframes spinoff {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(-360deg);\n }\n }\n @-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n }\n }\n @-webkit-keyframes spinoff {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(-360deg);\n }\n }\n "]}]}],r.ctorParameters=function(){return[{type:e.ElementRef},{type:o.VgApiService}]},r.propDecorators={vgFor:[{type:e.Input}],isBuffering:[{type:e.HostBinding,args:["class.is-buffering"]}]};var t=function(){};t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,o.VgCoreModule],declarations:[r],exports:[r]}]}],n.VgBufferingComponent=r,n.VgBufferingModule=t,Object.defineProperty(n,"__esModule",{value:!0})}));
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/buffering",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self).videogular=n.videogular||{},n.videogular["ngx-videogular"]=n.videogular["ngx-videogular"]||{},n.videogular["ngx-videogular"].buffering={}),n.ng.core,n.ng.common,n.videogular["ngx-videogular"].core)}(this,(function(n,e,i,o){"use strict";var r=function(){function n(n,e){this.API=e,this.checkInterval=50,this.currentPlayPos=0,this.lastPlayPos=0,this.subscriptions=[],this.isBuffering=!1,this.elem=n.nativeElement}return n.prototype.ngOnInit=function(){var n=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return n.onPlayerReady()})))},n.prototype.onPlayerReady=function(){var n=this;this.target=this.API.getMediaById(this.vgFor),this.subscriptions.push(this.target.subscriptions.bufferDetected.subscribe((function(e){return n.onUpdateBuffer(e)})))},n.prototype.onUpdateBuffer=function(n){this.isBuffering=n},n.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(n){return n.unsubscribe()}))},n}();r.decorators=[{type:e.Component,args:[{selector:"vg-buffering",encapsulation:e.ViewEncapsulation.None,template:'<div class="vg-buffering">\n <div class="bufferingContainer">\n <div class="loadingSpinner"></div>\n </div>\n </div>',styles:["\n vg-buffering {\n display: none;\n z-index: 201;\n }\n vg-buffering.is-buffering {\n display: block;\n }\n\n .vg-buffering {\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n }\n .vg-buffering .bufferingContainer {\n width: 100%;\n position: absolute;\n cursor: pointer;\n top: 50%;\n margin-top: -50px;\n zoom: 1;\n filter: alpha(opacity=60);\n opacity: 0.6;\n }\n /* Loading Spinner\n * http://www.alessioatzeni.com/blog/css3-loading-animation-loop/\n */\n .vg-buffering .loadingSpinner {\n background-color: rgba(0, 0, 0, 0);\n border: 5px solid rgba(255, 255, 255, 1);\n opacity: 0.9;\n border-top: 5px solid rgba(0, 0, 0, 0);\n border-left: 5px solid rgba(0, 0, 0, 0);\n border-radius: 50px;\n box-shadow: 0 0 35px #ffffff;\n width: 50px;\n height: 50px;\n margin: 0 auto;\n -moz-animation: spin 0.5s infinite linear;\n -webkit-animation: spin 0.5s infinite linear;\n }\n .vg-buffering .loadingSpinner .stop {\n -webkit-animation-play-state: paused;\n -moz-animation-play-state: paused;\n }\n @-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(360deg);\n }\n }\n @-moz-keyframes spinoff {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(-360deg);\n }\n }\n @-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n }\n }\n @-webkit-keyframes spinoff {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(-360deg);\n }\n }\n "]}]}],r.ctorParameters=function(){return[{type:e.ElementRef},{type:o.VgApiService}]},r.propDecorators={vgFor:[{type:e.Input}],isBuffering:[{type:e.HostBinding,args:["class.is-buffering"]}]};var t=function(){};t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,o.VgCoreModule],declarations:[r],exports:[r]}]}],n.VgBufferingComponent=r,n.VgBufferingModule=t,Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=videogular-ngx-videogular-buffering.umd.min.js.map

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/controls",["exports","@angular/core","@angular/common","rxjs","@videogular/ngx-videogular/core"],e):e(((t=t||self).videogular=t.videogular||{},t.videogular["ngx-videogular"]=t.videogular["ngx-videogular"]||{},t.videogular["ngx-videogular"].controls={}),t.ng.core,t.ng.common,t.rxjs,t.videogular["ngx-videogular"].core)}(this,(function(t,e,n,i,o){"use strict";
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/controls",["exports","@angular/core","@angular/common","rxjs","@videogular/ngx-videogular/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).videogular=t.videogular||{},t.videogular["ngx-videogular"]=t.videogular["ngx-videogular"]||{},t.videogular["ngx-videogular"].controls={}),t.ng.core,t.ng.common,t.rxjs,t.videogular["ngx-videogular"].core)}(this,(function(t,e,n,i,o){"use strict";
/*! *****************************************************************************

@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation.

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/core",["exports","@angular/core","@angular/common","rxjs","rxjs/operators"],t):t(((e=e||self).videogular=e.videogular||{},e.videogular["ngx-videogular"]=e.videogular["ngx-videogular"]||{},e.videogular["ngx-videogular"].core={}),e.ng.core,e.ng.common,e.rxjs,e.rxjs.operators)}(this,(function(e,t,i,n,r){"use strict";
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/core",["exports","@angular/core","@angular/common","rxjs","rxjs/operators"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).videogular=e.videogular||{},e.videogular["ngx-videogular"]=e.videogular["ngx-videogular"]||{},e.videogular["ngx-videogular"].core={}),e.ng.core,e.ng.common,e.rxjs,e.rxjs.operators)}(this,(function(e,t,i,n,r){"use strict";
/*! *****************************************************************************

@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation.

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@videogular/ngx-videogular/core')) :
typeof define === 'function' && define.amd ? define('@videogular/ngx-videogular/ima-ads', ['exports', '@angular/core', '@angular/common', '@videogular/ngx-videogular/core'], factory) :
(global = global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular']['ima-ads'] = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular']['ima-ads'] = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
}(this, (function (exports, core, common, core$1) { 'use strict';

@@ -6,0 +6,0 @@

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/ima-ads",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],e):e(((t=t||self).videogular=t.videogular||{},t.videogular["ngx-videogular"]=t.videogular["ngx-videogular"]||{},t.videogular["ngx-videogular"]["ima-ads"]={}),t.ng.core,t.ng.common,t.videogular["ngx-videogular"].core)}(this,(function(t,e,i,n){"use strict";var o=function(){function t(t,i,n){this.API=i,this.fsAPI=n,this.onAdStart=new e.EventEmitter,this.onAdStop=new e.EventEmitter,this.onSkipAd=new e.EventEmitter,this.isFullscreen=!1,this.subscriptions=[],this.displayState="none",this.elem=t.nativeElement,this.onContentEnded=this.onContentEnded.bind(this)}return t.prototype.ngOnInit=function(){var t=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return t.onPlayerReady()})))},t.prototype.onPlayerReady=function(){"undefined"!=typeof google?(this.target=this.API.getMediaById(this.vgFor),this.initializations(),this.subscriptions.push(this.target.subscriptions.ended.subscribe(this.onContentEnded.bind(this))),this.subscriptions.push(this.target.subscriptions.play.subscribe(this.onUpdateState.bind(this))),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.ima.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.ima.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this),!1),this.loadAds()):this.onMissingGoogleImaLoader()},t.prototype.initializations=function(){var t=this;this.ima=new s(this.elem),this.vgSkipButton&&(this.skipButton=document.querySelector(this.vgSkipButton),this.skipButton.style.display="none",this.skipButton.addEventListener("click",this.onClickSkip.bind(this)),this.elem.insertBefore(this.skipButton,this.elem.firstChild)),window.addEventListener("resize",(function(){var e=t.API.videogularElement.offsetWidth,i=t.API.videogularElement.offsetHeight;t.ima.adsManager&&(t.isFullscreen?t.ima.adsManager.resize(e,i,google.ima.ViewMode.FULLSCREEN):t.ima.adsManager.resize(e,i,google.ima.ViewMode.NORMAL))}))},t.prototype.loadAds=function(){var t=this;this.vgCompanion&&googletag.cmd.push((function(){var e="/"+t.vgNetwork+"/"+t.vgUnitPath,i=googletag.defineSlot(e,t.vgCompanionSize,t.vgCompanion);i&&(i.addService(googletag.companionAds()),i.addService(googletag.pubads()),googletag.companionAds().setRefreshUnfilledSlots(!0),googletag.pubads().enableVideoAds(),googletag.enableServices())}))},t.prototype.onUpdateState=function(t){switch(t.type){case n.VgEvents.VG_PLAY:this.ima.adsLoaded||(this.API.pause(),this.ima.adDisplayContainer.initialize(),this.requestAds(this.vgAdTagUrl),this.ima.adsLoaded=!0)}},t.prototype.requestAds=function(t){this.show();var e=new google.ima.AdsRequest,i=window.getComputedStyle(this.elem);e.adTagUrl=t,e.linearAdSlotWidth=parseInt(i.width,10),e.linearAdSlotHeight=parseInt(i.height,10),e.nonLinearAdSlotWidth=parseInt(i.width,10),e.nonLinearAdSlotHeight=parseInt(i.height,10),this.ima.adsLoader.requestAds(e)},t.prototype.onAdsManagerLoaded=function(t){this.show(),this.ima.adsManager=t.getAdsManager(this.target),this.processAdsManager(this.ima.adsManager)},t.prototype.processAdsManager=function(t){var e=this.API.videogularElement.offsetWidth,i=this.API.videogularElement.offsetHeight;this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this.onSkippableStateChanged.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsComplete.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this),!1),this.ima.adsManager.init(e,i,google.ima.ViewMode.NORMAL),this.ima.adsManager.start()},t.prototype.onSkippableStateChanged=function(){var t=this.ima.adsManager.getAdSkippableState();this.skipButton.style.display=t?"block":"none"},t.prototype.onClickSkip=function(){this.ima.adsManager.skip(),this.onSkipAd.emit(!0)},t.prototype.onContentPauseRequested=function(){this.show(),this.API.pause(),this.onAdStop.emit(!0)},t.prototype.onContentResumeRequested=function(){this.API.play(),this.onAdStart.emit(!0),this.hide()},t.prototype.onAdError=function(t){this.ima.adsManager&&this.ima.adsManager.destroy(),this.hide(),this.API.play(),this.onAdStop.emit(!0)},t.prototype.onAllAdsComplete=function(){this.hide(),this.ima.adsManager.getCuePoints().join().indexOf("-1")>=0&&(this.API.pause(),this.onAdStop.emit(!0))},t.prototype.onAdComplete=function(){this.ima.currentAd++,this.onAdStop.emit(!0)},t.prototype.show=function(){window.dispatchEvent(new CustomEvent(n.VgEvents.VG_START_ADS)),this.displayState="block"},t.prototype.hide=function(){window.dispatchEvent(new CustomEvent(n.VgEvents.VG_END_ADS)),this.displayState="none"},t.prototype.onContentEnded=function(){this.ima.adsLoader.contentComplete(),this.onAdStop.emit(!0)},t.prototype.onChangeFullscreen=function(t){this.fsAPI.nativeFullscreen||(this.isFullscreen=t)},t.prototype.onMissingGoogleImaLoader=function(){this.hide(),this.API.play()},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t}();o.decorators=[{type:e.Component,args:[{selector:"vg-ima-ads",encapsulation:e.ViewEncapsulation.None,template:'<div class="vg-ima-ads"></div>',styles:["\n vg-ima-ads {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 300;\n }\n vg-ima-ads .vg-ima-ads {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n "]}]}],o.ctorParameters=function(){return[{type:e.ElementRef},{type:n.VgApiService},{type:n.VgFullscreenApiService}]},o.propDecorators={vgFor:[{type:e.Input}],vgNetwork:[{type:e.Input}],vgUnitPath:[{type:e.Input}],vgCompanion:[{type:e.Input}],vgCompanionSize:[{type:e.Input}],vgAdTagUrl:[{type:e.Input}],vgSkipButton:[{type:e.Input}],onAdStart:[{type:e.Output}],onAdStop:[{type:e.Output}],onSkipAd:[{type:e.Output}],displayState:[{type:e.HostBinding,args:["style.display"]}]};var s=function(t){this.adDisplayContainer=new google.ima.AdDisplayContainer(t),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsManager=null,this.adsLoaded=!1,this.currentAd=0};var a=function(){};a.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,n.VgCoreModule],declarations:[o],exports:[o]}]}],t.Ima=s,t.VgImaAdsComponent=o,t.VgImaAdsModule=a,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/ima-ads",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).videogular=t.videogular||{},t.videogular["ngx-videogular"]=t.videogular["ngx-videogular"]||{},t.videogular["ngx-videogular"]["ima-ads"]={}),t.ng.core,t.ng.common,t.videogular["ngx-videogular"].core)}(this,(function(t,e,i,n){"use strict";var o=function(){function t(t,i,n){this.API=i,this.fsAPI=n,this.onAdStart=new e.EventEmitter,this.onAdStop=new e.EventEmitter,this.onSkipAd=new e.EventEmitter,this.isFullscreen=!1,this.subscriptions=[],this.displayState="none",this.elem=t.nativeElement,this.onContentEnded=this.onContentEnded.bind(this)}return t.prototype.ngOnInit=function(){var t=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return t.onPlayerReady()})))},t.prototype.onPlayerReady=function(){"undefined"!=typeof google?(this.target=this.API.getMediaById(this.vgFor),this.initializations(),this.subscriptions.push(this.target.subscriptions.ended.subscribe(this.onContentEnded.bind(this))),this.subscriptions.push(this.target.subscriptions.play.subscribe(this.onUpdateState.bind(this))),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.ima.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.ima.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this),!1),this.loadAds()):this.onMissingGoogleImaLoader()},t.prototype.initializations=function(){var t=this;this.ima=new s(this.elem),this.vgSkipButton&&(this.skipButton=document.querySelector(this.vgSkipButton),this.skipButton.style.display="none",this.skipButton.addEventListener("click",this.onClickSkip.bind(this)),this.elem.insertBefore(this.skipButton,this.elem.firstChild)),window.addEventListener("resize",(function(){var e=t.API.videogularElement.offsetWidth,i=t.API.videogularElement.offsetHeight;t.ima.adsManager&&(t.isFullscreen?t.ima.adsManager.resize(e,i,google.ima.ViewMode.FULLSCREEN):t.ima.adsManager.resize(e,i,google.ima.ViewMode.NORMAL))}))},t.prototype.loadAds=function(){var t=this;this.vgCompanion&&googletag.cmd.push((function(){var e="/"+t.vgNetwork+"/"+t.vgUnitPath,i=googletag.defineSlot(e,t.vgCompanionSize,t.vgCompanion);i&&(i.addService(googletag.companionAds()),i.addService(googletag.pubads()),googletag.companionAds().setRefreshUnfilledSlots(!0),googletag.pubads().enableVideoAds(),googletag.enableServices())}))},t.prototype.onUpdateState=function(t){switch(t.type){case n.VgEvents.VG_PLAY:this.ima.adsLoaded||(this.API.pause(),this.ima.adDisplayContainer.initialize(),this.requestAds(this.vgAdTagUrl),this.ima.adsLoaded=!0)}},t.prototype.requestAds=function(t){this.show();var e=new google.ima.AdsRequest,i=window.getComputedStyle(this.elem);e.adTagUrl=t,e.linearAdSlotWidth=parseInt(i.width,10),e.linearAdSlotHeight=parseInt(i.height,10),e.nonLinearAdSlotWidth=parseInt(i.width,10),e.nonLinearAdSlotHeight=parseInt(i.height,10),this.ima.adsLoader.requestAds(e)},t.prototype.onAdsManagerLoaded=function(t){this.show(),this.ima.adsManager=t.getAdsManager(this.target),this.processAdsManager(this.ima.adsManager)},t.prototype.processAdsManager=function(t){var e=this.API.videogularElement.offsetWidth,i=this.API.videogularElement.offsetHeight;this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this.onSkippableStateChanged.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsComplete.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this),!1),this.ima.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this),!1),this.ima.adsManager.init(e,i,google.ima.ViewMode.NORMAL),this.ima.adsManager.start()},t.prototype.onSkippableStateChanged=function(){var t=this.ima.adsManager.getAdSkippableState();this.skipButton.style.display=t?"block":"none"},t.prototype.onClickSkip=function(){this.ima.adsManager.skip(),this.onSkipAd.emit(!0)},t.prototype.onContentPauseRequested=function(){this.show(),this.API.pause(),this.onAdStop.emit(!0)},t.prototype.onContentResumeRequested=function(){this.API.play(),this.onAdStart.emit(!0),this.hide()},t.prototype.onAdError=function(t){this.ima.adsManager&&this.ima.adsManager.destroy(),this.hide(),this.API.play(),this.onAdStop.emit(!0)},t.prototype.onAllAdsComplete=function(){this.hide(),this.ima.adsManager.getCuePoints().join().indexOf("-1")>=0&&(this.API.pause(),this.onAdStop.emit(!0))},t.prototype.onAdComplete=function(){this.ima.currentAd++,this.onAdStop.emit(!0)},t.prototype.show=function(){window.dispatchEvent(new CustomEvent(n.VgEvents.VG_START_ADS)),this.displayState="block"},t.prototype.hide=function(){window.dispatchEvent(new CustomEvent(n.VgEvents.VG_END_ADS)),this.displayState="none"},t.prototype.onContentEnded=function(){this.ima.adsLoader.contentComplete(),this.onAdStop.emit(!0)},t.prototype.onChangeFullscreen=function(t){this.fsAPI.nativeFullscreen||(this.isFullscreen=t)},t.prototype.onMissingGoogleImaLoader=function(){this.hide(),this.API.play()},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()}))},t}();o.decorators=[{type:e.Component,args:[{selector:"vg-ima-ads",encapsulation:e.ViewEncapsulation.None,template:'<div class="vg-ima-ads"></div>',styles:["\n vg-ima-ads {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 300;\n }\n vg-ima-ads .vg-ima-ads {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n "]}]}],o.ctorParameters=function(){return[{type:e.ElementRef},{type:n.VgApiService},{type:n.VgFullscreenApiService}]},o.propDecorators={vgFor:[{type:e.Input}],vgNetwork:[{type:e.Input}],vgUnitPath:[{type:e.Input}],vgCompanion:[{type:e.Input}],vgCompanionSize:[{type:e.Input}],vgAdTagUrl:[{type:e.Input}],vgSkipButton:[{type:e.Input}],onAdStart:[{type:e.Output}],onAdStop:[{type:e.Output}],onSkipAd:[{type:e.Output}],displayState:[{type:e.HostBinding,args:["style.display"]}]};var s=function(t){this.adDisplayContainer=new google.ima.AdDisplayContainer(t),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsManager=null,this.adsLoaded=!1,this.currentAd=0};var a=function(){};a.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,n.VgCoreModule],declarations:[o],exports:[o]}]}],t.Ima=s,t.VgImaAdsComponent=o,t.VgImaAdsModule=a,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=videogular-ngx-videogular-ima-ads.umd.min.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@videogular/ngx-videogular/core')) :
typeof define === 'function' && define.amd ? define('@videogular/ngx-videogular/overlay-play', ['exports', '@angular/core', '@angular/common', '@videogular/ngx-videogular/core'], factory) :
(global = global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular']['overlay-play'] = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular']['overlay-play'] = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
}(this, (function (exports, core, common, core$1) { 'use strict';

@@ -6,0 +6,0 @@

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/overlay-play",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],n):n(((e=e||self).videogular=e.videogular||{},e.videogular["ngx-videogular"]=e.videogular["ngx-videogular"]||{},e.videogular["ngx-videogular"]["overlay-play"]={}),e.ng.core,e.ng.common,e.videogular["ngx-videogular"].core)}(this,(function(e,n,t,o){"use strict";var i=function(){function e(e,n,t,o){this.API=n,this.fsAPI=t,this.controlsHidden=o,this.isNativeFullscreen=!1,this.areControlsHidden=!1,this.subscriptions=[],this.isBuffering=!1,this.elem=e.nativeElement}return e.prototype.ngOnInit=function(){var e=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return e.onPlayerReady()})))},e.prototype.onPlayerReady=function(){var e=this;this.target=this.API.getMediaById(this.vgFor),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.subscriptions.push(this.controlsHidden.isHidden.subscribe(this.onHideControls.bind(this))),this.subscriptions.push(this.target.subscriptions.bufferDetected.subscribe((function(n){return e.onUpdateBuffer(n)})))},e.prototype.onUpdateBuffer=function(e){this.isBuffering=e},e.prototype.onChangeFullscreen=function(e){this.fsAPI.nativeFullscreen&&(this.isNativeFullscreen=e)},e.prototype.onHideControls=function(e){this.areControlsHidden=e},e.prototype.onClick=function(){switch(this.getState()){case o.VgStates.VG_PLAYING:this.target.pause();break;case o.VgStates.VG_PAUSED:case o.VgStates.VG_ENDED:this.target.play()}},e.prototype.getState=function(){var e=o.VgStates.VG_PAUSED;if(this.target)if(this.target.state instanceof Array){for(var n=0,t=this.target.state.length;n<t;n++)if(this.target.state[n]===o.VgStates.VG_PLAYING){e=o.VgStates.VG_PLAYING;break}}else e=this.target.state;return e},e.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()}))},e}();i.decorators=[{type:n.Component,args:[{selector:"vg-overlay-play",encapsulation:n.ViewEncapsulation.None,template:'<div\n class="vg-overlay-play"\n [class.native-fullscreen]="isNativeFullscreen"\n [class.controls-hidden]="areControlsHidden"\n >\n <div\n class="overlay-play-container"\n [class.vg-icon-play_arrow]="getState() !== \'playing\'"\n ></div>\n </div>',styles:["\n vg-overlay-play {\n z-index: 200;\n }\n vg-overlay-play.is-buffering {\n display: none;\n }\n vg-overlay-play .vg-overlay-play {\n transition: all 0.5s;\n cursor: pointer;\n position: absolute;\n display: block;\n color: white;\n width: 100%;\n height: 100%;\n font-size: 80px;\n filter: alpha(opacity=60);\n opacity: 0.6;\n }\n vg-overlay-play .vg-overlay-play.native-fullscreen.controls-hidden {\n cursor: none;\n }\n vg-overlay-play\n .vg-overlay-play\n .overlay-play-container.vg-icon-play_arrow {\n pointer-events: none;\n width: 100%;\n height: 100%;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 80px;\n }\n vg-overlay-play .vg-overlay-play:hover {\n filter: alpha(opacity=100);\n opacity: 1;\n }\n vg-overlay-play\n .vg-overlay-play:hover\n .overlay-play-container.vg-icon-play_arrow:before {\n transform: scale(1.2);\n }\n "]}]}],i.ctorParameters=function(){return[{type:n.ElementRef},{type:o.VgApiService},{type:o.VgFullscreenApiService},{type:o.VgControlsHiddenService}]},i.propDecorators={vgFor:[{type:n.Input}],isBuffering:[{type:n.HostBinding,args:["class.is-buffering"]}],onClick:[{type:n.HostListener,args:["click"]}]};var r=function(){};r.decorators=[{type:n.NgModule,args:[{imports:[t.CommonModule,o.VgCoreModule],declarations:[i],exports:[i]}]}],e.VgOverlayPlayComponent=i,e.VgOverlayPlayModule=r,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/overlay-play",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).videogular=e.videogular||{},e.videogular["ngx-videogular"]=e.videogular["ngx-videogular"]||{},e.videogular["ngx-videogular"]["overlay-play"]={}),e.ng.core,e.ng.common,e.videogular["ngx-videogular"].core)}(this,(function(e,n,t,o){"use strict";var i=function(){function e(e,n,t,o){this.API=n,this.fsAPI=t,this.controlsHidden=o,this.isNativeFullscreen=!1,this.areControlsHidden=!1,this.subscriptions=[],this.isBuffering=!1,this.elem=e.nativeElement}return e.prototype.ngOnInit=function(){var e=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return e.onPlayerReady()})))},e.prototype.onPlayerReady=function(){var e=this;this.target=this.API.getMediaById(this.vgFor),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.subscriptions.push(this.controlsHidden.isHidden.subscribe(this.onHideControls.bind(this))),this.subscriptions.push(this.target.subscriptions.bufferDetected.subscribe((function(n){return e.onUpdateBuffer(n)})))},e.prototype.onUpdateBuffer=function(e){this.isBuffering=e},e.prototype.onChangeFullscreen=function(e){this.fsAPI.nativeFullscreen&&(this.isNativeFullscreen=e)},e.prototype.onHideControls=function(e){this.areControlsHidden=e},e.prototype.onClick=function(){switch(this.getState()){case o.VgStates.VG_PLAYING:this.target.pause();break;case o.VgStates.VG_PAUSED:case o.VgStates.VG_ENDED:this.target.play()}},e.prototype.getState=function(){var e=o.VgStates.VG_PAUSED;if(this.target)if(this.target.state instanceof Array){for(var n=0,t=this.target.state.length;n<t;n++)if(this.target.state[n]===o.VgStates.VG_PLAYING){e=o.VgStates.VG_PLAYING;break}}else e=this.target.state;return e},e.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()}))},e}();i.decorators=[{type:n.Component,args:[{selector:"vg-overlay-play",encapsulation:n.ViewEncapsulation.None,template:'<div\n class="vg-overlay-play"\n [class.native-fullscreen]="isNativeFullscreen"\n [class.controls-hidden]="areControlsHidden"\n >\n <div\n class="overlay-play-container"\n [class.vg-icon-play_arrow]="getState() !== \'playing\'"\n ></div>\n </div>',styles:["\n vg-overlay-play {\n z-index: 200;\n }\n vg-overlay-play.is-buffering {\n display: none;\n }\n vg-overlay-play .vg-overlay-play {\n transition: all 0.5s;\n cursor: pointer;\n position: absolute;\n display: block;\n color: white;\n width: 100%;\n height: 100%;\n font-size: 80px;\n filter: alpha(opacity=60);\n opacity: 0.6;\n }\n vg-overlay-play .vg-overlay-play.native-fullscreen.controls-hidden {\n cursor: none;\n }\n vg-overlay-play\n .vg-overlay-play\n .overlay-play-container.vg-icon-play_arrow {\n pointer-events: none;\n width: 100%;\n height: 100%;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 80px;\n }\n vg-overlay-play .vg-overlay-play:hover {\n filter: alpha(opacity=100);\n opacity: 1;\n }\n vg-overlay-play\n .vg-overlay-play:hover\n .overlay-play-container.vg-icon-play_arrow:before {\n transform: scale(1.2);\n }\n "]}]}],i.ctorParameters=function(){return[{type:n.ElementRef},{type:o.VgApiService},{type:o.VgFullscreenApiService},{type:o.VgControlsHiddenService}]},i.propDecorators={vgFor:[{type:n.Input}],isBuffering:[{type:n.HostBinding,args:["class.is-buffering"]}],onClick:[{type:n.HostListener,args:["click"]}]};var r=function(){};r.decorators=[{type:n.NgModule,args:[{imports:[t.CommonModule,o.VgCoreModule],declarations:[i],exports:[i]}]}],e.VgOverlayPlayComponent=i,e.VgOverlayPlayModule=r,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=videogular-ngx-videogular-overlay-play.umd.min.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@videogular/ngx-videogular/core')) :
typeof define === 'function' && define.amd ? define('@videogular/ngx-videogular/streaming', ['exports', '@angular/core', '@angular/common', '@videogular/ngx-videogular/core'], factory) :
(global = global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular'].streaming = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = global.videogular['ngx-videogular'] || {}, global.videogular['ngx-videogular'].streaming = {}), global.ng.core, global.ng.common, global.videogular['ngx-videogular'].core));
}(this, (function (exports, core, common, core$1) { 'use strict';

@@ -80,3 +80,3 @@

this.dash = dashjs.MediaPlayer().create();
this.dash.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_NONE } });
this.dash.updateSettings({ debug: { logLevel: dashjs.Debug.LOG_LEVEL_NONE } });
this.dash.initialize(this.ref.nativeElement);

@@ -102,3 +102,3 @@ this.dash.setAutoPlay(false);

mediaType: 'video',
label: 'AUTO',
scanType: 'AUTO',
});

@@ -118,3 +118,3 @@ _this.onGetBitrates.emit(audioList);

mediaType: 'video',
label: 'AUTO',
scanType: 'AUTO',
});

@@ -138,17 +138,35 @@ _this.onGetBitrates.emit(videoList);

/**
* @param {?} bitrate
* @param {?} __0
* @return {?}
*/
VgDashDirective.prototype.setBitrate = function (bitrate) {
VgDashDirective.prototype.setBitrate = function (_b) {
var _c, _d;
var mediaType = _b.mediaType, qualityIndex = _b.qualityIndex;
if (this.dash) {
if (bitrate.qualityIndex > 0) {
if (this.dash.getAutoSwitchQualityFor(bitrate.mediaType)) {
this.dash.setAutoSwitchQualityFor(bitrate.mediaType, false);
if (qualityIndex > 0) {
if (this.dash.getSettings()) {
this.dash.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: (_c = {},
_c[mediaType] = false,
_c)
}
}
});
}
/** @type {?} */
var nextIndex = bitrate.qualityIndex - 1;
this.dash.setQualityFor(bitrate.mediaType, nextIndex);
var nextIndex = qualityIndex - 1;
this.dash.setQualityFor(mediaType, nextIndex);
}
else {
this.dash.setAutoSwitchQualityFor(bitrate.mediaType, true);
this.dash.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: (_d = {},
_d[mediaType] = true,
_d)
}
}
});
}

@@ -155,0 +173,0 @@ }

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/streaming",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],e):e(((t=t||self).videogular=t.videogular||{},t.videogular["ngx-videogular"]=t.videogular["ngx-videogular"]||{},t.videogular["ngx-videogular"].streaming={}),t.ng.core,t.ng.common,t.videogular["ngx-videogular"].core)}(this,(function(t,e,i,r){"use strict";var s=function(){function t(t,i){this.ref=t,this.API=i,this.onGetBitrates=new e.EventEmitter,this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return t.onPlayerReady()})))},t.prototype.onPlayerReady=function(){this.vgFor=this.ref.nativeElement.getAttribute("vgFor"),this.target=this.API.getMediaById(this.vgFor),this.createPlayer()},t.prototype.ngOnChanges=function(t){var e;(null===(e=t.vgDash)||void 0===e?void 0:e.currentValue)?this.createPlayer():this.destroyPlayer()},t.prototype.createPlayer=function(){var t=this;if(this.dash&&this.destroyPlayer(),this.vgDash&&(this.vgDash.indexOf(".mpd")>-1||this.vgDash.indexOf("mpd-time-csf")>-1)){var e=void 0;if(this.vgDRMLicenseServer&&(e=this.vgDRMLicenseServer,this.vgDRMToken))for(var i in e)i.hasOwnProperty(i)&&(e[i].httpRequestHeaders={Authorization:this.vgDRMToken});this.dash=dashjs.MediaPlayer().create(),this.dash.updateSettings({debug:{logLevel:dashjs.Debug.LOG_LEVEL_NONE}}),this.dash.initialize(this.ref.nativeElement),this.dash.setAutoPlay(!1),this.dash.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED,(function(){var e=t.dash.getBitrateInfoListFor("audio"),i=t.dash.getBitrateInfoListFor("video");e.length>1&&(e.forEach((function(t){return t.qualityIndex=++t.qualityIndex})),e.unshift({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",label:"AUTO"}),t.onGetBitrates.emit(e)),i.length>1&&(i.forEach((function(t){return t.qualityIndex=++t.qualityIndex})),i.unshift({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",label:"AUTO"}),t.onGetBitrates.emit(i))})),e&&this.dash.setProtectionData(e),this.dash.attachSource(this.vgDash)}else this.target&&(this.target.pause(),this.target.seekTime(0),this.ref.nativeElement.src=this.vgDash)},t.prototype.setBitrate=function(t){if(this.dash)if(t.qualityIndex>0){this.dash.getAutoSwitchQualityFor(t.mediaType)&&this.dash.setAutoSwitchQualityFor(t.mediaType,!1);var e=t.qualityIndex-1;this.dash.setQualityFor(t.mediaType,e)}else this.dash.setAutoSwitchQualityFor(t.mediaType,!0)},t.prototype.destroyPlayer=function(){this.dash&&(this.dash.reset(),this.dash=null)},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.destroyPlayer()},t}();s.decorators=[{type:e.Directive,args:[{selector:"[vgDash]",exportAs:"vgDash"}]}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:r.VgApiService}]},s.propDecorators={vgDash:[{type:e.Input}],vgDRMToken:[{type:e.Input}],vgDRMLicenseServer:[{type:e.Input}],onGetBitrates:[{type:e.Output}]};Object.create;function a(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;var n=function(){function t(t,i){this.ref=t,this.API=i,this.vgHlsHeaders={},this.onGetBitrates=new e.EventEmitter,this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return t.onPlayerReady()})))},t.prototype.onPlayerReady=function(){var t=this;this.crossorigin=this.ref.nativeElement.getAttribute("crossorigin"),this.preload="none"!==this.ref.nativeElement.getAttribute("preload"),this.vgFor=this.ref.nativeElement.getAttribute("vgFor"),this.vgFor?this.target=this.API.getMediaById(this.vgFor):this.target=this.API.getDefaultMedia(),this.config={autoStartLoad:this.preload},this.config.xhrSetup=function(e){var i,r;"use-credentials"===t.crossorigin&&(e.withCredentials=!0);try{for(var s=a(Object.keys(t.vgHlsHeaders)),n=s.next();!n.done;n=s.next()){var o=n.value;e.setRequestHeader(o,t.vgHlsHeaders[o])}}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}},this.createPlayer(),this.preload||this.subscriptions.push(this.API.subscriptions.play.subscribe((function(){t.hls&&t.hls.startLoad(0)})))},t.prototype.ngOnChanges=function(t){var e;(null===(e=t.vgHls)||void 0===e?void 0:e.currentValue)?this.createPlayer():t.vgHlsHeaders&&t.vgHlsHeaders.currentValue||this.destroyPlayer()},t.prototype.createPlayer=function(){var t=this;if(this.hls&&this.destroyPlayer(),this.vgHls&&this.vgHls.indexOf("m3u8")>-1&&Hls.isSupported()&&this.API.isPlayerReady){var e=this.ref.nativeElement;this.hls=new Hls(this.config),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(e,i){var r=[];r.push({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",label:"AUTO"}),i.levels.forEach((function(t,e){r.push({qualityIndex:++e,width:t.width,height:t.height,bitrate:t.bitrate,mediaType:"video",label:t.name})})),t.onGetBitrates.emit(r)})),this.hls.on(Hls.Events.LEVEL_LOADED,(function(e,i){t.target.isLive=i.details.live})),this.hls.loadSource(this.vgHls),this.hls.attachMedia(e)}else this.target&&this.target.pause&&(this.target.pause(),this.target.seekTime(0),this.ref.nativeElement.src=this.vgHls)},t.prototype.setBitrate=function(t){this.hls&&(this.hls.nextLevel=t.qualityIndex-1)},t.prototype.destroyPlayer=function(){this.hls&&(this.hls.destroy(),this.hls=null)},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.destroyPlayer(),delete this.hls},t}();n.decorators=[{type:e.Directive,args:[{selector:"[vgHls]",exportAs:"vgHls"}]}],n.ctorParameters=function(){return[{type:e.ElementRef},{type:r.VgApiService}]},n.propDecorators={vgHls:[{type:e.Input}],vgHlsHeaders:[{type:e.Input}],onGetBitrates:[{type:e.Output}]};var o=function(){};o.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,r.VgCoreModule],declarations:[s,n],exports:[s,n]}]}],t.VgDashDirective=s,t.VgHlsDirective=n,t.VgStreamingModule=o,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@videogular/ngx-videogular/core")):"function"==typeof define&&define.amd?define("@videogular/ngx-videogular/streaming",["exports","@angular/core","@angular/common","@videogular/ngx-videogular/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).videogular=t.videogular||{},t.videogular["ngx-videogular"]=t.videogular["ngx-videogular"]||{},t.videogular["ngx-videogular"].streaming={}),t.ng.core,t.ng.common,t.videogular["ngx-videogular"].core)}(this,(function(t,e,i,s){"use strict";var r=function(){function t(t,i){this.ref=t,this.API=i,this.onGetBitrates=new e.EventEmitter,this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return t.onPlayerReady()})))},t.prototype.onPlayerReady=function(){this.vgFor=this.ref.nativeElement.getAttribute("vgFor"),this.target=this.API.getMediaById(this.vgFor),this.createPlayer()},t.prototype.ngOnChanges=function(t){var e;(null===(e=t.vgDash)||void 0===e?void 0:e.currentValue)?this.createPlayer():this.destroyPlayer()},t.prototype.createPlayer=function(){var t=this;if(this.dash&&this.destroyPlayer(),this.vgDash&&(this.vgDash.indexOf(".mpd")>-1||this.vgDash.indexOf("mpd-time-csf")>-1)){var e=void 0;if(this.vgDRMLicenseServer&&(e=this.vgDRMLicenseServer,this.vgDRMToken))for(var i in e)i.hasOwnProperty(i)&&(e[i].httpRequestHeaders={Authorization:this.vgDRMToken});this.dash=dashjs.MediaPlayer().create(),this.dash.updateSettings({debug:{logLevel:dashjs.Debug.LOG_LEVEL_NONE}}),this.dash.initialize(this.ref.nativeElement),this.dash.setAutoPlay(!1),this.dash.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED,(function(){var e=t.dash.getBitrateInfoListFor("audio"),i=t.dash.getBitrateInfoListFor("video");e.length>1&&(e.forEach((function(t){return t.qualityIndex=++t.qualityIndex})),e.unshift({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",scanType:"AUTO"}),t.onGetBitrates.emit(e)),i.length>1&&(i.forEach((function(t){return t.qualityIndex=++t.qualityIndex})),i.unshift({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",scanType:"AUTO"}),t.onGetBitrates.emit(i))})),e&&this.dash.setProtectionData(e),this.dash.attachSource(this.vgDash)}else this.target&&(this.target.pause(),this.target.seekTime(0),this.ref.nativeElement.src=this.vgDash)},t.prototype.setBitrate=function(t){var e,i,s=t.mediaType,r=t.qualityIndex;if(this.dash)if(r>0){this.dash.getSettings()&&this.dash.updateSettings({streaming:{abr:{autoSwitchBitrate:(e={},e[s]=!1,e)}}});var a=r-1;this.dash.setQualityFor(s,a)}else this.dash.updateSettings({streaming:{abr:{autoSwitchBitrate:(i={},i[s]=!0,i)}}})},t.prototype.destroyPlayer=function(){this.dash&&(this.dash.reset(),this.dash=null)},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.destroyPlayer()},t}();r.decorators=[{type:e.Directive,args:[{selector:"[vgDash]",exportAs:"vgDash"}]}],r.ctorParameters=function(){return[{type:e.ElementRef},{type:s.VgApiService}]},r.propDecorators={vgDash:[{type:e.Input}],vgDRMToken:[{type:e.Input}],vgDRMLicenseServer:[{type:e.Input}],onGetBitrates:[{type:e.Output}]};Object.create;function a(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;var n=function(){function t(t,i){this.ref=t,this.API=i,this.vgHlsHeaders={},this.onGetBitrates=new e.EventEmitter,this.subscriptions=[]}return t.prototype.ngOnInit=function(){var t=this;this.API.isPlayerReady?this.onPlayerReady():this.subscriptions.push(this.API.playerReadyEvent.subscribe((function(){return t.onPlayerReady()})))},t.prototype.onPlayerReady=function(){var t=this;this.crossorigin=this.ref.nativeElement.getAttribute("crossorigin"),this.preload="none"!==this.ref.nativeElement.getAttribute("preload"),this.vgFor=this.ref.nativeElement.getAttribute("vgFor"),this.vgFor?this.target=this.API.getMediaById(this.vgFor):this.target=this.API.getDefaultMedia(),this.config={autoStartLoad:this.preload},this.config.xhrSetup=function(e){var i,s;"use-credentials"===t.crossorigin&&(e.withCredentials=!0);try{for(var r=a(Object.keys(t.vgHlsHeaders)),n=r.next();!n.done;n=r.next()){var o=n.value;e.setRequestHeader(o,t.vgHlsHeaders[o])}}catch(t){i={error:t}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(i)throw i.error}}},this.createPlayer(),this.preload||this.subscriptions.push(this.API.subscriptions.play.subscribe((function(){t.hls&&t.hls.startLoad(0)})))},t.prototype.ngOnChanges=function(t){var e;(null===(e=t.vgHls)||void 0===e?void 0:e.currentValue)?this.createPlayer():t.vgHlsHeaders&&t.vgHlsHeaders.currentValue||this.destroyPlayer()},t.prototype.createPlayer=function(){var t=this;if(this.hls&&this.destroyPlayer(),this.vgHls&&this.vgHls.indexOf("m3u8")>-1&&Hls.isSupported()&&this.API.isPlayerReady){var e=this.ref.nativeElement;this.hls=new Hls(this.config),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(e,i){var s=[];s.push({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",label:"AUTO"}),i.levels.forEach((function(t,e){s.push({qualityIndex:++e,width:t.width,height:t.height,bitrate:t.bitrate,mediaType:"video",label:t.name})})),t.onGetBitrates.emit(s)})),this.hls.on(Hls.Events.LEVEL_LOADED,(function(e,i){t.target.isLive=i.details.live})),this.hls.loadSource(this.vgHls),this.hls.attachMedia(e)}else this.target&&this.target.pause&&(this.target.pause(),this.target.seekTime(0),this.ref.nativeElement.src=this.vgHls)},t.prototype.setBitrate=function(t){this.hls&&(this.hls.nextLevel=t.qualityIndex-1)},t.prototype.destroyPlayer=function(){this.hls&&(this.hls.destroy(),this.hls=null)},t.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.destroyPlayer(),delete this.hls},t}();n.decorators=[{type:e.Directive,args:[{selector:"[vgHls]",exportAs:"vgHls"}]}],n.ctorParameters=function(){return[{type:e.ElementRef},{type:s.VgApiService}]},n.propDecorators={vgHls:[{type:e.Input}],vgHlsHeaders:[{type:e.Input}],onGetBitrates:[{type:e.Output}]};var o=function(){};o.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,s.VgCoreModule],declarations:[r,n],exports:[r,n]}]}],t.VgDashDirective=r,t.VgHlsDirective=n,t.VgStreamingModule=o,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=videogular-ngx-videogular-streaming.umd.min.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define('@videogular/ngx-videogular', factory) :
(global = global || self, (global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = factory()));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.videogular = global.videogular || {}, global.videogular['ngx-videogular'] = factory()));
}(this, (function () { 'use strict';

@@ -6,0 +6,0 @@

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

!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define("@videogular/ngx-videogular",o):((e=e||self).videogular=e.videogular||{},e.videogular["ngx-videogular"]=o())}(this,(function(){"use strict";return{}}));
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define("@videogular/ngx-videogular",o):((e="undefined"!=typeof globalThis?globalThis:e||self).videogular=e.videogular||{},e.videogular["ngx-videogular"]=o())}(this,(function(){"use strict";return{}}));
//# sourceMappingURL=videogular-ngx-videogular.umd.min.js.map

@@ -75,3 +75,3 @@ /**

this.dash = dashjs.MediaPlayer().create();
this.dash.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_NONE } });
this.dash.updateSettings({ debug: { logLevel: dashjs.Debug.LOG_LEVEL_NONE } });
this.dash.initialize(this.ref.nativeElement);

@@ -99,3 +99,3 @@ this.dash.setAutoPlay(false);

mediaType: 'video',
label: 'AUTO',
scanType: 'AUTO',
});

@@ -116,3 +116,3 @@ this.onGetBitrates.emit(audioList);

mediaType: 'video',
label: 'AUTO',
scanType: 'AUTO',
});

@@ -136,17 +136,33 @@ this.onGetBitrates.emit(videoList);

/**
* @param {?} bitrate
* @param {?} __0
* @return {?}
*/
setBitrate(bitrate) {
setBitrate({ mediaType, qualityIndex }) {
if (this.dash) {
if (bitrate.qualityIndex > 0) {
if (this.dash.getAutoSwitchQualityFor(bitrate.mediaType)) {
this.dash.setAutoSwitchQualityFor(bitrate.mediaType, false);
if (qualityIndex > 0) {
if (this.dash.getSettings()) {
this.dash.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: {
[mediaType]: false
}
}
}
});
}
/** @type {?} */
const nextIndex = bitrate.qualityIndex - 1;
this.dash.setQualityFor(bitrate.mediaType, nextIndex);
const nextIndex = qualityIndex - 1;
this.dash.setQualityFor(mediaType, nextIndex);
}
else {
this.dash.setAutoSwitchQualityFor(bitrate.mediaType, true);
this.dash.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: {
[mediaType]: true
}
}
}
});
}

@@ -153,0 +169,0 @@ }

@@ -77,3 +77,3 @@ import { EventEmitter, Directive, ElementRef, Input, Output, NgModule } from '@angular/core';

this.dash = dashjs.MediaPlayer().create();
this.dash.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_NONE } });
this.dash.updateSettings({ debug: { logLevel: dashjs.Debug.LOG_LEVEL_NONE } });
this.dash.initialize(this.ref.nativeElement);

@@ -101,3 +101,3 @@ this.dash.setAutoPlay(false);

mediaType: 'video',
label: 'AUTO',
scanType: 'AUTO',
});

@@ -118,3 +118,3 @@ this.onGetBitrates.emit(audioList);

mediaType: 'video',
label: 'AUTO',
scanType: 'AUTO',
});

@@ -138,17 +138,33 @@ this.onGetBitrates.emit(videoList);

/**
* @param {?} bitrate
* @param {?} __0
* @return {?}
*/
setBitrate(bitrate) {
setBitrate({ mediaType, qualityIndex }) {
if (this.dash) {
if (bitrate.qualityIndex > 0) {
if (this.dash.getAutoSwitchQualityFor(bitrate.mediaType)) {
this.dash.setAutoSwitchQualityFor(bitrate.mediaType, false);
if (qualityIndex > 0) {
if (this.dash.getSettings()) {
this.dash.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: {
[mediaType]: false
}
}
}
});
}
/** @type {?} */
const nextIndex = bitrate.qualityIndex - 1;
this.dash.setQualityFor(bitrate.mediaType, nextIndex);
const nextIndex = qualityIndex - 1;
this.dash.setQualityFor(mediaType, nextIndex);
}
else {
this.dash.setAutoSwitchQualityFor(bitrate.mediaType, true);
this.dash.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: {
[mediaType]: true
}
}
}
});
}

@@ -155,0 +171,0 @@ }

{
"name": "@videogular/ngx-videogular",
"version": "2.0.1",
"version": "2.1.0",
"description": "The HTML5 video player for Angular 2 and successor to videogular2",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -17,6 +17,10 @@ # Videogular

Since `videogular2` is unmaintained, you should consider moving to `@videogular/ngx-videogular`.
Should you wish to migrate from one package to the other, please check out the [migration guide](https://videogular.github.io/ngx-videogular/docs/migrating-from-videogular/).
Should you wish to migrate from one package to the other, please check out the [migration guide](https://github.com/videogular/ngx-videogular/blob/master/docs/ngx-videogular-demo/migrating-from-videogular2/README.md).
### 48% reduction on bundle size? Ivy Support?</br> 😎 All of that and more 😎
# DashJS 2.X.X deprecation
For DashJS compatiblity, please use @videogular/ngx-videogular version < 2.0.1. Moving starting from 2.0.1 we'll only support DashJS 3.X.X
# How to install

@@ -23,0 +27,0 @@

@@ -20,5 +20,5 @@ import { OnInit, OnChanges, OnDestroy, EventEmitter, ElementRef, SimpleChanges } from '@angular/core';

createPlayer(): void;
setBitrate(bitrate: BitrateOptions): void;
setBitrate({ mediaType, qualityIndex }: BitrateOptions): void;
destroyPlayer(): void;
ngOnDestroy(): void;
}

Sorry, the diff of this file is not supported yet

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

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

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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc