mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
3.2.19.8
This commit is contained in:
parent
b6740d9781
commit
310fca9cf2
108 changed files with 499 additions and 314 deletions
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
define(["appSettings","events","browser","loading","playbackManager","embyRouter","globalize","apphost"],function(appSettings,events,browser,loading,playbackManager,embyRouter,globalize,appHost){"use strict";function mirrorItem(info,player){var item=info.item;playbackManager.displayContent({ItemName:item.Name,ItemId:item.Id,ItemType:item.Type,Context:info.context},player)}function mirrorIfEnabled(info){if(info=info||currentDisplayInfo,info&&playbackManager.enableDisplayMirroring()){var getPlayerInfo=playbackManager.getPlayerInfo();getPlayerInfo&&(getPlayerInfo.isLocalPlayer||getPlayerInfo.supportedCommands.indexOf("DisplayContent")===-1||mirrorItem(info,playbackManager.getCurrentPlayer()))}}function emptyCallback(){}function showPlayerSelection(button){var currentPlayerInfo=playbackManager.getPlayerInfo();if(currentPlayerInfo&&!currentPlayerInfo.isLocalPlayer)return void showActivePlayerMenu(currentPlayerInfo);var currentPlayerId=currentPlayerInfo?currentPlayerInfo.id:null;loading.show(),playbackManager.getTargets().then(function(targets){var menuItems=targets.map(function(t){var name=t.name;return t.appName&&t.appName!==t.name&&(name+=" - "+t.appName),{name:name,id:t.id,selected:currentPlayerId===t.id}});require(["actionsheet"],function(actionsheet){loading.hide();var menuOptions={title:globalize.translate("sharedcomponents#HeaderSelectPlayer"),items:menuItems,positionTo:button,resolveOnClick:!0};browser.chrome&&!appHost.supports("castmenuhashchange")&&(menuOptions.enableHistory=!1),actionsheet.show(menuOptions).then(function(id){var target=targets.filter(function(t){return t.id===id})[0];playbackManager.trySetActivePlayer(target.playerName,target),mirrorIfEnabled()},emptyCallback)})})}function showActivePlayerMenu(playerInfo){require(["dialogHelper","dialog","emby-checkbox","emby-button"],function(dialogHelper){showActivePlayerMenuInternal(dialogHelper,playerInfo)})}function showActivePlayerMenuInternal(dialogHelper,playerInfo){var html="",dialogOptions={removeOnClose:!0};dialogOptions.modal=!1,dialogOptions.entryAnimationDuration=160,dialogOptions.exitAnimationDuration=160,dialogOptions.autoFocus=!1;var dlg=dialogHelper.createDialog(dialogOptions);if(dlg.classList.add("promptDialog"),html+='<div class="promptDialogContent" style="padding:1.5em;">',html+='<h2 style="margin-top:.5em;">',html+=playerInfo.deviceName||playerInfo.name,html+="</h2>",html+="<div>",playerInfo.supportedCommands.indexOf("DisplayContent")!==-1){html+='<label class="checkboxContainer">';var checkedHtml=playbackManager.enableDisplayMirroring()?" checked":"";html+='<input type="checkbox" is="emby-checkbox" class="chkMirror"'+checkedHtml+"/>",html+="<span>"+globalize.translate("sharedcomponents#EnableDisplayMirroring")+"</span>",html+="</label>"}html+="</div>",html+='<div style="margin-top:1em;display:flex;justify-content: flex-end;">',html+='<button is="emby-button" type="button" class="button-flat button-accent-flat btnRemoteControl promptDialogButton">'+globalize.translate("sharedcomponents#HeaderRemoteControl")+"</button>",html+='<button is="emby-button" type="button" class="button-flat button-accent-flat btnDisconnect promptDialogButton ">'+globalize.translate("sharedcomponents#Disconnect")+"</button>",html+='<button is="emby-button" type="button" class="button-flat button-accent-flat btnCancel promptDialogButton">'+globalize.translate("sharedcomponents#ButtonCancel")+"</button>",html+="</div>",html+="</div>",dlg.innerHTML=html;var chkMirror=dlg.querySelector(".chkMirror");chkMirror&&chkMirror.addEventListener("change",onMirrorChange);var destination="",btnRemoteControl=dlg.querySelector(".btnRemoteControl");btnRemoteControl&&btnRemoteControl.addEventListener("click",function(){destination="nowplaying",dialogHelper.close(dlg)}),dlg.querySelector(".btnDisconnect").addEventListener("click",function(){playbackManager.disconnectFromPlayer(),dialogHelper.close(dlg)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),dialogHelper.open(dlg).then(function(){"nowplaying"===destination&&embyRouter.showNowPlaying()},emptyCallback)}function onMirrorChange(){playbackManager.enableDisplayMirroring(this.checked)}var currentDisplayInfo;return document.addEventListener("viewbeforeshow",function(){currentDisplayInfo=null}),document.addEventListener("viewshow",function(e){var state=e.detail.state||{},item=state.item;if(item&&item.ServerId)return void mirrorIfEnabled({item:item})}),events.on(appSettings,"change",function(e,name){"displaymirror"===name&&mirrorIfEnabled()}),{show:showPlayerSelection}});
|
||||
define(["appSettings","events","browser","loading","playbackManager","embyRouter","globalize","apphost"],function(appSettings,events,browser,loading,playbackManager,embyRouter,globalize,appHost){"use strict";function mirrorItem(info,player){var item=info.item;playbackManager.displayContent({ItemName:item.Name,ItemId:item.Id,ItemType:item.Type,Context:info.context},player)}function mirrorIfEnabled(info){if(info=info||currentDisplayInfo,info&&playbackManager.enableDisplayMirroring()){var getPlayerInfo=playbackManager.getPlayerInfo();getPlayerInfo&&(getPlayerInfo.isLocalPlayer||getPlayerInfo.supportedCommands.indexOf("DisplayContent")===-1||mirrorItem(info,playbackManager.getCurrentPlayer()))}}function emptyCallback(){}function showPlayerSelection(button){var currentPlayerInfo=playbackManager.getPlayerInfo();if(currentPlayerInfo&&!currentPlayerInfo.isLocalPlayer)return void showActivePlayerMenu(currentPlayerInfo);var currentPlayerId=currentPlayerInfo?currentPlayerInfo.id:null;loading.show(),playbackManager.getTargets().then(function(targets){var menuItems=targets.map(function(t){var name=t.name;return t.appName&&t.appName!==t.name&&(name+=" - "+t.appName),{name:name,id:t.id,selected:currentPlayerId===t.id}});require(["actionsheet"],function(actionsheet){loading.hide();var menuOptions={title:globalize.translate("sharedcomponents#HeaderPlayOn"),items:menuItems,positionTo:button,resolveOnClick:!0};browser.chrome&&!appHost.supports("castmenuhashchange")&&(menuOptions.enableHistory=!1),actionsheet.show(menuOptions).then(function(id){var target=targets.filter(function(t){return t.id===id})[0];playbackManager.trySetActivePlayer(target.playerName,target),mirrorIfEnabled()},emptyCallback)})})}function showActivePlayerMenu(playerInfo){require(["dialogHelper","dialog","emby-checkbox","emby-button"],function(dialogHelper){showActivePlayerMenuInternal(dialogHelper,playerInfo)})}function showActivePlayerMenuInternal(dialogHelper,playerInfo){var html="",dialogOptions={removeOnClose:!0};dialogOptions.modal=!1,dialogOptions.entryAnimationDuration=160,dialogOptions.exitAnimationDuration=160,dialogOptions.autoFocus=!1;var dlg=dialogHelper.createDialog(dialogOptions);if(dlg.classList.add("promptDialog"),html+='<div class="promptDialogContent" style="padding:1.5em;">',html+='<h2 style="margin-top:.5em;">',html+=playerInfo.deviceName||playerInfo.name,html+="</h2>",html+="<div>",playerInfo.supportedCommands.indexOf("DisplayContent")!==-1){html+='<label class="checkboxContainer">';var checkedHtml=playbackManager.enableDisplayMirroring()?" checked":"";html+='<input type="checkbox" is="emby-checkbox" class="chkMirror"'+checkedHtml+"/>",html+="<span>"+globalize.translate("sharedcomponents#EnableDisplayMirroring")+"</span>",html+="</label>"}html+="</div>",html+='<div style="margin-top:1em;display:flex;justify-content: flex-end;">',html+='<button is="emby-button" type="button" class="button-flat button-accent-flat btnRemoteControl promptDialogButton">'+globalize.translate("sharedcomponents#HeaderRemoteControl")+"</button>",html+='<button is="emby-button" type="button" class="button-flat button-accent-flat btnDisconnect promptDialogButton ">'+globalize.translate("sharedcomponents#Disconnect")+"</button>",html+='<button is="emby-button" type="button" class="button-flat button-accent-flat btnCancel promptDialogButton">'+globalize.translate("sharedcomponents#ButtonCancel")+"</button>",html+="</div>",html+="</div>",dlg.innerHTML=html;var chkMirror=dlg.querySelector(".chkMirror");chkMirror&&chkMirror.addEventListener("change",onMirrorChange);var destination="",btnRemoteControl=dlg.querySelector(".btnRemoteControl");btnRemoteControl&&btnRemoteControl.addEventListener("click",function(){destination="nowplaying",dialogHelper.close(dlg)}),dlg.querySelector(".btnDisconnect").addEventListener("click",function(){playbackManager.disconnectFromPlayer(),dialogHelper.close(dlg)}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),dialogHelper.open(dlg).then(function(){"nowplaying"===destination&&embyRouter.showNowPlaying()},emptyCallback)}function onMirrorChange(){playbackManager.enableDisplayMirroring(this.checked)}var currentDisplayInfo;return document.addEventListener("viewbeforeshow",function(){currentDisplayInfo=null}),document.addEventListener("viewshow",function(e){var state=e.detail.state||{},item=state.item;if(item&&item.ServerId)return void mirrorIfEnabled({item:item})}),events.on(appSettings,"change",function(e,name){"displaymirror"===name&&mirrorIfEnabled()}),{show:showPlayerSelection}});
|
|
@ -1 +1 @@
|
|||
define(["actionsheet","datetime","playbackManager","globalize","appSettings","qualityoptions"],function(actionsheet,datetime,playbackManager,globalize,appSettings,qualityoptions){"use strict";function showQualityMenu(player,btn){var videoStream=playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0],videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),menuItems=options.map(function(o){var opt={name:o.name,id:o.bitrate,secondaryText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),selectedId=options.filter(function(o){return o.selected});return selectedId=selectedId.length?selectedId[0].bitrate:null,actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){var bitrate=parseInt(id);bitrate!==selectedId&&playbackManager.setMaxStreamingBitrate({enableAutomaticBitrateDetection:!bitrate,maxBitrate:bitrate},player)})}function getQualitySecondaryText(player){return playbackManager.getPlayerState(player).then(function(state){var videoStream=(playbackManager.enableAutomaticBitrateDetection(player),playbackManager.getMaxStreamingBitrate(player),playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0]),videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),selectedOption=(options.map(function(o){var opt={name:o.name,id:o.bitrate,secondaryText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),options.filter(function(o){return o.selected}));if(!selectedOption.length)return null;selectedOption=selectedOption[0];var text=selectedOption.name;return selectedOption.autoText&&(text+=state.PlayState&&"Transcode"!==state.PlayState.PlayMethod?" - Direct":" "+selectedOption.autoText),text})}function showAspectRatioMenu(player,btn){var currentId=playbackManager.getAspectRatio(player),menuItems=playbackManager.getSupportedAspectRatios(player).map(function(i){return{id:i.id,name:i.name,selected:i.id===currentId}});return actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){return id?(playbackManager.setAspectRatio(id,player),Promise.resolve()):Promise.reject()})}function show(options){var player=options.player;return getQualitySecondaryText(player).then(function(secondaryQualityText){var menuItems=(options.mediaType,[]);if(player.supports&&player.supports("SetAspectRatio")){var currentAspectRatioId=playbackManager.getAspectRatio(player),currentAspectRatio=playbackManager.getSupportedAspectRatios(player).filter(function(i){return i.id===currentAspectRatioId})[0];menuItems.push({name:globalize.translate("sharedcomponents#AspectRatio"),id:"aspectratio",secondaryText:currentAspectRatio?currentAspectRatio.name:null})}return menuItems.push({name:globalize.translate("sharedcomponents#Quality"),id:"quality",secondaryText:secondaryQualityText}),actionsheet.show({items:menuItems,positionTo:options.positionTo}).then(function(id){switch(id){case"quality":return showQualityMenu(player,options.positionTo);case"aspectratio":return showAspectRatioMenu(player,options.positionTo)}return Promise.reject()})})}return{show:show}});
|
||||
define(["actionsheet","datetime","playbackManager","globalize","appSettings","qualityoptions"],function(actionsheet,datetime,playbackManager,globalize,appSettings,qualityoptions){"use strict";function showQualityMenu(player,btn){var videoStream=playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0],videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),menuItems=options.map(function(o){var opt={name:o.name,id:o.bitrate,secondaryText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),selectedId=options.filter(function(o){return o.selected});return selectedId=selectedId.length?selectedId[0].bitrate:null,actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){var bitrate=parseInt(id);bitrate!==selectedId&&playbackManager.setMaxStreamingBitrate({enableAutomaticBitrateDetection:!bitrate,maxBitrate:bitrate},player)})}function showRepeatModeMenu(player,btn){var menuItems=[],currentValue=playbackManager.getRepeatMode(player);return menuItems.push({name:globalize.translate("sharedcomponents#RepeatAll"),id:"RepeatAll",selected:"RepeatAll"===currentValue}),menuItems.push({name:globalize.translate("sharedcomponents#RepeatOne"),id:"RepeatOne",selected:"RepeatOne"===currentValue}),menuItems.push({name:globalize.translate("sharedcomponents#None"),id:"RepeatNone",selected:"RepeatNone"===currentValue}),actionsheet.show({items:menuItems,positionTo:btn}).then(function(mode){mode&&playbackManager.setRepeatMode(mode,player)})}function getQualitySecondaryText(player){return playbackManager.getPlayerState(player).then(function(state){var videoStream=(playbackManager.enableAutomaticBitrateDetection(player),playbackManager.getMaxStreamingBitrate(player),playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0]),videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions({currentMaxBitrate:playbackManager.getMaxStreamingBitrate(player),isAutomaticBitrateEnabled:playbackManager.enableAutomaticBitrateDetection(player),videoWidth:videoWidth,enableAuto:!0}),selectedOption=(options.map(function(o){var opt={name:o.name,id:o.bitrate,secondaryText:o.secondaryText};return o.selected&&(opt.selected=!0),opt}),options.filter(function(o){return o.selected}));if(!selectedOption.length)return null;selectedOption=selectedOption[0];var text=selectedOption.name;return selectedOption.autoText&&(text+=state.PlayState&&"Transcode"!==state.PlayState.PlayMethod?" - Direct":" "+selectedOption.autoText),text})}function showAspectRatioMenu(player,btn){var currentId=playbackManager.getAspectRatio(player),menuItems=playbackManager.getSupportedAspectRatios(player).map(function(i){return{id:i.id,name:i.name,selected:i.id===currentId}});return actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){return id?(playbackManager.setAspectRatio(id,player),Promise.resolve()):Promise.reject()})}function show(options){var player=options.player,supportedCommands=playbackManager.getSupportedCommands(player);return getQualitySecondaryText(player).then(function(secondaryQualityText){var menuItems=(options.mediaType,[]);if(supportedCommands.indexOf("SetAspectRatio")!==-1){var currentAspectRatioId=playbackManager.getAspectRatio(player),currentAspectRatio=playbackManager.getSupportedAspectRatios(player).filter(function(i){return i.id===currentAspectRatioId})[0];menuItems.push({name:globalize.translate("sharedcomponents#AspectRatio"),id:"aspectratio",secondaryText:currentAspectRatio?currentAspectRatio.name:null})}menuItems.push({name:globalize.translate("sharedcomponents#Quality"),id:"quality",secondaryText:secondaryQualityText});var repeatMode=playbackManager.getRepeatMode(player);return supportedCommands.indexOf("SetRepeatMode")!==-1&&playbackManager.currentMediaSource(player).RunTimeTicks&&menuItems.push({name:globalize.translate("sharedcomponents#RepeatMode"),id:"repeatmode",secondaryText:"RepeatNone"===repeatMode?globalize.translate("sharedcomponents#None"):globalize.translate("sharedcomponents#"+repeatMode)}),actionsheet.show({items:menuItems,positionTo:options.positionTo}).then(function(id){switch(id){case"quality":return showQualityMenu(player,options.positionTo);case"aspectratio":return showAspectRatioMenu(player,options.positionTo);case"repeatmode":return showRepeatModeMenu(player,options.positionTo)}return Promise.reject()})})}return{show:show}});
|
Loading…
Add table
Add a link
Reference in a new issue