1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Update to 3.5.2 and .net core 2.1

This commit is contained in:
stefan 2018-09-12 19:26:21 +02:00
parent 15f48949eb
commit 1c06eed098
665 changed files with 13778 additions and 11582 deletions

View file

@ -1 +1 @@
define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='<i class="md-icon iconOsdIcon">&#xE1AC;</i>',html+='<div class="iconOsdProgressOuter"><div class="iconOsdProgressInner brightnessOsdProgressInner"></div></div>'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("brightnessOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updateElementsFromPlayer(brightness){iconElement&&(brightness>=80?iconElement.innerHTML="&#xE1AC;":brightness>=20?iconElement.innerHTML="&#xE1AE;":iconElement.innerHTML="&#xE1AD;"),progressElement&&(progressElement.style.width=(brightness||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"brightnesschange",onBrightnessChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onBrightnessChanged(e){var player=this;ensureOsdElement(),updateElementsFromPlayer(playbackManager.getBrightness(player)),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"brightnesschange",onBrightnessChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())});
define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='<i class="md-icon iconOsdIcon">&#xE1AC;</i>',html+='<div class="iconOsdProgressOuter"><div class="iconOsdProgressInner brightnessOsdProgressInner"></div></div>'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("brightnessOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updateElementsFromPlayer(brightness){iconElement&&(iconElement.innerHTML=brightness>=80?"&#xE1AC;":brightness>=20?"&#xE1AE;":"&#xE1AD;"),progressElement&&(progressElement.style.width=(brightness||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"brightnesschange",onBrightnessChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onBrightnessChanged(e){var player=this;ensureOsdElement(),updateElementsFromPlayer(playbackManager.getBrightness(player)),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"brightnesschange",onBrightnessChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())});

View file

@ -1 +1 @@
define(["connectionManager","globalize","userSettings","apphost"],function(connectionManager,globalize,userSettings,appHost){"use strict";function showMessage(text,userSettingsKey,appHostFeature){return userSettingsKey+=(new Date).getMonth(),appHost.supports(appHostFeature)?Promise.resolve():"1"===userSettings.get(userSettingsKey,!1)?Promise.resolve():new Promise(function(resolve,reject){userSettings.set(userSettingsKey,"1",!1),require(["alert"],function(alert){return alert(text).then(resolve,resolve)})})}function showBlurayMessage(){var message="Playback of Bluray folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Bluray folder support.";return showMessage(message,"blurayexpirementalinfo","nativeblurayplayback")}function showDvdMessage(){var message="Playback of Dvd folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Dvd folder support.";return showMessage(message,"dvdexpirementalinfo","nativedvdplayback")}function showIsoMessage(){var message="Playback of ISO files in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native ISO support.";return showMessage(message,"isoexpirementalinfo","nativeisoplayback")}function ExpirementalPlaybackWarnings(){this.name="Experimental playback warnings",this.type="preplayintercept",this.id="expirementalplaybackwarnings"}return ExpirementalPlaybackWarnings.prototype.intercept=function(options){var item=options.item;return item?"Iso"===item.VideoType?showIsoMessage():"BluRay"===item.VideoType?showBlurayMessage():"Dvd"===item.VideoType?showDvdMessage():Promise.resolve():Promise.resolve()},ExpirementalPlaybackWarnings});
define(["connectionManager","globalize","userSettings","apphost"],function(connectionManager,globalize,userSettings,appHost){"use strict";function getWeek(date){var d=new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate())),dayNum=d.getUTCDay()||7;d.setUTCDate(d.getUTCDate()+4-dayNum);var yearStart=new Date(Date.UTC(d.getUTCFullYear(),0,1));return Math.ceil(((d-yearStart)/864e5+1)/7)}function showMessage(text,userSettingsKey,appHostFeature){if(appHost.supports(appHostFeature))return Promise.resolve();var now=new Date;return userSettingsKey+=now.getFullYear()+"-w"+getWeek(now),"1"===userSettings.get(userSettingsKey,!1)?Promise.resolve():new Promise(function(resolve,reject){userSettings.set(userSettingsKey,"1",!1),require(["alert"],function(alert){return alert(text).then(resolve,resolve)})})}function showBlurayMessage(){return showMessage("Playback of Bluray folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Bluray folder support.","blurayexpirementalinfo","nativeblurayplayback")}function showDvdMessage(){return showMessage("Playback of Dvd folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Dvd folder support.","dvdexpirementalinfo","nativedvdplayback")}function showIsoMessage(){return showMessage("Playback of ISO files in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native ISO support.","isoexpirementalinfo","nativeisoplayback")}function ExpirementalPlaybackWarnings(){this.name="Experimental playback warnings",this.type="preplayintercept",this.id="expirementalplaybackwarnings"}return ExpirementalPlaybackWarnings.prototype.intercept=function(options){var item=options.item;return item?"Iso"===item.VideoType?showIsoMessage():"BluRay"===item.VideoType?showBlurayMessage():"Dvd"===item.VideoType?showDvdMessage():Promise.resolve():Promise.resolve()},ExpirementalPlaybackWarnings});

View file

@ -1 +1 @@
define(["playbackManager","nowPlayingHelper","events","connectionManager"],function(playbackManager,nowPlayingHelper,events,connectionManager){"use strict";function seriesImageUrl(item,options){if("Episode"!==item.Type)return null;if(options=options||{},options.type=options.type||"Primary","Primary"===options.type&&item.SeriesPrimaryImageTag)return options.tag=item.SeriesPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if("Thumb"===options.type){if(item.SeriesThumbImageTag)return options.tag=item.SeriesThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if(item.ParentThumbImageTag)return options.tag=item.ParentThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.ParentThumbItemId,options)}return null}function imageUrl(item,options){return options=options||{},options.type=options.type||"Primary",item.ImageTags&&item.ImageTags[options.type]?(options.tag=item.ImageTags[options.type],connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function pushImageUrl(item,height,list){var imageOptions={height:height},url=seriesImageUrl(item,imageOptions)||imageUrl(item,imageOptions);url&&list.push({src:url,sizes:height+"x"+height})}function getImageUrls(item){var list=[];return pushImageUrl(item,96,list),pushImageUrl(item,128,list),pushImageUrl(item,192,list),pushImageUrl(item,256,list),pushImageUrl(item,384,list),pushImageUrl(item,512,list),list}function updatePlayerState(player,state,eventName){var item=state.NowPlayingItem;if(!item)return void hideMediaControls();var playState=state.PlayState||{},parts=nowPlayingHelper.getNowPlayingNames(item),artist=1===parts.length?"":parts[0].text,title=parts[parts.length-1].text,isVideo="Video"===item.MediaType;if(isVideo&&parts.length>1){var temp=artist;artist=title,title=temp}var albumArtist;item.AlbumArtists&&item.AlbumArtists[0]&&(albumArtist=item.AlbumArtists[0].Name);var album=item.Album||"",itemId=item.Id,duration=parseInt(item.RunTimeTicks?item.RunTimeTicks/1e4:0),currentTime=parseInt(playState.PositionTicks?playState.PositionTicks/1e4:0),isPaused=playState.IsPaused||!1;playState.CanSeek||!1;navigator.mediaSession.metadata=new MediaMetadata({title:title,artist:artist,album:album,artwork:getImageUrls(item),albumArtist:albumArtist,currentTime:currentTime,duration:duration,paused:isPaused,itemId:itemId,mediaType:item.MediaType})}function onGeneralEvent(e){var player=this,state=playbackManager.getPlayerState(player);updatePlayerState(player,state,e.type)}function onStateChanged(e,state){var player=this;updatePlayerState(player,state,"statechange")}function onPlaybackStart(e,state){console.log("nowplaying event: "+e.type);var player=this;updatePlayerState(player,state,e.type)}function onPlaybackStopped(e,state){console.log("nowplaying event: "+e.type);hideMediaControls()}function releaseCurrentPlayer(){currentPlayer&&(events.off(currentPlayer,"playbackstart",onPlaybackStart),events.off(currentPlayer,"playbackstop",onPlaybackStopped),events.off(currentPlayer,"unpause",onGeneralEvent),events.off(currentPlayer,"pause",onGeneralEvent),events.off(currentPlayer,"statechange",onStateChanged),events.off(currentPlayer,"timeupdate",onGeneralEvent),currentPlayer=null,hideMediaControls())}function hideMediaControls(){navigator.mediaSession.metadata=null}function bindToPlayer(player){if(releaseCurrentPlayer(),player){currentPlayer=player,console.log("binding remotecontrols to "+player.name);var state=playbackManager.getPlayerState(player);updatePlayerState(player,state,"init"),events.on(currentPlayer,"playbackstart",onPlaybackStart),events.on(currentPlayer,"playbackstop",onPlaybackStopped),events.on(currentPlayer,"unpause",onGeneralEvent),events.on(currentPlayer,"pause",onGeneralEvent),events.on(currentPlayer,"statechange",onStateChanged),events.on(currentPlayer,"timeupdate",onGeneralEvent)}}function execute(name){playbackManager[name](currentPlayer)}var currentPlayer;console.log("binding remotecontrols to playbackManager"),navigator.mediaSession.setActionHandler("previoustrack",function(){execute("previousChapter")}),navigator.mediaSession.setActionHandler("nexttrack",function(){execute("nextChapter")}),navigator.mediaSession.setActionHandler("play",function(){execute("unpause")}),navigator.mediaSession.setActionHandler("pause",function(){execute("pause")}),navigator.mediaSession.setActionHandler("seekbackward",function(){execute("rewind")}),navigator.mediaSession.setActionHandler("seekforward",function(){execute("fastForward")}),events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())});
define(["playbackManager","nowPlayingHelper","events","connectionManager"],function(playbackManager,nowPlayingHelper,events,connectionManager){"use strict";function seriesImageUrl(item,options){if("Episode"!==item.Type)return null;if(options=options||{},options.type=options.type||"Primary","Primary"===options.type&&item.SeriesPrimaryImageTag)return options.tag=item.SeriesPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if("Thumb"===options.type){if(item.SeriesThumbImageTag)return options.tag=item.SeriesThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId,options);if(item.ParentThumbImageTag)return options.tag=item.ParentThumbImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.ParentThumbItemId,options)}return null}function imageUrl(item,options){return options=options||{},options.type=options.type||"Primary",item.ImageTags&&item.ImageTags[options.type]?(options.tag=item.ImageTags[options.type],connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.Id,options)):item.AlbumId&&item.AlbumPrimaryImageTag?(options.tag=item.AlbumPrimaryImageTag,connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId,options)):null}function pushImageUrl(item,height,list){var imageOptions={height:height},url=seriesImageUrl(item,imageOptions)||imageUrl(item,imageOptions);url&&list.push({src:url,sizes:height+"x"+height})}function getImageUrls(item){var list=[];return pushImageUrl(item,96,list),pushImageUrl(item,128,list),pushImageUrl(item,192,list),pushImageUrl(item,256,list),pushImageUrl(item,384,list),pushImageUrl(item,512,list),list}function updatePlayerState(player,state,eventName){var item=state.NowPlayingItem;if(!item)return void hideMediaControls();var playState=state.PlayState||{},parts=nowPlayingHelper.getNowPlayingNames(item),artist=1===parts.length?"":parts[0].text,title=parts[parts.length-1].text;if("Video"===item.MediaType&&parts.length>1){var temp=artist;artist=title,title=temp}var albumArtist;item.AlbumArtists&&item.AlbumArtists[0]&&(albumArtist=item.AlbumArtists[0].Name);var album=item.Album||"",itemId=item.Id,duration=parseInt(item.RunTimeTicks?item.RunTimeTicks/1e4:0),currentTime=parseInt(playState.PositionTicks?playState.PositionTicks/1e4:0),isPaused=playState.IsPaused||!1;navigator.mediaSession.metadata=new MediaMetadata({title:title,artist:artist,album:album,artwork:getImageUrls(item),albumArtist:albumArtist,currentTime:currentTime,duration:duration,paused:isPaused,itemId:itemId,mediaType:item.MediaType})}function onGeneralEvent(e){var player=this;updatePlayerState(player,playbackManager.getPlayerState(player),e.type)}function onStateChanged(e,state){updatePlayerState(this,state,"statechange")}function onPlaybackStart(e,state){updatePlayerState(this,state,e.type)}function onPlaybackStopped(e,state){hideMediaControls()}function releaseCurrentPlayer(){currentPlayer&&(events.off(currentPlayer,"playbackstart",onPlaybackStart),events.off(currentPlayer,"playbackstop",onPlaybackStopped),events.off(currentPlayer,"unpause",onGeneralEvent),events.off(currentPlayer,"pause",onGeneralEvent),events.off(currentPlayer,"statechange",onStateChanged),events.off(currentPlayer,"timeupdate",onGeneralEvent),currentPlayer=null,hideMediaControls())}function hideMediaControls(){navigator.mediaSession.metadata=null}function bindToPlayer(player){if(releaseCurrentPlayer(),player){currentPlayer=player;updatePlayerState(player,playbackManager.getPlayerState(player),"init"),events.on(currentPlayer,"playbackstart",onPlaybackStart),events.on(currentPlayer,"playbackstop",onPlaybackStopped),events.on(currentPlayer,"unpause",onGeneralEvent),events.on(currentPlayer,"pause",onGeneralEvent),events.on(currentPlayer,"statechange",onStateChanged),events.on(currentPlayer,"timeupdate",onGeneralEvent)}}function execute(name){playbackManager[name](currentPlayer)}var currentPlayer;navigator.mediaSession.setActionHandler("previoustrack",function(){execute("previousTrack")}),navigator.mediaSession.setActionHandler("nexttrack",function(){execute("nextTrack")}),navigator.mediaSession.setActionHandler("play",function(){execute("unpause")}),navigator.mediaSession.setActionHandler("pause",function(){execute("pause")}),navigator.mediaSession.setActionHandler("seekbackward",function(){execute("rewind")}),navigator.mediaSession.setActionHandler("seekforward",function(){execute("fastForward")}),events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())});

View file

@ -1 +1 @@
define([],function(){"use strict";function getNowPlayingNames(nowPlayingItem,includeNonNameInfo){var topItem=nowPlayingItem,bottomItem=null,topText=nowPlayingItem.Name;nowPlayingItem.AlbumId&&"Audio"===nowPlayingItem.MediaType&&(topItem={Id:nowPlayingItem.AlbumId,Name:nowPlayingItem.Album,Type:"MusicAlbum",IsFolder:!0}),"Video"===nowPlayingItem.MediaType&&(null!=nowPlayingItem.IndexNumber&&(topText=nowPlayingItem.IndexNumber+" - "+topText),null!=nowPlayingItem.ParentIndexNumber&&(topText=nowPlayingItem.ParentIndexNumber+"."+topText));var bottomText="";nowPlayingItem.ArtistItems&&nowPlayingItem.ArtistItems.length?(bottomItem={Id:nowPlayingItem.ArtistItems[0].Id,Name:nowPlayingItem.ArtistItems[0].Name,Type:"MusicArtist",IsFolder:!0},bottomText=nowPlayingItem.ArtistItems.map(function(a){return a.Name}).join(", ")):nowPlayingItem.Artists&&nowPlayingItem.Artists.length?bottomText=nowPlayingItem.Artists.join(", "):nowPlayingItem.SeriesName||nowPlayingItem.Album?(bottomText=topText,topText=nowPlayingItem.SeriesName||nowPlayingItem.Album,bottomItem=topItem,topItem=nowPlayingItem.SeriesId?{Id:nowPlayingItem.SeriesId,Name:nowPlayingItem.SeriesName,Type:"Series",IsFolder:!0}:null):nowPlayingItem.ProductionYear&&includeNonNameInfo!==!1&&(bottomText=nowPlayingItem.ProductionYear);var list=[];return list.push({text:topText,item:topItem}),bottomText&&list.push({text:bottomText,item:bottomItem}),list}return{getNowPlayingNames:getNowPlayingNames}});
define([],function(){"use strict";function getNowPlayingNames(nowPlayingItem,includeNonNameInfo){var topItem=nowPlayingItem,bottomItem=null,topText=nowPlayingItem.Name;nowPlayingItem.AlbumId&&"Audio"===nowPlayingItem.MediaType&&(topItem={Id:nowPlayingItem.AlbumId,Name:nowPlayingItem.Album,Type:"MusicAlbum",IsFolder:!0}),"Video"===nowPlayingItem.MediaType&&(null!=nowPlayingItem.IndexNumber&&(topText=nowPlayingItem.IndexNumber+" - "+topText),null!=nowPlayingItem.ParentIndexNumber&&(topText=nowPlayingItem.ParentIndexNumber+"."+topText));var bottomText="";nowPlayingItem.ArtistItems&&nowPlayingItem.ArtistItems.length?(bottomItem={Id:nowPlayingItem.ArtistItems[0].Id,Name:nowPlayingItem.ArtistItems[0].Name,Type:"MusicArtist",IsFolder:!0},bottomText=nowPlayingItem.ArtistItems.map(function(a){return a.Name}).join(", ")):nowPlayingItem.Artists&&nowPlayingItem.Artists.length?bottomText=nowPlayingItem.Artists.join(", "):nowPlayingItem.SeriesName||nowPlayingItem.Album?(bottomText=topText,topText=nowPlayingItem.SeriesName||nowPlayingItem.Album,bottomItem=topItem,topItem=nowPlayingItem.SeriesId?{Id:nowPlayingItem.SeriesId,Name:nowPlayingItem.SeriesName,Type:"Series",IsFolder:!0}:null):nowPlayingItem.ProductionYear&&!1!==includeNonNameInfo&&(bottomText=nowPlayingItem.ProductionYear);var list=[];return list.push({text:topText,item:topItem}),bottomText&&list.push({text:bottomText,item:bottomItem}),list}return{getNowPlayingNames:getNowPlayingNames}});

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
define(["playbackManager","layoutManager","events"],function(playbackManager,layoutManager,events){"use strict";function onOrientationChangeSuccess(){orientationLocked=!0}function onOrientationChangeError(err){orientationLocked=!1,console.log("error locking orientation: "+err)}var orientationLocked;events.on(playbackManager,"playbackstart",function(e,player,state){if(player.isLocalPlayer&&!player.isExternalPlayer&&playbackManager.isPlayingVideo(player)&&layoutManager.mobile){var lockOrientation=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation||screen.orientation&&screen.orientation.lock;if(lockOrientation)try{var promise=lockOrientation("landscape");promise.then?promise.then(onOrientationChangeSuccess,onOrientationChangeError):orientationLocked=promise}catch(err){onOrientationChangeError(err)}}}),events.on(playbackManager,"playbackstop",function(e,playbackStopInfo){if(orientationLocked&&!playbackStopInfo.nextMediaType){var unlockOrientation=screen.unlockOrientation||screen.mozUnlockOrientation||screen.msUnlockOrientation||screen.orientation&&screen.orientation.unlock;if(unlockOrientation){try{unlockOrientation()}catch(err){console.log("error unlocking orientation: "+err)}orientationLocked=!1}}})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
define([],function(){"use strict";function addUniquePlaylistItemId(item){item.PlaylistItemId||(item.PlaylistItemId="playlistItem"+currentId,currentId++)}function findPlaylistIndex(playlistItemId,list){for(var i=0,length=list.length;i<length;i++)if(list[i].PlaylistItemId===playlistItemId)return i;return-1}function PlayQueueManager(){this._playlist=[],this._repeatMode="RepeatNone"}function arrayInsertAt(destArray,pos,arrayToInsert){var args=[];args.push(pos),args.push(0),args=args.concat(arrayToInsert),destArray.splice.apply(destArray,args)}function moveInArray(array,from,to){array.splice(to,0,array.splice(from,1)[0])}var currentId=0;return PlayQueueManager.prototype.getPlaylist=function(){return this._playlist.slice(0)},PlayQueueManager.prototype.setPlaylist=function(items){items=items.slice(0);for(var i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]);this._currentPlaylistItemId=null,this._playlist=items,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.queue=function(items){for(var i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]),this._playlist.push(items[i])},PlayQueueManager.prototype.queueNext=function(items){var i,length;for(i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]);var currentIndex=this.getCurrentPlaylistIndex();currentIndex===-1?currentIndex=this._playlist.length:currentIndex++,arrayInsertAt(this._playlist,currentIndex,items)},PlayQueueManager.prototype.getCurrentPlaylistIndex=function(){return findPlaylistIndex(this.getCurrentPlaylistItemId(),this._playlist)},PlayQueueManager.prototype.getCurrentItem=function(){var index=findPlaylistIndex(this.getCurrentPlaylistItemId(),this._playlist);return index===-1?null:this._playlist[index]},PlayQueueManager.prototype.getCurrentPlaylistItemId=function(){return this._currentPlaylistItemId},PlayQueueManager.prototype.setPlaylistState=function(playlistItemId,playlistIndex){this._currentPlaylistItemId=playlistItemId},PlayQueueManager.prototype.setPlaylistIndex=function(playlistIndex){playlistIndex<0?this.setPlaylistState(null):this.setPlaylistState(this._playlist[playlistIndex].PlaylistItemId)},PlayQueueManager.prototype.removeFromPlaylist=function(playlistItemIds){var playlist=this.getPlaylist();if(playlist.length<=playlistItemIds.length)return{result:"empty"};var currentPlaylistItemId=this.getCurrentPlaylistItemId(),isCurrentIndex=playlistItemIds.indexOf(currentPlaylistItemId)!==-1;return this._playlist=playlist.filter(function(item){return playlistItemIds.indexOf(item.PlaylistItemId)===-1}),{result:"removed",isCurrentIndex:isCurrentIndex}},PlayQueueManager.prototype.movePlaylistItem=function(playlistItemId,newIndex){for(var oldIndex,playlist=this.getPlaylist(),i=0,length=playlist.length;i<length;i++)if(playlist[i].PlaylistItemId===playlistItemId){oldIndex=i;break}if(oldIndex===-1||oldIndex===newIndex)return{result:"noop"};if(newIndex>=playlist.length)throw new Error("newIndex out of bounds");return moveInArray(playlist,oldIndex,newIndex),this._playlist=playlist,{result:"moved",playlistItemId:playlistItemId,newIndex:newIndex}},PlayQueueManager.prototype.reset=function(){this._playlist=[],this._currentPlaylistItemId=null,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.setRepeatMode=function(value){this._repeatMode=value},PlayQueueManager.prototype.getRepeatMode=function(){return this._repeatMode},PlayQueueManager.prototype.getNextItemInfo=function(){var newIndex,playlist=this.getPlaylist(),playlistLength=playlist.length;switch(this.getRepeatMode()){case"RepeatOne":newIndex=this.getCurrentPlaylistIndex();break;case"RepeatAll":newIndex=this.getCurrentPlaylistIndex()+1,newIndex>=playlistLength&&(newIndex=0);break;default:newIndex=this.getCurrentPlaylistIndex()+1}if(newIndex<0||newIndex>=playlistLength)return null;var item=playlist[newIndex];return item?{item:item,index:newIndex}:null},PlayQueueManager});
define([],function(){"use strict";function addUniquePlaylistItemId(item){item.PlaylistItemId||(item.PlaylistItemId="playlistItem"+currentId,currentId++)}function findPlaylistIndex(playlistItemId,list){for(var i=0,length=list.length;i<length;i++)if(list[i].PlaylistItemId===playlistItemId)return i;return-1}function PlayQueueManager(){this._playlist=[],this._repeatMode="RepeatNone"}function arrayInsertAt(destArray,pos,arrayToInsert){var args=[];args.push(pos),args.push(0),args=args.concat(arrayToInsert),destArray.splice.apply(destArray,args)}function moveInArray(array,from,to){array.splice(to,0,array.splice(from,1)[0])}var currentId=0;return PlayQueueManager.prototype.getPlaylist=function(){return this._playlist.slice(0)},PlayQueueManager.prototype.setPlaylist=function(items){items=items.slice(0);for(var i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]);this._currentPlaylistItemId=null,this._playlist=items,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.queue=function(items){for(var i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]),this._playlist.push(items[i])},PlayQueueManager.prototype.queueNext=function(items){var i,length;for(i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]);var currentIndex=this.getCurrentPlaylistIndex();-1===currentIndex?currentIndex=this._playlist.length:currentIndex++,arrayInsertAt(this._playlist,currentIndex,items)},PlayQueueManager.prototype.getCurrentPlaylistIndex=function(){return findPlaylistIndex(this.getCurrentPlaylistItemId(),this._playlist)},PlayQueueManager.prototype.getCurrentItem=function(){var index=findPlaylistIndex(this.getCurrentPlaylistItemId(),this._playlist);return-1===index?null:this._playlist[index]},PlayQueueManager.prototype.getCurrentPlaylistItemId=function(){return this._currentPlaylistItemId},PlayQueueManager.prototype.setPlaylistState=function(playlistItemId,playlistIndex){this._currentPlaylistItemId=playlistItemId},PlayQueueManager.prototype.setPlaylistIndex=function(playlistIndex){playlistIndex<0?this.setPlaylistState(null):this.setPlaylistState(this._playlist[playlistIndex].PlaylistItemId)},PlayQueueManager.prototype.removeFromPlaylist=function(playlistItemIds){var playlist=this.getPlaylist();if(playlist.length<=playlistItemIds.length)return{result:"empty"};var currentPlaylistItemId=this.getCurrentPlaylistItemId(),isCurrentIndex=-1!==playlistItemIds.indexOf(currentPlaylistItemId);return this._playlist=playlist.filter(function(item){return-1===playlistItemIds.indexOf(item.PlaylistItemId)}),{result:"removed",isCurrentIndex:isCurrentIndex}},PlayQueueManager.prototype.movePlaylistItem=function(playlistItemId,newIndex){for(var oldIndex,playlist=this.getPlaylist(),i=0,length=playlist.length;i<length;i++)if(playlist[i].PlaylistItemId===playlistItemId){oldIndex=i;break}if(-1===oldIndex||oldIndex===newIndex)return{result:"noop"};if(newIndex>=playlist.length)throw new Error("newIndex out of bounds");return moveInArray(playlist,oldIndex,newIndex),this._playlist=playlist,{result:"moved",playlistItemId:playlistItemId,newIndex:newIndex}},PlayQueueManager.prototype.reset=function(){this._playlist=[],this._currentPlaylistItemId=null,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.setRepeatMode=function(value){this._repeatMode=value},PlayQueueManager.prototype.getRepeatMode=function(){return this._repeatMode},PlayQueueManager.prototype.getNextItemInfo=function(){var newIndex,playlist=this.getPlaylist(),playlistLength=playlist.length;switch(this.getRepeatMode()){case"RepeatOne":newIndex=this.getCurrentPlaylistIndex();break;case"RepeatAll":newIndex=this.getCurrentPlaylistIndex()+1,newIndex>=playlistLength&&(newIndex=0);break;default:newIndex=this.getCurrentPlaylistIndex()+1}if(newIndex<0||newIndex>=playlistLength)return null;var item=playlist[newIndex];return item?{item:item,index:newIndex}:null},PlayQueueManager});

View file

@ -1 +1 @@
define(["events","playbackManager"],function(events,playbackManager){"use strict";function transferPlayback(oldPlayer,newPlayer){var state=playbackManager.getPlayerState(oldPlayer),item=state.NowPlayingItem;if(item){var playState=state.PlayState||{};playbackManager.stop(oldPlayer).then(function(){var resumePositionTicks=playState.PositionTicks||0;playbackManager.play({ids:[item.Id],serverId:item.ServerId,startPositionTicks:resumePositionTicks},newPlayer)})}}events.on(playbackManager,"playerchange",function(e,newPlayer,newTarget,oldPlayer){if(oldPlayer&&newPlayer)return oldPlayer.isLocalPlayer?newPlayer.isLocalPlayer?void console.log("Skipping remote control autoplay because newPlayer is a local player"):void transferPlayback(oldPlayer,newPlayer):void console.log("Skipping remote control autoplay because oldPlayer is not a local player")})});
define(["events","playbackManager"],function(events,playbackManager){"use strict";function transferPlayback(oldPlayer,newPlayer){var state=playbackManager.getPlayerState(oldPlayer),item=state.NowPlayingItem;if(item){var playState=state.PlayState||{},resumePositionTicks=playState.PositionTicks||0;playbackManager.stop(oldPlayer).then(function(){playbackManager.play({ids:[item.Id],serverId:item.ServerId,startPositionTicks:resumePositionTicks},newPlayer)})}}events.on(playbackManager,"playerchange",function(e,newPlayer,newTarget,oldPlayer){if(oldPlayer&&newPlayer)return oldPlayer.isLocalPlayer?newPlayer.isLocalPlayer?void console.log("Skipping remote control autoplay because newPlayer is a local player"):void transferPlayback(oldPlayer,newPlayer):void console.log("Skipping remote control autoplay because oldPlayer is not a local player")})});

View file

@ -1 +1 @@
define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='<i class="md-icon iconOsdIcon">&#xE050;</i>',html+='<div class="iconOsdProgressOuter"><div class="iconOsdProgressInner"></div></div>'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("volumeOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(void elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updatePlayerVolumeState(isMuted,volume){iconElement&&(iconElement.innerHTML=isMuted?"&#xE04F;":"&#xE050;"),progressElement&&(progressElement.style.width=(volume||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"volumechange",onVolumeChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onVolumeChanged(e){var player=this;ensureOsdElement(),updatePlayerVolumeState(player.isMuted(),player.getVolume()),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"volumechange",onVolumeChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())});
define(["events","playbackManager","dom","browser","css!./iconosd","material-icons"],function(events,playbackManager,dom,browser){"use strict";function getOsdElementHtml(){var html="";return html+='<i class="md-icon iconOsdIcon">&#xE050;</i>',html+='<div class="iconOsdProgressOuter"><div class="iconOsdProgressInner"></div></div>'}function ensureOsdElement(){var elem=osdElement;elem||(enableAnimation=browser.supportsCssAnimation(),elem=document.createElement("div"),elem.classList.add("hide"),elem.classList.add("iconOsd"),elem.classList.add("iconOsd-hidden"),elem.classList.add("volumeOsd"),elem.innerHTML=getOsdElementHtml(),iconElement=elem.querySelector("i"),progressElement=elem.querySelector(".iconOsdProgressInner"),document.body.appendChild(elem),osdElement=elem)}function onHideComplete(){this.classList.add("hide")}function showOsd(){clearHideTimeout();var elem=osdElement;dom.removeEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0}),elem.classList.remove("hide"),elem.offsetWidth,requestAnimationFrame(function(){elem.classList.remove("iconOsd-hidden"),hideTimeout=setTimeout(hideOsd,3e3)})}function clearHideTimeout(){hideTimeout&&(clearTimeout(hideTimeout),hideTimeout=null)}function hideOsd(){clearHideTimeout();var elem=osdElement;elem&&(enableAnimation?(elem.offsetWidth,requestAnimationFrame(function(){elem.classList.add("iconOsd-hidden"),dom.addEventListener(elem,dom.whichTransitionEvent(),onHideComplete,{once:!0})})):onHideComplete.call(elem))}function updatePlayerVolumeState(isMuted,volume){iconElement&&(iconElement.innerHTML=isMuted?"&#xE04F;":"&#xE050;"),progressElement&&(progressElement.style.width=(volume||0)+"%")}function releaseCurrentPlayer(){var player=currentPlayer;player&&(events.off(player,"volumechange",onVolumeChanged),events.off(player,"playbackstop",hideOsd),currentPlayer=null)}function onVolumeChanged(e){var player=this;ensureOsdElement(),updatePlayerVolumeState(player.isMuted(),player.getVolume()),showOsd()}function bindToPlayer(player){player!==currentPlayer&&(releaseCurrentPlayer(),currentPlayer=player,player&&(hideOsd(),events.on(player,"volumechange",onVolumeChanged),events.on(player,"playbackstop",hideOsd)))}var currentPlayer,osdElement,iconElement,progressElement,enableAnimation,hideTimeout;events.on(playbackManager,"playerchange",function(){bindToPlayer(playbackManager.getCurrentPlayer())}),bindToPlayer(playbackManager.getCurrentPlayer())});