emby.idonthaveagmail.com
Open in
urlscan Pro
66.181.119.213
Public Scan
Submitted URL: http://emby.idonthaveagmail.com/web/modules/htmlaudioplayer/plugin.js?v=4.9.0.24
Effective URL: https://emby.idonthaveagmail.com/web/modules/htmlaudioplayer/plugin.js?v=4.9.0.24
Submission: On October 30 via api from US — Scanned from DE
Effective URL: https://emby.idonthaveagmail.com/web/modules/htmlaudioplayer/plugin.js?v=4.9.0.24
Submission: On October 30 via api from US — Scanned from DE
Form analysis
0 forms found in the DOMText Content
define(["exports","./../emby-apiclient/events.js","./../browser.js","./../htmlvideoplayer/htmlmediahelper.js","./../htmlvideoplayer/basehtmlplayer.js"],function(_exports,_events,_browser,_htmlmediahelper,_basehtmlplayer){var fadeTimeout,supportedFeatures;function cancelFadeTimeout(){fadeTimeout&&(clearTimeout(fadeTimeout),fadeTimeout=null)}function stopInternal(instance,destroyPlayer,triggerStopEvent,disableFade){cancelFadeTimeout();var originalVolume,elem=instance._mediaElement,src=instance._currentSrc;return elem?!destroyPlayer||_browser.default.tizen||_browser.default.web0s||_browser.default.netcast||_browser.default.operaTv||disableFade?(src&&elem.pause(),_htmlmediahelper.default.onEndedInternal(instance,elem,triggerStopEvent),destroyPlayer&&instance.destroy(),Promise.resolve()):(originalVolume=elem.volume,function fade(instance,elem,startingVolume){instance._isFadingOut=!0;var newVolume=Math.max(0,startingVolume-.15);return console.log("fading volume to "+newVolume),(elem.volume=newVolume)<=0?(instance._isFadingOut=!1,Promise.resolve()):new Promise(function(resolve,reject){cancelFadeTimeout(),fadeTimeout=setTimeout(function(){fade(instance,elem,newVolume).then(resolve,reject)},100)})}(instance,elem,elem.volume).then(function(){elem.pause(),elem.volume=originalVolume,_htmlmediahelper.default.onEndedInternal(instance,elem),destroyPlayer&&instance.destroy()})):Promise.resolve()}function bindMediaManager(instance,elem){_browser.default.chromecast&&(cast.framework.CastReceiverContext.getInstance().getPlayerManager().setMediaElement(elem),instance.bindMediaManagerEvents())}function HtmlAudioPlayer(){var self=this;function unBindEvents(elem){elem.removeEventListener("timeupdate",onTimeUpdate),elem.removeEventListener("ended",onEnded),elem.removeEventListener("volumechange",onVolumeChange),elem.removeEventListener("ratechange",onRateChange),elem.removeEventListener("pause",onPause),elem.removeEventListener("playing",onPlaying),elem.removeEventListener("waiting",onWaiting),elem.removeEventListener("play",onPlay)}function onEnded(){_htmlmediahelper.default.onEndedInternal(self,this)}function onTimeUpdate(){var time;self._started&&!self._isFadingOut&&((time=this.currentTime)&&!self._timeUpdated&&(self._timeUpdated=!0),self._currentTime=time,_events.default.trigger(self,"timeupdate"))}function onVolumeChange(){self._isFadingOut||(self.saveVolume(this.volume),_events.default.trigger(self,"volumechange"))}function onRateChange(){_events.default.trigger(self,"playbackratechange")}function onPlaying(e){self._started||(self._started=!0,self.seekOnPlaybackStart(e.target,self._currentPlayOptions.playerStartPositionTicks)),_events.default.trigger(self,"playing")}function onWaiting(e){_events.default.trigger(self,"waiting")}function onPlay(e){_events.default.trigger(self,"unpause")}function onPause(){_events.default.trigger(self,"pause")}_basehtmlplayer.default.call(this),this.name="Audio Player",self.id="htmlaudioplayer",self.mediaType="Audio",self.priority=1,self.play=function(options,signal){var reason;return signal.aborted?((reason=signal.reason)||((reason=new Error("Aborted")).name="AbortError"),Promise.reject(reason)):(self._started=!1,self._timeUpdated=!1,self._currentTime=null,function(elem,options,signal){_htmlmediahelper.default.removeErrorEventListener(elem),unBindEvents(elem),function(elem){elem.addEventListener("timeupdate",onTimeUpdate),elem.addEventListener("ended",onEnded),elem.addEventListener("volumechange",onVolumeChange),elem.addEventListener("ratechange",onRateChange),elem.addEventListener("pause",onPause),elem.addEventListener("playing",onPlaying),elem.addEventListener("waiting",onWaiting),elem.addEventListener("play",onPlay)}(elem);var val=options.url,seconds=(console.log("playing url: "+val),(options.playerStartPositionTicks||0)/1e7);seconds&&(val+="#t="+seconds);_htmlmediahelper.default.destroyHlsPlayer(self),self._currentPlayOptions=options;seconds=self.getCrossOriginValue(options.mediaSource,options.playMethod);seconds&&(elem.crossOrigin=seconds);return function(url,options,mediaSource,mediaType,signal){return!url.includes(".m3u8")&&(_browser.default.chromecast||_htmlmediahelper.default.enableHlsJsPlayer(mediaSource.RunTimeTicks,mediaType))?fetch(url,{method:"HEAD",signal:signal}).then(function(response){var response=response.headers.get("Content-Type")||"",contentType=response.toLowerCase();return"application/x-mpegurl"!==contentType&&"application/vnd.apple.mpegurl"!==contentType||(options.mimeType=response),Promise.resolve()}):Promise.resolve()}(val,options,options.mediaSource,"Audio",signal).then(function(){var reason;return signal.aborted?((reason=signal.reason)||((reason=new Error("Aborted")).name="AbortError"),Promise.reject(reason)):_browser.default.chromecast?self.setCurrentSrcChromecast(elem,options,val):self.loadIntoPlayer(elem,options,val)})}(function(instance){var elem=instance._mediaElement;return elem?bindMediaManager(instance,elem):((elem=document.querySelector(".mediaPlayerAudio"))||((elem=document.createElement("audio")).classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem)),elem.volume=instance.getSavedVolume(),instance._mediaElement=elem,bindMediaManager(instance,elem)),elem}(self),options,signal).then(function(result){var _reason;return signal.aborted?(stopInternal(self,!1,!1,!0),(_reason=signal.reason)||((_reason=new Error("Aborted")).name="AbortError"),Promise.reject(_reason)):Promise.resolve(result)}))},self.loadIntoPlayer=function(elem,options,val){return function(url,options,mediaSource,mediaType){return _htmlmediahelper.default.enableHlsJsPlayer(mediaSource.RunTimeTicks,mediaType)&&(url.includes(".m3u8")||"application/x-mpegurl"===(mediaSource=(options.mimeType||"").toLowerCase())||"application/vnd.apple.mpegurl"===mediaSource)}(val,options,options.mediaSource,"Audio")?self.setSrcWithHlsJs(elem,options,val):(elem.autoplay=!0,_htmlmediahelper.default.applySrc(elem,val,options).then(function(){return self._currentSrc=val,_htmlmediahelper.default.playWithPromise(self,elem)}))},self.stop=function(destroyPlayer){return stopInternal(this,destroyPlayer)},self.destroy=function(){_browser.default.chromecast&&self.unBindMediaManagerEvents(),unBindEvents(self._mediaElement)}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(HtmlAudioPlayer.prototype,_basehtmlplayer.default.prototype),HtmlAudioPlayer.prototype.supports=function(feature){var list;return supportedFeatures||(list=[],_browser.default.tizen||_browser.default.web0s||_browser.default.netcast||list.push("SetPlaybackRate"),supportedFeatures=list),supportedFeatures.includes(feature)},HtmlAudioPlayer.prototype.destroy=function(){};_exports.default=HtmlAudioPlayer});