diff --git a/dashboard-ui/addplugin.html b/dashboard-ui/addplugin.html index ac27238180..df28ceaae9 100644 --- a/dashboard-ui/addplugin.html +++ b/dashboard-ui/addplugin.html @@ -1,6 +1,6 @@ 
-
+

${MessagePremiumPluginRequiresMembership}

-

${LinkLearnMoreAboutSubscription}

+

${LinkLearnMoreAboutSubscription}

diff --git a/dashboard-ui/appservices.html b/dashboard-ui/appservices.html index 660d760d51..45e713bd62 100644 --- a/dashboard-ui/appservices.html +++ b/dashboard-ui/appservices.html @@ -1,6 +1,6 @@ 
-
+
${HeaderInstalledServices}
diff --git a/dashboard-ui/autoorganizelog.html b/dashboard-ui/autoorganizelog.html index 714114a68e..694687f9e2 100644 --- a/dashboard-ui/autoorganizelog.html +++ b/dashboard-ui/autoorganizelog.html @@ -1,5 +1,5 @@ 
-
+
diff --git a/dashboard-ui/autoorganizesmart.html b/dashboard-ui/autoorganizesmart.html index 335f501369..7fb9fcdc86 100644 --- a/dashboard-ui/autoorganizesmart.html +++ b/dashboard-ui/autoorganizesmart.html @@ -1,6 +1,6 @@ 
-
+
diff --git a/dashboard-ui/autoorganizetv.html b/dashboard-ui/autoorganizetv.html index 4d6eccfbf7..e834fb24cc 100644 --- a/dashboard-ui/autoorganizetv.html +++ b/dashboard-ui/autoorganizetv.html @@ -1,5 +1,5 @@ 
-
+
diff --git a/dashboard-ui/bower_components/emby-apiclient/apiclient.js b/dashboard-ui/bower_components/emby-apiclient/apiclient.js index 8bc0109b37..c19c8d84aa 100644 --- a/dashboard-ui/bower_components/emby-apiclient/apiclient.js +++ b/dashboard-ui/bower_components/emby-apiclient/apiclient.js @@ -1,2 +1,2 @@ -define(["events"],function(events){"use strict";return function(serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio){function redetectBitrate(){stopBitrateDetection(),self.accessToken()&&self.enableAutomaticBitrateDetection!==!1&&setTimeout(redetectBitrateInternal,6e3)}function redetectBitrateInternal(){self.detectBitrate()}function stopBitrateDetection(){detectTimeout&&clearTimeout(detectTimeout)}function onFetchFail(url,response){events.trigger(self,"requestfail",[{url:url,status:response.status,errorCode:response.headers?response.headers.get("X-Application-Error-Code"):null}])}function getFetchPromise(request){var headers=request.headers||{};"json"===request.dataType&&(headers.accept="application/json");var fetchRequest={headers:headers,method:request.type,credentials:"same-origin"},contentType=request.contentType;return request.data&&("string"==typeof request.data?fetchRequest.body=request.data:(fetchRequest.body=paramsToString(request.data),contentType=contentType||"application/x-www-form-urlencoded; charset=UTF-8")),contentType&&(headers["Content-Type"]=contentType),request.timeout?fetchWithTimeout(request.url,fetchRequest,request.timeout):fetch(request.url,fetchRequest)}function fetchWithTimeout(url,options,timeoutMs){return new Promise(function(resolve,reject){var timeout=setTimeout(reject,timeoutMs);options=options||{},options.credentials="same-origin",fetch(url,options).then(function(response){clearTimeout(timeout),resolve(response)},function(error){clearTimeout(timeout),reject(error)})})}function paramsToString(params){var values=[];for(var key in params){var value=params[key];null!==value&&void 0!==value&&""!==value&&values.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}return values.join("&")}function switchConnectionMode(connectionMode){var currentServerInfo=self.serverInfo(),newConnectionMode=connectionMode;return newConnectionMode--,newConnectionMode<0&&(newConnectionMode=MediaBrowser.ConnectionMode.Manual),MediaBrowser.ServerInfo.getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:(newConnectionMode--,newConnectionMode<0&&(newConnectionMode=MediaBrowser.ConnectionMode.Manual),MediaBrowser.ServerInfo.getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:connectionMode)}function tryReconnectInternal(resolve,reject,connectionMode,currentRetryCount){connectionMode=switchConnectionMode(connectionMode);var url=MediaBrowser.ServerInfo.getServerAddress(self.serverInfo(),connectionMode);console.log("Attempting reconnection to "+url);var timeout=connectionMode===MediaBrowser.ConnectionMode.Local?7e3:15e3;fetchWithTimeout(url+"/system/info/public",{method:"GET",accept:"application/json"},timeout).then(function(){console.log("Reconnect succeeded to "+url),self.serverInfo().LastConnectionMode=connectionMode,self.serverAddress(url),resolve()},function(){if(console.log("Reconnect attempt failed to "+url),currentRetryCount<5){var newConnectionMode=switchConnectionMode(connectionMode);setTimeout(function(){tryReconnectInternal(resolve,reject,newConnectionMode,currentRetryCount+1)},300)}else reject()})}function tryReconnect(){return new Promise(function(resolve,reject){setTimeout(function(){tryReconnectInternal(resolve,reject,self.serverInfo().LastConnectionMode,0)},300)})}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function onWebSocketMessage(msg){if("UserDeleted"===msg.MessageType)currentUser=null;else if("UserUpdated"===msg.MessageType||"UserConfigurationUpdated"===msg.MessageType){var user=msg.Data;user.Id===self.getCurrentUserId()&&(currentUser=null)}events.trigger(self,"websocketmessage",[msg])}function normalizeReturnBitrate(bitrate){if(!bitrate)return lastDetectedBitrate?lastDetectedBitrate:Promise.reject();var result=Math.round(.8*bitrate);return lastDetectedBitrate=result,lastDetectedBitrateTime=(new Date).getTime(),result}function detectBitrateInternal(tests,index,currentBitrate){if(index>=tests.length)return normalizeReturnBitrate(currentBitrate);var test=tests[index];return self.getDownloadSpeed(test.bytes).then(function(bitrate){return bitrate1800?self.ajax({type:"POST",url:self.getUrl("LiveTv/Programs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}):self.ajax({type:"GET",url:self.getUrl("LiveTv/Programs",options),dataType:"json"})},self.getLiveTvRecommendedPrograms=function(options){return options=options||{},self.ajax({type:"GET",url:self.getUrl("LiveTv/Programs/Recommended",options),dataType:"json"})},self.getLiveTvRecordings=function(options){var url=self.getUrl("LiveTv/Recordings",options||{});return self.getJSON(url)},self.getLiveTvRecordingSeries=function(options){var url=self.getUrl("LiveTv/Recordings/Series",options||{});return self.getJSON(url)},self.getLiveTvRecordingGroups=function(options){var url=self.getUrl("LiveTv/Recordings/Groups",options||{});return self.getJSON(url)},self.getLiveTvRecordingGroup=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/Recordings/Groups/"+id);return self.getJSON(url)},self.getLiveTvRecording=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=self.getUrl("LiveTv/Recordings/"+id,options);return self.getJSON(url)},self.getLiveTvProgram=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=self.getUrl("LiveTv/Programs/"+id,options);return self.getJSON(url)},self.deleteLiveTvRecording=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/Recordings/"+id);return self.ajax({type:"DELETE",url:url})},self.cancelLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/Timers/"+id);return self.ajax({type:"DELETE",url:url})},self.getLiveTvTimers=function(options){var url=self.getUrl("LiveTv/Timers",options||{});return self.getJSON(url)},self.getLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/Timers/"+id);return self.getJSON(url)},self.getNewLiveTvTimerDefaults=function(options){options=options||{};var url=self.getUrl("LiveTv/Timers/Defaults",options);return self.getJSON(url)},self.createLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=self.getUrl("LiveTv/Timers");return self.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},self.updateLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=self.getUrl("LiveTv/Timers/"+item.Id);return self.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},self.resetLiveTvTuner=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/Tuners/"+id+"/Reset");return self.ajax({type:"POST",url:url})},self.getLiveTvSeriesTimers=function(options){var url=self.getUrl("LiveTv/SeriesTimers",options||{});return self.getJSON(url)},self.getFileOrganizationResults=function(options){var url=self.getUrl("Library/FileOrganization",options||{});return self.getJSON(url)},self.deleteOriginalFileFromOrganizationResult=function(id){var url=self.getUrl("Library/FileOrganizations/"+id+"/File");return self.ajax({type:"DELETE",url:url})},self.clearOrganizationLog=function(){var url=self.getUrl("Library/FileOrganizations");return self.ajax({type:"DELETE",url:url})},self.performOrganization=function(id){var url=self.getUrl("Library/FileOrganizations/"+id+"/Organize");return self.ajax({type:"POST",url:url})},self.performEpisodeOrganization=function(id,options){var url=self.getUrl("Library/FileOrganizations/"+id+"/Episode/Organize");return self.ajax({type:"POST",url:url,data:JSON.stringify(options),contentType:"application/json"})},self.getLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/SeriesTimers/"+id);return self.getJSON(url)},self.cancelLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=self.getUrl("LiveTv/SeriesTimers/"+id);return self.ajax({type:"DELETE",url:url})},self.createLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=self.getUrl("LiveTv/SeriesTimers");return self.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},self.updateLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=self.getUrl("LiveTv/SeriesTimers/"+item.Id);return self.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},self.getRegistrationInfo=function(feature){var url=self.getUrl("Registrations/"+feature);return self.getJSON(url)},self.getSystemInfo=function(){var url=self.getUrl("System/Info");return self.getJSON(url)},self.getPublicSystemInfo=function(){var url=self.getUrl("System/Info/Public");return self.getJSON(url,!1)},self.getInstantMixFromItem=function(itemId,options){var url=self.getUrl("Items/"+itemId+"/InstantMix",options);return self.getJSON(url)},self.getEpisodes=function(itemId,options){var url=self.getUrl("Shows/"+itemId+"/Episodes",options);return self.getJSON(url)},self.getDisplayPreferences=function(id,userId,app){var url=self.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return self.getJSON(url)},self.updateDisplayPreferences=function(id,obj,userId,app){var url=self.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return self.ajax({type:"POST",url:url,data:JSON.stringify(obj),contentType:"application/json"})},self.getSeasons=function(itemId,options){var url=self.getUrl("Shows/"+itemId+"/Seasons",options);return self.getJSON(url)},self.getSimilarItems=function(itemId,options){var url=self.getUrl("Items/"+itemId+"/Similar",options);return self.getJSON(url)},self.getCultures=function(){var url=self.getUrl("Localization/cultures");return self.getJSON(url)},self.getCountries=function(){var url=self.getUrl("Localization/countries");return self.getJSON(url)},self.getPluginSecurityInfo=function(){var url=self.getUrl("Plugins/SecurityInfo");return self.getJSON(url)},self.getPlaybackInfo=function(itemId,options,deviceProfile){var postData={DeviceProfile:deviceProfile};return self.ajax({url:self.getUrl("Items/"+itemId+"/PlaybackInfo",options),type:"POST",data:JSON.stringify(postData),contentType:"application/json",dataType:"json"})},self.getIntros=function(itemId){return self.getJSON(self.getUrl("Users/"+self.getCurrentUserId()+"/Items/"+itemId+"/Intros"))},self.getDirectoryContents=function(path,options){if(!path)throw new Error("null path");if("string"!=typeof path)throw new Error("invalid path");options=options||{},options.path=path;var url=self.getUrl("Environment/DirectoryContents",options);return self.getJSON(url)},self.getNetworkShares=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=self.getUrl("Environment/NetworkShares",options);return self.getJSON(url)},self.getParentPath=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=self.getUrl("Environment/ParentPath",options);return self.ajax({type:"GET",url:url,dataType:"text"})},self.getDrives=function(){var url=self.getUrl("Environment/Drives");return self.getJSON(url)},self.getNetworkDevices=function(){var url=self.getUrl("Environment/NetworkDevices");return self.getJSON(url)},self.cancelPackageInstallation=function(installationId){if(!installationId)throw new Error("null installationId");var url=self.getUrl("Packages/Installing/"+installationId);return self.ajax({type:"DELETE",url:url})},self.refreshItem=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=self.getUrl("Items/"+itemId+"/Refresh",options||{});return self.ajax({type:"POST",url:url})},self.installPlugin=function(name,guid,updateClass,version){if(!name)throw new Error("null name");if(!updateClass)throw new Error("null updateClass");var options={updateClass:updateClass,AssemblyGuid:guid};version&&(options.version=version);var url=self.getUrl("Packages/Installed/"+name,options);return self.ajax({type:"POST",url:url})},self.restartServer=function(){var url=self.getUrl("System/Restart");return self.ajax({type:"POST",url:url})},self.shutdownServer=function(){var url=self.getUrl("System/Shutdown");return self.ajax({type:"POST",url:url})},self.getPackageInfo=function(name,guid){if(!name)throw new Error("null name");var options={AssemblyGuid:guid},url=self.getUrl("Packages/"+name,options);return self.getJSON(url)},self.getAvailableApplicationUpdate=function(){var url=self.getUrl("Packages/Updates",{PackageType:"System"});return self.getJSON(url)},self.getAvailablePluginUpdates=function(){var url=self.getUrl("Packages/Updates",{PackageType:"UserInstalled"});return self.getJSON(url)},self.getVirtualFolders=function(){var url="Library/VirtualFolders";return url=self.getUrl(url),self.getJSON(url)},self.getPhysicalPaths=function(){var url=self.getUrl("Library/PhysicalPaths");return self.getJSON(url)},self.getServerConfiguration=function(){var url=self.getUrl("System/Configuration");return self.getJSON(url)},self.getDevicesOptions=function(){var url=self.getUrl("System/Configuration/devices");return self.getJSON(url)},self.getContentUploadHistory=function(){var url=self.getUrl("Devices/CameraUploads",{DeviceId:self.deviceId()});return self.getJSON(url)},self.getNamedConfiguration=function(name){var url=self.getUrl("System/Configuration/"+name);return self.getJSON(url)},self.getScheduledTasks=function(options){options=options||{};var url=self.getUrl("ScheduledTasks",options);return self.getJSON(url)},self.startScheduledTask=function(id){if(!id)throw new Error("null id");var url=self.getUrl("ScheduledTasks/Running/"+id);return self.ajax({type:"POST",url:url})},self.getScheduledTask=function(id){if(!id)throw new Error("null id");var url=self.getUrl("ScheduledTasks/"+id);return self.getJSON(url)},self.getNextUpEpisodes=function(options){var url=self.getUrl("Shows/NextUp",options);return self.getJSON(url)},self.stopScheduledTask=function(id){if(!id)throw new Error("null id");var url=self.getUrl("ScheduledTasks/Running/"+id);return self.ajax({type:"DELETE",url:url})},self.getPluginConfiguration=function(id){if(!id)throw new Error("null Id");var url=self.getUrl("Plugins/"+id+"/Configuration");return self.getJSON(url)},self.getAvailablePlugins=function(options){options=options||{},options.PackageType="UserInstalled";var url=self.getUrl("Packages",options);return self.getJSON(url)},self.uninstallPlugin=function(id){if(!id)throw new Error("null Id");var url=self.getUrl("Plugins/"+id);return self.ajax({type:"DELETE",url:url})},self.removeVirtualFolder=function(name,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders";return url=self.getUrl(url,{refreshLibrary:!!refreshLibrary,name:name}),self.ajax({type:"DELETE",url:url})},self.addVirtualFolder=function(name,type,refreshLibrary,libraryOptions){if(!name)throw new Error("null name");var options={};type&&(options.collectionType=type),options.refreshLibrary=!!refreshLibrary,options.name=name;var url="Library/VirtualFolders";return url=self.getUrl(url,options),self.ajax({type:"POST",url:url,data:JSON.stringify({LibraryOptions:libraryOptions}),contentType:"application/json"})},self.updateVirtualFolderOptions=function(id,libraryOptions){if(!id)throw new Error("null name");var url="Library/VirtualFolders/LibraryOptions";return url=self.getUrl(url),self.ajax({type:"POST",url:url,data:JSON.stringify({Id:id,LibraryOptions:libraryOptions}),contentType:"application/json"})},self.renameVirtualFolder=function(name,newName,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders/Name";return url=self.getUrl(url,{refreshLibrary:!!refreshLibrary,newName:newName,name:name}),self.ajax({type:"POST",url:url})},self.addMediaPath=function(virtualFolderName,mediaPath,networkSharePath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths",pathInfo={Path:mediaPath};return networkSharePath&&(pathInfo.NetworkPath=networkSharePath),url=self.getUrl(url,{refreshLibrary:!!refreshLibrary}),self.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},self.updateMediaPath=function(virtualFolderName,pathInfo){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!pathInfo)throw new Error("null pathInfo");var url="Library/VirtualFolders/Paths/Update";return url=self.getUrl(url),self.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},self.removeMediaPath=function(virtualFolderName,mediaPath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths";return url=self.getUrl(url,{refreshLibrary:!!refreshLibrary,path:mediaPath,name:virtualFolderName}),self.ajax({type:"DELETE",url:url})},self.deleteUser=function(id){if(!id)throw new Error("null id");var url=self.getUrl("Users/"+id);return self.ajax({type:"DELETE",url:url})},self.deleteUserImage=function(userId,imageType,imageIndex){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");var url=self.getUrl("Users/"+userId+"/Images/"+imageType);return null!=imageIndex&&(url+="/"+imageIndex),self.ajax({type:"DELETE",url:url})},self.deleteItemImage=function(itemId,imageType,imageIndex){if(!imageType)throw new Error("null imageType");var url=self.getUrl("Items/"+itemId+"/Images");return url+="/"+imageType,null!=imageIndex&&(url+="/"+imageIndex),self.ajax({type:"DELETE",url:url})},self.deleteItem=function(itemId){if(!itemId)throw new Error("null itemId");var url=self.getUrl("Items/"+itemId);return self.ajax({type:"DELETE",url:url})},self.stopActiveEncodings=function(playSessionId){var options={deviceId:deviceId};playSessionId&&(options.PlaySessionId=playSessionId);var url=self.getUrl("Videos/ActiveEncodings",options);return self.ajax({type:"DELETE",url:url})},self.reportCapabilities=function(options){var url=self.getUrl("Sessions/Capabilities/Full");return self.ajax({type:"POST",url:url,data:JSON.stringify(options),contentType:"application/json"})},self.updateItemImageIndex=function(itemId,imageType,imageIndex,newIndex){if(!imageType)throw new Error("null imageType");var options={newIndex:newIndex},url=self.getUrl("Items/"+itemId+"/Images/"+imageType+"/"+imageIndex+"/Index",options);return self.ajax({type:"POST",url:url})},self.getItemImageInfos=function(itemId){var url=self.getUrl("Items/"+itemId+"/Images");return self.getJSON(url)},self.getCriticReviews=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=self.getUrl("Items/"+itemId+"/CriticReviews",options);return self.getJSON(url)},self.getItemDownloadUrl=function(itemId){if(!itemId)throw new Error("itemId cannot be empty");var url="Items/"+itemId+"/Download";return self.getUrl(url,{api_key:self.accessToken()})},self.getSessions=function(options){var url=self.getUrl("Sessions",options);return self.getJSON(url)},self.uploadUserImage=function(userId,imageType,file){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1],url=self.getUrl("Users/"+userId+"/Images/"+imageType);self.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1) -}).then(function(result){resolve(result)},function(){reject()})},reader.readAsDataURL(file)})},self.uploadItemImage=function(itemId,imageType,file){if(!itemId)throw new Error("null itemId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var url=self.getUrl("Items/"+itemId+"/Images");return url+="/"+imageType,new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1];self.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(function(result){resolve(result)},function(){reject()})},reader.readAsDataURL(file)})},self.getInstalledPlugins=function(){var options={},url=self.getUrl("Plugins",options);return self.getJSON(url)},self.getUser=function(id){if(!id)throw new Error("Must supply a userId");var url=self.getUrl("Users/"+id);return self.getJSON(url)},self.getStudio=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=self.getUrl("Studios/"+self.encodeName(name),options);return self.getJSON(url)},self.getGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=self.getUrl("Genres/"+self.encodeName(name),options);return self.getJSON(url)},self.getMusicGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=self.getUrl("MusicGenres/"+self.encodeName(name),options);return self.getJSON(url)},self.getGameGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=self.getUrl("GameGenres/"+self.encodeName(name),options);return self.getJSON(url)},self.getArtist=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=self.getUrl("Artists/"+self.encodeName(name),options);return self.getJSON(url)},self.getPerson=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=self.getUrl("Persons/"+self.encodeName(name),options);return self.getJSON(url)},self.getPublicUsers=function(){var url=self.getUrl("users/public");return self.ajax({type:"GET",url:url,dataType:"json"},!1)},self.getUsers=function(options){var url=self.getUrl("users",options||{});return self.getJSON(url)},self.getParentalRatings=function(){var url=self.getUrl("Localization/ParentalRatings");return self.getJSON(url)},self.getDefaultImageQuality=function(imageType){return"backdrop"===imageType.toLowerCase()?80:90},self.getUserImageUrl=function(userId,options){if(!userId)throw new Error("null userId");options=options||{};var url="Users/"+userId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(options),delete options.type,delete options.index,self.getUrl(url,options)},self.getImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),options.quality=options.quality||self.getDefaultImageQuality(options.type),self.normalizeImageOptions&&self.normalizeImageOptions(options),delete options.type,delete options.index,self.getUrl(url,options)},self.getScaledImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(options),delete options.type,delete options.index,delete options.minScale,self.getUrl(url,options)},self.getThumbImageUrl=function(item,options){if(!item)throw new Error("null item");return options=options||{},options.imageType="thumb",item.ImageTags&&item.ImageTags.Thumb?(options.tag=item.ImageTags.Thumb,self.getImageUrl(item.Id,options)):item.ParentThumbItemId?(options.tag=item.ImageTags.ParentThumbImageTag,self.getImageUrl(item.ParentThumbItemId,options)):null},self.authenticateUserByName=function(name,password){return new Promise(function(resolve,reject){if(!name)return void reject();var url=self.getUrl("Users/authenticatebyname");require(["cryptojs-sha1","cryptojs-md5"],function(){var postData={Password:CryptoJS.SHA1(password||"").toString(),PasswordMd5:CryptoJS.MD5(password||"").toString(),Username:name};self.ajax({type:"POST",url:url,data:JSON.stringify(postData),dataType:"json",contentType:"application/json"}).then(function(result){self.onAuthenticated&&self.onAuthenticated(self,result),redetectBitrate(),resolve(result)},reject)})})},self.updateUserPassword=function(userId,currentPassword,newPassword){return new Promise(function(resolve,reject){if(!userId)return void reject();var url=self.getUrl("Users/"+userId+"/Password");require(["cryptojs-sha1"],function(){self.ajax({type:"POST",url:url,data:{currentPassword:CryptoJS.SHA1(currentPassword).toString(),newPassword:CryptoJS.SHA1(newPassword).toString()}}).then(resolve,reject)})})},self.updateEasyPassword=function(userId,newPassword){return new Promise(function(resolve,reject){if(!userId)return void reject();var url=self.getUrl("Users/"+userId+"/EasyPassword");require(["cryptojs-sha1"],function(){self.ajax({type:"POST",url:url,data:{newPassword:CryptoJS.SHA1(newPassword).toString()}}).then(resolve,reject)})})},self.resetUserPassword=function(userId){if(!userId)throw new Error("null userId");var url=self.getUrl("Users/"+userId+"/Password"),postData={};return postData.resetPassword=!0,self.ajax({type:"POST",url:url,data:postData})},self.resetEasyPassword=function(userId){if(!userId)throw new Error("null userId");var url=self.getUrl("Users/"+userId+"/EasyPassword"),postData={};return postData.resetPassword=!0,self.ajax({type:"POST",url:url,data:postData})},self.updateServerConfiguration=function(configuration){if(!configuration)throw new Error("null configuration");var url=self.getUrl("System/Configuration");return self.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},self.updateNamedConfiguration=function(name,configuration){if(!configuration)throw new Error("null configuration");var url=self.getUrl("System/Configuration/"+name);return self.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},self.updateItem=function(item){if(!item)throw new Error("null item");var url=self.getUrl("Items/"+item.Id);return self.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},self.updatePluginSecurityInfo=function(info){var url=self.getUrl("Plugins/SecurityInfo");return self.ajax({type:"POST",url:url,data:JSON.stringify(info),contentType:"application/json"})},self.createUser=function(name){var url=self.getUrl("Users/New");return self.ajax({type:"POST",url:url,data:{Name:name},dataType:"json"})},self.updateUser=function(user){if(!user)throw new Error("null user");var url=self.getUrl("Users/"+user.Id);return self.ajax({type:"POST",url:url,data:JSON.stringify(user),contentType:"application/json"})},self.updateUserPolicy=function(userId,policy){if(!userId)throw new Error("null userId");if(!policy)throw new Error("null policy");var url=self.getUrl("Users/"+userId+"/Policy");return self.ajax({type:"POST",url:url,data:JSON.stringify(policy),contentType:"application/json"})},self.updateUserConfiguration=function(userId,configuration){if(!userId)throw new Error("null userId");if(!configuration)throw new Error("null configuration");var url=self.getUrl("Users/"+userId+"/Configuration");return self.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},self.updateScheduledTaskTriggers=function(id,triggers){if(!id)throw new Error("null id");if(!triggers)throw new Error("null triggers");var url=self.getUrl("ScheduledTasks/"+id+"/Triggers");return self.ajax({type:"POST",url:url,data:JSON.stringify(triggers),contentType:"application/json"})},self.updatePluginConfiguration=function(id,configuration){if(!id)throw new Error("null Id");if(!configuration)throw new Error("null configuration");var url=self.getUrl("Plugins/"+id+"/Configuration");return self.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},self.getAncestorItems=function(itemId,userId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=self.getUrl("Items/"+itemId+"/Ancestors",options);return self.getJSON(url)},self.getItems=function(userId,options){var url;return url="string"===(typeof userId).toString().toLowerCase()?self.getUrl("Users/"+userId+"/Items",options):self.getUrl("Items",options),self.getJSON(url)},self.getMovieRecommendations=function(options){return self.getJSON(self.getUrl("Movies/Recommendations",options))},self.getUpcomingEpisodes=function(options){return self.getJSON(self.getUrl("Shows/Upcoming",options))},self.getChannels=function(query){return self.getJSON(self.getUrl("Channels",query||{}))},self.getLatestChannelItems=function(query){return self.getJSON(self.getUrl("Channels/Items/Latest",query))},self.getUserViews=function(options,userId){options=options||{};var url=self.getUrl("Users/"+(userId||self.getCurrentUserId())+"/Views",options);return self.getJSON(url)},self.getArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("Artists",options);return self.getJSON(url)},self.getAlbumArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("Artists/AlbumArtists",options);return self.getJSON(url)},self.getGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("Genres",options);return self.getJSON(url)},self.getMusicGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("MusicGenres",options);return self.getJSON(url)},self.getGameGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("GameGenres",options);return self.getJSON(url)},self.getPeople=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("Persons",options);return self.getJSON(url)},self.getStudios=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=self.getUrl("Studios",options);return self.getJSON(url)},self.getLocalTrailers=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=self.getUrl("Users/"+userId+"/Items/"+itemId+"/LocalTrailers");return self.getJSON(url)},self.getGameSystems=function(){var options={},userId=self.getCurrentUserId();userId&&(options.userId=userId);var url=self.getUrl("Games/SystemSummaries",options);return self.getJSON(url)},self.getAdditionalVideoParts=function(userId,itemId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=self.getUrl("Videos/"+itemId+"/AdditionalParts",options);return self.getJSON(url)},self.getThemeMedia=function(userId,itemId,inherit){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId),options.InheritFromParent=inherit||!1;var url=self.getUrl("Items/"+itemId+"/ThemeMedia",options);return self.getJSON(url)},self.getSearchHints=function(options){var url=self.getUrl("Search/Hints",options);return self.getJSON(url).then(function(result){var serverId=self.serverId();return result.SearchHints.forEach(function(i){i.ServerId=serverId}),result})},self.getSpecialFeatures=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=self.getUrl("Users/"+userId+"/Items/"+itemId+"/SpecialFeatures");return self.getJSON(url)},self.getDateParamValue=function(date){function formatDigit(i){return i<10?"0"+i:i}var d=date;return""+d.getFullYear()+formatDigit(d.getMonth()+1)+formatDigit(d.getDate())+formatDigit(d.getHours())+formatDigit(d.getMinutes())+formatDigit(d.getSeconds())},self.markPlayed=function(userId,itemId,date){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var options={};date&&(options.DatePlayed=self.getDateParamValue(date));var url=self.getUrl("Users/"+userId+"/PlayedItems/"+itemId,options);return self.ajax({type:"POST",url:url,dataType:"json"})},self.markUnplayed=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=self.getUrl("Users/"+userId+"/PlayedItems/"+itemId);return self.ajax({type:"DELETE",url:url,dataType:"json"})},self.updateFavoriteStatus=function(userId,itemId,isFavorite){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=self.getUrl("Users/"+userId+"/FavoriteItems/"+itemId),method=isFavorite?"POST":"DELETE";return self.ajax({type:method,url:url,dataType:"json"})},self.updateUserItemRating=function(userId,itemId,likes){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=self.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating",{likes:likes});return self.ajax({type:"POST",url:url,dataType:"json"})},self.getItemCounts=function(userId){var options={};userId&&(options.userId=userId);var url=self.getUrl("Items/Counts",options);return self.getJSON(url)},self.clearUserItemRating=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=self.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating");return self.ajax({type:"DELETE",url:url,dataType:"json"})},self.reportPlaybackStart=function(options){if(!options)throw new Error("null options");stopBitrateDetection();var url=self.getUrl("Sessions/Playing");return self.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},self.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");if(self.isWebSocketOpen())try{return self.sendWebSocketMessage("ReportPlaybackProgress",JSON.stringify(options)),Promise.resolve()}catch(err){console.log("Error sending playback progress report: "+err)}var url=self.getUrl("Sessions/Playing/Progress");return self.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},self.reportOfflineActions=function(actions){if(!actions)throw new Error("null actions");var url=self.getUrl("Sync/OfflineActions");return self.ajax({type:"POST",data:JSON.stringify(actions),contentType:"application/json",url:url})},self.syncData=function(data){if(!data)throw new Error("null data");var url=self.getUrl("Sync/Data");return self.ajax({type:"POST",data:JSON.stringify(data),contentType:"application/json",url:url,dataType:"json"})},self.getReadySyncItems=function(deviceId){if(!deviceId)throw new Error("null deviceId");var url=self.getUrl("Sync/Items/Ready",{TargetId:deviceId});return self.getJSON(url)},self.reportSyncJobItemTransferred=function(syncJobItemId){if(!syncJobItemId)throw new Error("null syncJobItemId");var url=self.getUrl("Sync/JobItems/"+syncJobItemId+"/Transferred");return self.ajax({type:"POST",url:url})},self.cancelSyncItems=function(itemIds,targetId){if(!itemIds)throw new Error("null itemIds");var url=self.getUrl("Sync/"+(targetId||self.deviceId())+"/Items",{ItemIds:itemIds.join(",")});return self.ajax({type:"DELETE",url:url})},self.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");redetectBitrate();var url=self.getUrl("Sessions/Playing/Stopped");return self.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},self.sendPlayCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=self.getUrl("Sessions/"+sessionId+"/Playing",options);return self.ajax({type:"POST",url:url})},self.sendCommand=function(sessionId,command){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=self.getUrl("Sessions/"+sessionId+"/Command"),ajaxOptions={type:"POST",url:url};return ajaxOptions.data=JSON.stringify(command),ajaxOptions.contentType="application/json",self.ajax(ajaxOptions)},self.sendMessageCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=self.getUrl("Sessions/"+sessionId+"/Message",options);return self.ajax({type:"POST",url:url})},self.sendPlayStateCommand=function(sessionId,command,options){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=self.getUrl("Sessions/"+sessionId+"/Playing/"+command,options||{});return self.ajax({type:"POST",url:url})},self.createPackageReview=function(review){var url=self.getUrl("Packages/Reviews/"+review.id,review);return self.ajax({type:"POST",url:url})};self.getPackageReviews=function(packageId,minRating,maxRating,limit){if(!packageId)throw new Error("null packageId");var options={};minRating&&(options.MinRating=minRating),maxRating&&(options.MaxRating=maxRating),limit&&(options.Limit=limit);var url=self.getUrl("Packages/"+packageId+"/Reviews",options);return self.getJSON(url)};self.getSmartMatchInfos=function(options){options=options||{};var url=self.getUrl("Library/FileOrganizations/SmartMatches",options);return self.ajax({type:"GET",url:url,dataType:"json"})},self.deleteSmartMatchEntries=function(entries){var url=self.getUrl("Library/FileOrganizations/SmartMatches/Delete"),postData={Entries:entries};return self.ajax({type:"POST",url:url,data:JSON.stringify(postData),contentType:"application/json"})},self.createPin=function(){return self.ajax({type:"POST",url:self.getUrl("Auth/Pin"),data:{deviceId:self.deviceId(),appName:self.appName()},dataType:"json"})},self.getLatestItems=function(options){return options=options||{},self.getJSON(self.getUrl("Users/"+self.getCurrentUserId()+"/Items/Latest",options))},self.exchangePin=function(pinInfo){return exchangePin(pinInfo).then(function(result){return self.onAuthenticated&&self.onAuthenticated(self,result),result})}}}); \ No newline at end of file +define(["events"],function(events){"use strict";function redetectBitrate(instance){stopBitrateDetection(instance),instance.accessToken()&&instance.enableAutomaticBitrateDetection!==!1&&setTimeout(redetectBitrateInternal.bind(instance),6e3)}function redetectBitrateInternal(){this.accessToken()&&this.detectBitrate()}function stopBitrateDetection(instance){instance.detectTimeout&&clearTimeout(instance.detectTimeout)}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function onFetchFail(instance,url,response){events.trigger(instance,"requestfail",[{url:url,status:response.status,errorCode:response.headers?response.headers.get("X-Application-Error-Code"):null}])}function paramsToString(params){var values=[];for(var key in params){var value=params[key];null!==value&&void 0!==value&&""!==value&&values.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}return values.join("&")}function fetchWithTimeout(url,options,timeoutMs){return new Promise(function(resolve,reject){var timeout=setTimeout(reject,timeoutMs);options=options||{},options.credentials="same-origin",fetch(url,options).then(function(response){clearTimeout(timeout),resolve(response)},function(error){clearTimeout(timeout),reject(error)})})}function getFetchPromise(request){var headers=request.headers||{};"json"===request.dataType&&(headers.accept="application/json");var fetchRequest={headers:headers,method:request.type,credentials:"same-origin"},contentType=request.contentType;return request.data&&("string"==typeof request.data?fetchRequest.body=request.data:(fetchRequest.body=paramsToString(request.data),contentType=contentType||"application/x-www-form-urlencoded; charset=UTF-8")),contentType&&(headers["Content-Type"]=contentType),request.timeout?fetchWithTimeout(request.url,fetchRequest,request.timeout):fetch(request.url,fetchRequest)}function ApiClient(serverAddress,appName,appVersion,deviceName,deviceId,devicePixelRatio){if(!serverAddress)throw new Error("Must supply a serverAddress");console.log("ApiClient serverAddress: "+serverAddress),console.log("ApiClient appName: "+appName),console.log("ApiClient appVersion: "+appVersion),console.log("ApiClient deviceName: "+deviceName),console.log("ApiClient deviceId: "+deviceId),this._serverInfo={},this._serverAddress=serverAddress,this._deviceId=deviceId,this._deviceName=deviceName,this._appName=appName,this._appVersion=appVersion}function switchConnectionMode(instance,connectionMode){var currentServerInfo=instance.serverInfo(),newConnectionMode=connectionMode;return newConnectionMode--,newConnectionMode<0&&(newConnectionMode=MediaBrowser.ConnectionMode.Manual),MediaBrowser.ServerInfo.getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:(newConnectionMode--,newConnectionMode<0&&(newConnectionMode=MediaBrowser.ConnectionMode.Manual),MediaBrowser.ServerInfo.getServerAddress(currentServerInfo,newConnectionMode)?newConnectionMode:connectionMode)}function tryReconnectInternal(instance,resolve,reject,connectionMode,currentRetryCount){connectionMode=switchConnectionMode(instance,connectionMode);var url=MediaBrowser.ServerInfo.getServerAddress(instance.serverInfo(),connectionMode);console.log("Attempting reconnection to "+url);var timeout=connectionMode===MediaBrowser.ConnectionMode.Local?7e3:15e3;fetchWithTimeout(url+"/system/info/public",{method:"GET",accept:"application/json"},timeout).then(function(){console.log("Reconnect succeeded to "+url),instance.serverInfo().LastConnectionMode=connectionMode,instance.serverAddress(url),resolve()},function(){if(console.log("Reconnect attempt failed to "+url),currentRetryCount<5){var newConnectionMode=switchConnectionMode(instance,connectionMode);setTimeout(function(){tryReconnectInternal(instance,resolve,reject,newConnectionMode,currentRetryCount+1)},300)}else reject()})}function tryReconnect(instance){return new Promise(function(resolve,reject){setTimeout(function(){tryReconnectInternal(instance,resolve,reject,instance.serverInfo().LastConnectionMode,0)},300)})}function onWebSocketMessage(instance,msg){if("UserDeleted"===msg.MessageType)instance._currentUser=null;else if("UserUpdated"===msg.MessageType||"UserConfigurationUpdated"===msg.MessageType){var user=msg.Data;user.Id===instance.getCurrentUserId()&&(instance._currentUser=null)}events.trigger(instance,"websocketmessage",[msg])}function normalizeReturnBitrate(instance,bitrate){if(!bitrate)return instance.lastDetectedBitrate?instance.lastDetectedBitrate:Promise.reject();var result=Math.round(.8*bitrate);return instance.lastDetectedBitrate=result,instance.lastDetectedBitrateTime=(new Date).getTime(),result}function detectBitrateInternal(instance,tests,index,currentBitrate){if(index>=tests.length)return normalizeReturnBitrate(instance,currentBitrate);var test=tests[index];return instance.getDownloadSpeed(test.bytes).then(function(bitrate){return bitrate1800?this.ajax({type:"POST",url:this.getUrl("LiveTv/Programs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}):this.ajax({type:"GET",url:this.getUrl("LiveTv/Programs",options),dataType:"json"})},ApiClient.prototype.getLiveTvRecommendedPrograms=function(options){return options=options||{},this.ajax({type:"GET",url:this.getUrl("LiveTv/Programs/Recommended",options),dataType:"json"})},ApiClient.prototype.getLiveTvRecordings=function(options){var url=this.getUrl("LiveTv/Recordings",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingSeries=function(options){var url=this.getUrl("LiveTv/Recordings/Series",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingGroups=function(options){var url=this.getUrl("LiveTv/Recordings/Groups",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvRecordingGroup=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Recordings/Groups/"+id);return this.getJSON(url)},ApiClient.prototype.getLiveTvRecording=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Recordings/"+id,options);return this.getJSON(url)},ApiClient.prototype.getLiveTvProgram=function(id,userId){if(!id)throw new Error("null id");var options={};userId&&(options.userId=userId);var url=this.getUrl("LiveTv/Programs/"+id,options);return this.getJSON(url)},ApiClient.prototype.deleteLiveTvRecording=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Recordings/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.cancelLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Timers/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.getLiveTvTimers=function(options){var url=this.getUrl("LiveTv/Timers",options||{});return this.getJSON(url)},ApiClient.prototype.getLiveTvTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Timers/"+id);return this.getJSON(url)},ApiClient.prototype.getNewLiveTvTimerDefaults=function(options){options=options||{};var url=this.getUrl("LiveTv/Timers/Defaults",options);return this.getJSON(url)},ApiClient.prototype.createLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/Timers");return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updateLiveTvTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/Timers/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.resetLiveTvTuner=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/Tuners/"+id+"/Reset");return this.ajax({type:"POST",url:url})},ApiClient.prototype.getLiveTvSeriesTimers=function(options){var url=this.getUrl("LiveTv/SeriesTimers",options||{});return this.getJSON(url)},ApiClient.prototype.getFileOrganizationResults=function(options){var url=this.getUrl("Library/FileOrganization",options||{});return this.getJSON(url)},ApiClient.prototype.deleteOriginalFileFromOrganizationResult=function(id){var url=this.getUrl("Library/FileOrganizations/"+id+"/File");return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.clearOrganizationLog=function(){var url=this.getUrl("Library/FileOrganizations");return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.performOrganization=function(id){var url=this.getUrl("Library/FileOrganizations/"+id+"/Organize");return this.ajax({type:"POST",url:url})},ApiClient.prototype.performEpisodeOrganization=function(id,options){var url=this.getUrl("Library/FileOrganizations/"+id+"/Episode/Organize");return this.ajax({type:"POST",url:url,data:JSON.stringify(options),contentType:"application/json"})},ApiClient.prototype.getLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/SeriesTimers/"+id);return this.getJSON(url)},ApiClient.prototype.cancelLiveTvSeriesTimer=function(id){if(!id)throw new Error("null id");var url=this.getUrl("LiveTv/SeriesTimers/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.createLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/SeriesTimers");return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updateLiveTvSeriesTimer=function(item){if(!item)throw new Error("null item");var url=this.getUrl("LiveTv/SeriesTimers/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.getRegistrationInfo=function(feature){var url=this.getUrl("Registrations/"+feature);return this.getJSON(url)},ApiClient.prototype.getSystemInfo=function(){var url=this.getUrl("System/Info");return this.getJSON(url)},ApiClient.prototype.getPublicSystemInfo=function(){var url=this.getUrl("System/Info/Public");return this.getJSON(url,!1)},ApiClient.prototype.getInstantMixFromItem=function(itemId,options){var url=this.getUrl("Items/"+itemId+"/InstantMix",options);return this.getJSON(url)},ApiClient.prototype.getEpisodes=function(itemId,options){var url=this.getUrl("Shows/"+itemId+"/Episodes",options);return this.getJSON(url)},ApiClient.prototype.getDisplayPreferences=function(id,userId,app){var url=this.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return this.getJSON(url)},ApiClient.prototype.updateDisplayPreferences=function(id,obj,userId,app){var url=this.getUrl("DisplayPreferences/"+id,{userId:userId,client:app});return this.ajax({type:"POST",url:url,data:JSON.stringify(obj),contentType:"application/json"})},ApiClient.prototype.getSeasons=function(itemId,options){var url=this.getUrl("Shows/"+itemId+"/Seasons",options);return this.getJSON(url)},ApiClient.prototype.getSimilarItems=function(itemId,options){var url=this.getUrl("Items/"+itemId+"/Similar",options);return this.getJSON(url)},ApiClient.prototype.getCultures=function(){var url=this.getUrl("Localization/cultures");return this.getJSON(url)},ApiClient.prototype.getCountries=function(){var url=this.getUrl("Localization/countries");return this.getJSON(url)},ApiClient.prototype.getPluginSecurityInfo=function(){var url=this.getUrl("Plugins/SecurityInfo");return this.getJSON(url)},ApiClient.prototype.getPlaybackInfo=function(itemId,options,deviceProfile){var postData={DeviceProfile:deviceProfile};return this.ajax({url:this.getUrl("Items/"+itemId+"/PlaybackInfo",options),type:"POST",data:JSON.stringify(postData),contentType:"application/json",dataType:"json"})},ApiClient.prototype.getIntros=function(itemId){return this.getJSON(this.getUrl("Users/"+this.getCurrentUserId()+"/Items/"+itemId+"/Intros"))},ApiClient.prototype.getDirectoryContents=function(path,options){if(!path)throw new Error("null path");if("string"!=typeof path)throw new Error("invalid path");options=options||{},options.path=path;var url=this.getUrl("Environment/DirectoryContents",options);return this.getJSON(url)},ApiClient.prototype.getNetworkShares=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=this.getUrl("Environment/NetworkShares",options);return this.getJSON(url)},ApiClient.prototype.getParentPath=function(path){if(!path)throw new Error("null path");var options={};options.path=path;var url=this.getUrl("Environment/ParentPath",options);return this.ajax({type:"GET",url:url,dataType:"text"})},ApiClient.prototype.getDrives=function(){var url=this.getUrl("Environment/Drives");return this.getJSON(url)},ApiClient.prototype.getNetworkDevices=function(){var url=this.getUrl("Environment/NetworkDevices");return this.getJSON(url)},ApiClient.prototype.cancelPackageInstallation=function(installationId){if(!installationId)throw new Error("null installationId");var url=this.getUrl("Packages/Installing/"+installationId);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.refreshItem=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId+"/Refresh",options||{});return this.ajax({type:"POST",url:url})},ApiClient.prototype.installPlugin=function(name,guid,updateClass,version){if(!name)throw new Error("null name");if(!updateClass)throw new Error("null updateClass");var options={updateClass:updateClass,AssemblyGuid:guid};version&&(options.version=version);var url=this.getUrl("Packages/Installed/"+name,options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.restartServer=function(){var url=this.getUrl("System/Restart");return this.ajax({type:"POST",url:url})},ApiClient.prototype.shutdownServer=function(){var url=this.getUrl("System/Shutdown");return this.ajax({type:"POST",url:url})},ApiClient.prototype.getPackageInfo=function(name,guid){if(!name)throw new Error("null name");var options={AssemblyGuid:guid},url=this.getUrl("Packages/"+name,options);return this.getJSON(url)},ApiClient.prototype.getAvailableApplicationUpdate=function(){var url=this.getUrl("Packages/Updates",{PackageType:"System"});return this.getJSON(url)},ApiClient.prototype.getAvailablePluginUpdates=function(){var url=this.getUrl("Packages/Updates",{PackageType:"UserInstalled"});return this.getJSON(url)},ApiClient.prototype.getVirtualFolders=function(){var url="Library/VirtualFolders";return url=this.getUrl(url),this.getJSON(url)},ApiClient.prototype.getPhysicalPaths=function(){var url=this.getUrl("Library/PhysicalPaths");return this.getJSON(url)},ApiClient.prototype.getServerConfiguration=function(){var url=this.getUrl("System/Configuration");return this.getJSON(url)},ApiClient.prototype.getDevicesOptions=function(){var url=this.getUrl("System/Configuration/devices");return this.getJSON(url)},ApiClient.prototype.getContentUploadHistory=function(){var url=this.getUrl("Devices/CameraUploads",{DeviceId:this.deviceId()});return this.getJSON(url)},ApiClient.prototype.getNamedConfiguration=function(name){var url=this.getUrl("System/Configuration/"+name);return this.getJSON(url)},ApiClient.prototype.getScheduledTasks=function(options){options=options||{};var url=this.getUrl("ScheduledTasks",options);return this.getJSON(url)},ApiClient.prototype.startScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/Running/"+id);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/"+id);return this.getJSON(url)},ApiClient.prototype.getNextUpEpisodes=function(options){var url=this.getUrl("Shows/NextUp",options);return this.getJSON(url)},ApiClient.prototype.stopScheduledTask=function(id){if(!id)throw new Error("null id");var url=this.getUrl("ScheduledTasks/Running/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.getPluginConfiguration=function(id){if(!id)throw new Error("null Id");var url=this.getUrl("Plugins/"+id+"/Configuration");return this.getJSON(url)},ApiClient.prototype.getAvailablePlugins=function(options){options=options||{},options.PackageType="UserInstalled";var url=this.getUrl("Packages",options);return this.getJSON(url)},ApiClient.prototype.uninstallPlugin=function(id){if(!id)throw new Error("null Id");var url=this.getUrl("Plugins/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.removeVirtualFolder=function(name,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,name:name}),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.addVirtualFolder=function(name,type,refreshLibrary,libraryOptions){if(!name)throw new Error("null name");var options={};type&&(options.collectionType=type),options.refreshLibrary=!!refreshLibrary,options.name=name;var url="Library/VirtualFolders";return url=this.getUrl(url,options),this.ajax({type:"POST",url:url,data:JSON.stringify({LibraryOptions:libraryOptions}),contentType:"application/json"})},ApiClient.prototype.updateVirtualFolderOptions=function(id,libraryOptions){if(!id)throw new Error("null name");var url="Library/VirtualFolders/LibraryOptions";return url=this.getUrl(url),this.ajax({type:"POST",url:url,data:JSON.stringify({Id:id,LibraryOptions:libraryOptions}),contentType:"application/json"})},ApiClient.prototype.renameVirtualFolder=function(name,newName,refreshLibrary){if(!name)throw new Error("null name");var url="Library/VirtualFolders/Name";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,newName:newName,name:name}),this.ajax({type:"POST",url:url})},ApiClient.prototype.addMediaPath=function(virtualFolderName,mediaPath,networkSharePath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths",pathInfo={Path:mediaPath};return networkSharePath&&(pathInfo.NetworkPath=networkSharePath),url=this.getUrl(url,{refreshLibrary:!!refreshLibrary}),this.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},ApiClient.prototype.updateMediaPath=function(virtualFolderName,pathInfo){if(!virtualFolderName)throw new Error("null virtualFolderName"); +if(!pathInfo)throw new Error("null pathInfo");var url="Library/VirtualFolders/Paths/Update";return url=this.getUrl(url),this.ajax({type:"POST",url:url,data:JSON.stringify({Name:virtualFolderName,PathInfo:pathInfo}),contentType:"application/json"})},ApiClient.prototype.removeMediaPath=function(virtualFolderName,mediaPath,refreshLibrary){if(!virtualFolderName)throw new Error("null virtualFolderName");if(!mediaPath)throw new Error("null mediaPath");var url="Library/VirtualFolders/Paths";return url=this.getUrl(url,{refreshLibrary:!!refreshLibrary,path:mediaPath,name:virtualFolderName}),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteUser=function(id){if(!id)throw new Error("null id");var url=this.getUrl("Users/"+id);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteUserImage=function(userId,imageType,imageIndex){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");var url=this.getUrl("Users/"+userId+"/Images/"+imageType);return null!=imageIndex&&(url+="/"+imageIndex),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteItemImage=function(itemId,imageType,imageIndex){if(!imageType)throw new Error("null imageType");var url=this.getUrl("Items/"+itemId+"/Images");return url+="/"+imageType,null!=imageIndex&&(url+="/"+imageIndex),this.ajax({type:"DELETE",url:url})},ApiClient.prototype.deleteItem=function(itemId){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.stopActiveEncodings=function(playSessionId){var options={deviceId:this.deviceId()};playSessionId&&(options.PlaySessionId=playSessionId);var url=this.getUrl("Videos/ActiveEncodings",options);return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.reportCapabilities=function(options){var url=this.getUrl("Sessions/Capabilities/Full");return this.ajax({type:"POST",url:url,data:JSON.stringify(options),contentType:"application/json"})},ApiClient.prototype.updateItemImageIndex=function(itemId,imageType,imageIndex,newIndex){if(!imageType)throw new Error("null imageType");var options={newIndex:newIndex},url=this.getUrl("Items/"+itemId+"/Images/"+imageType+"/"+imageIndex+"/Index",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getItemImageInfos=function(itemId){var url=this.getUrl("Items/"+itemId+"/Images");return this.getJSON(url)},ApiClient.prototype.getCriticReviews=function(itemId,options){if(!itemId)throw new Error("null itemId");var url=this.getUrl("Items/"+itemId+"/CriticReviews",options);return this.getJSON(url)},ApiClient.prototype.getItemDownloadUrl=function(itemId){if(!itemId)throw new Error("itemId cannot be empty");var url="Items/"+itemId+"/Download";return this.getUrl(url,{api_key:this.accessToken()})},ApiClient.prototype.getSessions=function(options){var url=this.getUrl("Sessions",options);return this.getJSON(url)},ApiClient.prototype.uploadUserImage=function(userId,imageType,file){if(!userId)throw new Error("null userId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var instance=this;return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1],url=instance.getUrl("Users/"+userId+"/Images/"+imageType);instance.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(resolve,reject)},reader.readAsDataURL(file)})},ApiClient.prototype.uploadItemImage=function(itemId,imageType,file){if(!itemId)throw new Error("null itemId");if(!imageType)throw new Error("null imageType");if(!file)throw new Error("File must be an image.");if("image/png"!==file.type&&"image/jpeg"!==file.type&&"image/jpeg"!==file.type)throw new Error("File must be an image.");var url=this.getUrl("Items/"+itemId+"/Images");url+="/"+imageType;var instance=this;return new Promise(function(resolve,reject){var reader=new FileReader;reader.onerror=function(){reject()},reader.onabort=function(){reject()},reader.onload=function(e){var data=e.target.result.split(",")[1];instance.ajax({type:"POST",url:url,data:data,contentType:"image/"+file.name.substring(file.name.lastIndexOf(".")+1)}).then(resolve,reject)},reader.readAsDataURL(file)})},ApiClient.prototype.getInstalledPlugins=function(){var options={},url=this.getUrl("Plugins",options);return this.getJSON(url)},ApiClient.prototype.getUser=function(id){if(!id)throw new Error("Must supply a userId");var url=this.getUrl("Users/"+id);return this.getJSON(url)},ApiClient.prototype.getStudio=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Studios/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Genres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getMusicGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("MusicGenres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getGameGenre=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("GameGenres/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getArtist=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Artists/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getPerson=function(name,userId){if(!name)throw new Error("null name");var options={};userId&&(options.userId=userId);var url=this.getUrl("Persons/"+this.encodeName(name),options);return this.getJSON(url)},ApiClient.prototype.getPublicUsers=function(){var url=this.getUrl("users/public");return this.ajax({type:"GET",url:url,dataType:"json"},!1)},ApiClient.prototype.getUsers=function(options){var url=this.getUrl("users",options||{});return this.getJSON(url)},ApiClient.prototype.getParentalRatings=function(){var url=this.getUrl("Localization/ParentalRatings");return this.getJSON(url)},ApiClient.prototype.getDefaultImageQuality=function(imageType){return"backdrop"===imageType.toLowerCase()?80:90},ApiClient.prototype.getUserImageUrl=function(userId,options){if(!userId)throw new Error("null userId");options=options||{};var url="Users/"+userId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(this,options),delete options.type,delete options.index,this.getUrl(url,options)},ApiClient.prototype.getImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),options.quality=options.quality||this.getDefaultImageQuality(options.type),this.normalizeImageOptions&&this.normalizeImageOptions(options),delete options.type,delete options.index,this.getUrl(url,options)},ApiClient.prototype.getScaledImageUrl=function(itemId,options){if(!itemId)throw new Error("itemId cannot be empty");options=options||{};var url="Items/"+itemId+"/Images/"+options.type;return null!=options.index&&(url+="/"+options.index),normalizeImageOptions(this,options),delete options.type,delete options.index,delete options.minScale,this.getUrl(url,options)},ApiClient.prototype.getThumbImageUrl=function(item,options){if(!item)throw new Error("null item");return options=options||{},options.imageType="thumb",item.ImageTags&&item.ImageTags.Thumb?(options.tag=item.ImageTags.Thumb,this.getImageUrl(item.Id,options)):item.ParentThumbItemId?(options.tag=item.ImageTags.ParentThumbImageTag,this.getImageUrl(item.ParentThumbItemId,options)):null},ApiClient.prototype.updateUserPassword=function(userId,currentPassword,newPassword){if(!userId)return Promise.reject();var url=this.getUrl("Users/"+userId+"/Password"),instance=this;return new Promise(function(resolve,reject){require(["cryptojs-sha1"],function(){instance.ajax({type:"POST",url:url,data:{currentPassword:CryptoJS.SHA1(currentPassword).toString(),newPassword:CryptoJS.SHA1(newPassword).toString()}}).then(resolve,reject)})})},ApiClient.prototype.updateEasyPassword=function(userId,newPassword){var instance=this;return new Promise(function(resolve,reject){if(!userId)return void reject();var url=this.getUrl("Users/"+userId+"/EasyPassword");require(["cryptojs-sha1"],function(){instance.ajax({type:"POST",url:url,data:{newPassword:CryptoJS.SHA1(newPassword).toString()}}).then(resolve,reject)})})},ApiClient.prototype.resetUserPassword=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/Password"),postData={};return postData.resetPassword=!0,this.ajax({type:"POST",url:url,data:postData})},ApiClient.prototype.resetEasyPassword=function(userId){if(!userId)throw new Error("null userId");var url=this.getUrl("Users/"+userId+"/EasyPassword"),postData={};return postData.resetPassword=!0,this.ajax({type:"POST",url:url,data:postData})},ApiClient.prototype.updateServerConfiguration=function(configuration){if(!configuration)throw new Error("null configuration");var url=this.getUrl("System/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateNamedConfiguration=function(name,configuration){if(!configuration)throw new Error("null configuration");var url=this.getUrl("System/Configuration/"+name);return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateItem=function(item){if(!item)throw new Error("null item");var url=this.getUrl("Items/"+item.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(item),contentType:"application/json"})},ApiClient.prototype.updatePluginSecurityInfo=function(info){var url=this.getUrl("Plugins/SecurityInfo");return this.ajax({type:"POST",url:url,data:JSON.stringify(info),contentType:"application/json"})},ApiClient.prototype.createUser=function(name){var url=this.getUrl("Users/New");return this.ajax({type:"POST",url:url,data:{Name:name},dataType:"json"})},ApiClient.prototype.updateUser=function(user){if(!user)throw new Error("null user");var url=this.getUrl("Users/"+user.Id);return this.ajax({type:"POST",url:url,data:JSON.stringify(user),contentType:"application/json"})},ApiClient.prototype.updateUserPolicy=function(userId,policy){if(!userId)throw new Error("null userId");if(!policy)throw new Error("null policy");var url=this.getUrl("Users/"+userId+"/Policy");return this.ajax({type:"POST",url:url,data:JSON.stringify(policy),contentType:"application/json"})},ApiClient.prototype.updateUserConfiguration=function(userId,configuration){if(!userId)throw new Error("null userId");if(!configuration)throw new Error("null configuration");var url=this.getUrl("Users/"+userId+"/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.updateScheduledTaskTriggers=function(id,triggers){if(!id)throw new Error("null id");if(!triggers)throw new Error("null triggers");var url=this.getUrl("ScheduledTasks/"+id+"/Triggers");return this.ajax({type:"POST",url:url,data:JSON.stringify(triggers),contentType:"application/json"})},ApiClient.prototype.updatePluginConfiguration=function(id,configuration){if(!id)throw new Error("null Id");if(!configuration)throw new Error("null configuration");var url=this.getUrl("Plugins/"+id+"/Configuration");return this.ajax({type:"POST",url:url,data:JSON.stringify(configuration),contentType:"application/json"})},ApiClient.prototype.getAncestorItems=function(itemId,userId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=this.getUrl("Items/"+itemId+"/Ancestors",options);return this.getJSON(url)},ApiClient.prototype.getItems=function(userId,options){var url;return url="string"===(typeof userId).toString().toLowerCase()?this.getUrl("Users/"+userId+"/Items",options):this.getUrl("Items",options),this.getJSON(url)},ApiClient.prototype.getMovieRecommendations=function(options){return this.getJSON(this.getUrl("Movies/Recommendations",options))},ApiClient.prototype.getUpcomingEpisodes=function(options){return this.getJSON(this.getUrl("Shows/Upcoming",options))},ApiClient.prototype.getChannels=function(query){return this.getJSON(this.getUrl("Channels",query||{}))},ApiClient.prototype.getLatestChannelItems=function(query){return this.getJSON(this.getUrl("Channels/Items/Latest",query))},ApiClient.prototype.getUserViews=function(options,userId){options=options||{};var url=this.getUrl("Users/"+(userId||this.getCurrentUserId())+"/Views",options);return this.getJSON(url)},ApiClient.prototype.getArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Artists",options);return this.getJSON(url)},ApiClient.prototype.getAlbumArtists=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Artists/AlbumArtists",options);return this.getJSON(url)},ApiClient.prototype.getGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Genres",options);return this.getJSON(url)},ApiClient.prototype.getMusicGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("MusicGenres",options);return this.getJSON(url)},ApiClient.prototype.getGameGenres=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("GameGenres",options);return this.getJSON(url)},ApiClient.prototype.getPeople=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Persons",options);return this.getJSON(url)},ApiClient.prototype.getStudios=function(userId,options){if(!userId)throw new Error("null userId");options=options||{},options.userId=userId;var url=this.getUrl("Studios",options);return this.getJSON(url)},ApiClient.prototype.getLocalTrailers=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/LocalTrailers");return this.getJSON(url)},ApiClient.prototype.getGameSystems=function(){var options={},userId=this.getCurrentUserId();userId&&(options.userId=userId);var url=this.getUrl("Games/SystemSummaries",options);return this.getJSON(url)},ApiClient.prototype.getAdditionalVideoParts=function(userId,itemId){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId);var url=this.getUrl("Videos/"+itemId+"/AdditionalParts",options);return this.getJSON(url)},ApiClient.prototype.getThemeMedia=function(userId,itemId,inherit){if(!itemId)throw new Error("null itemId");var options={};userId&&(options.userId=userId),options.InheritFromParent=inherit||!1;var url=this.getUrl("Items/"+itemId+"/ThemeMedia",options);return this.getJSON(url)},ApiClient.prototype.getSearchHints=function(options){var url=this.getUrl("Search/Hints",options),serverId=this.serverId();return this.getJSON(url).then(function(result){return result.SearchHints.forEach(function(i){i.ServerId=serverId}),result})},ApiClient.prototype.getSpecialFeatures=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/SpecialFeatures");return this.getJSON(url)},ApiClient.prototype.getDateParamValue=function(date){function formatDigit(i){return i<10?"0"+i:i}var d=date;return""+d.getFullYear()+formatDigit(d.getMonth()+1)+formatDigit(d.getDate())+formatDigit(d.getHours())+formatDigit(d.getMinutes())+formatDigit(d.getSeconds())},ApiClient.prototype.markPlayed=function(userId,itemId,date){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var options={};date&&(options.DatePlayed=this.getDateParamValue(date));var url=this.getUrl("Users/"+userId+"/PlayedItems/"+itemId,options);return this.ajax({type:"POST",url:url,dataType:"json"})},ApiClient.prototype.markUnplayed=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/PlayedItems/"+itemId);return this.ajax({type:"DELETE",url:url,dataType:"json"})},ApiClient.prototype.updateFavoriteStatus=function(userId,itemId,isFavorite){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/FavoriteItems/"+itemId),method=isFavorite?"POST":"DELETE";return this.ajax({type:method,url:url,dataType:"json"})},ApiClient.prototype.updateUserItemRating=function(userId,itemId,likes){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating",{likes:likes});return this.ajax({type:"POST",url:url,dataType:"json"})},ApiClient.prototype.getItemCounts=function(userId){var options={};userId&&(options.userId=userId);var url=this.getUrl("Items/Counts",options);return this.getJSON(url)},ApiClient.prototype.clearUserItemRating=function(userId,itemId){if(!userId)throw new Error("null userId");if(!itemId)throw new Error("null itemId");var url=this.getUrl("Users/"+userId+"/Items/"+itemId+"/Rating");return this.ajax({type:"DELETE",url:url,dataType:"json"})},ApiClient.prototype.reportPlaybackStart=function(options){if(!options)throw new Error("null options");this.lastPlaybackProgressReport=0,stopBitrateDetection(this);var url=this.getUrl("Sessions/Playing");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");if("timeupdate"===(options.EventName||"timeupdate")){var now=(new Date).getTime();if(now-(this.lastPlaybackProgressReport||0)<=1e4)return;this.lastPlaybackProgressReport=now}else this.lastPlaybackProgressReport=0;var url=this.getUrl("Sessions/Playing/Progress");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.reportOfflineActions=function(actions){if(!actions)throw new Error("null actions");var url=this.getUrl("Sync/OfflineActions");return this.ajax({type:"POST",data:JSON.stringify(actions),contentType:"application/json",url:url})},ApiClient.prototype.syncData=function(data){if(!data)throw new Error("null data");var url=this.getUrl("Sync/Data");return this.ajax({type:"POST",data:JSON.stringify(data),contentType:"application/json",url:url,dataType:"json"})},ApiClient.prototype.getReadySyncItems=function(deviceId){if(!deviceId)throw new Error("null deviceId");var url=this.getUrl("Sync/Items/Ready",{TargetId:deviceId});return this.getJSON(url)},ApiClient.prototype.reportSyncJobItemTransferred=function(syncJobItemId){if(!syncJobItemId)throw new Error("null syncJobItemId");var url=this.getUrl("Sync/JobItems/"+syncJobItemId+"/Transferred");return this.ajax({type:"POST",url:url})},ApiClient.prototype.cancelSyncItems=function(itemIds,targetId){if(!itemIds)throw new Error("null itemIds");var url=this.getUrl("Sync/"+(targetId||this.deviceId())+"/Items",{ItemIds:itemIds.join(",")});return this.ajax({type:"DELETE",url:url})},ApiClient.prototype.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");this.lastPlaybackProgressReport=0,redetectBitrate(this);var url=this.getUrl("Sessions/Playing/Stopped");return this.ajax({type:"POST",data:JSON.stringify(options),contentType:"application/json",url:url})},ApiClient.prototype.sendPlayCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=this.getUrl("Sessions/"+sessionId+"/Playing",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.sendCommand=function(sessionId,command){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=this.getUrl("Sessions/"+sessionId+"/Command"),ajaxOptions={type:"POST",url:url};return ajaxOptions.data=JSON.stringify(command),ajaxOptions.contentType="application/json",this.ajax(ajaxOptions)},ApiClient.prototype.sendMessageCommand=function(sessionId,options){if(!sessionId)throw new Error("null sessionId");if(!options)throw new Error("null options");var url=this.getUrl("Sessions/"+sessionId+"/Message",options);return this.ajax({type:"POST",url:url})},ApiClient.prototype.sendPlayStateCommand=function(sessionId,command,options){if(!sessionId)throw new Error("null sessionId");if(!command)throw new Error("null command");var url=this.getUrl("Sessions/"+sessionId+"/Playing/"+command,options||{});return this.ajax({type:"POST",url:url})},ApiClient.prototype.createPackageReview=function(review){var url=this.getUrl("Packages/Reviews/"+review.id,review);return this.ajax({type:"POST",url:url})},ApiClient.prototype.getPackageReviews=function(packageId,minRating,maxRating,limit){if(!packageId)throw new Error("null packageId");var options={};minRating&&(options.MinRating=minRating),maxRating&&(options.MaxRating=maxRating),limit&&(options.Limit=limit);var url=this.getUrl("Packages/"+packageId+"/Reviews",options);return this.getJSON(url)},ApiClient.prototype.getSmartMatchInfos=function(options){options=options||{};var url=this.getUrl("Library/FileOrganizations/SmartMatches",options);return this.ajax({type:"GET",url:url,dataType:"json"})},ApiClient.prototype.deleteSmartMatchEntries=function(entries){var url=this.getUrl("Library/FileOrganizations/SmartMatches/Delete"),postData={Entries:entries};return this.ajax({type:"POST",url:url,data:JSON.stringify(postData),contentType:"application/json"})},ApiClient.prototype.getEndpointInfo=function(){return this.getJSON(this.getUrl("System/Endpoint"))},ApiClient.prototype.getLatestItems=function(options){return options=options||{},this.getJSON(this.getUrl("Users/"+this.getCurrentUserId()+"/Items/Latest",options))},ApiClient}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-apiclient/apiclientex.js b/dashboard-ui/bower_components/emby-apiclient/apiclientex.js index 22fcff2a94..c171240990 100644 --- a/dashboard-ui/bower_components/emby-apiclient/apiclientex.js +++ b/dashboard-ui/bower_components/emby-apiclient/apiclientex.js @@ -1 +1 @@ -define(["apiclientcore","localassetmanager","events","appStorage"],function(apiclientcorefactory,localassetmanager,events,appStorage){"use strict";var localPrefix="local:",localViewPrefix="localview:";return function(serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio){function getCurrentUser(){return apiclientcore.getCurrentUser().then(function(user){return appStorage.setItem("user-"+user.Id,JSON.stringify(user)),user},function(error){var userId=apiclientcore.getCurrentUserId();if(userId&&apiclientcore.accessToken()){var json=appStorage.getItem("user-"+userId);if(json)return Promise.resolve(JSON.parse(json))}return Promise.reject(error)})}function getUserViews(userId){return apiclientcore.getUserViews(userId).then(function(result){var serverInfo=apiclientcore.serverInfo();return serverInfo?getLocalView(serverInfo.Id,userId).then(function(localView){return localView&&(result.Items.push(localView),result.TotalRecordCount++),Promise.resolve(result)}):Promise.resolve(result)})}function getLocalView(serverId,userId){return getLocalFolders(serverId,userId).then(function(views){var localView=null;return views.length>0&&(localView={Name:self.downloadsTitleText||"Downloads",ServerId:serverId,Id:"localview",Type:"localview"}),Promise.resolve(localView)})}function getLocalFolders(userId){var serverInfo=apiclientcore.serverInfo();return userId=userId||serverInfo.UserId,localassetmanager.getViews(serverInfo.Id,userId)}function getItems(userId,options){var i,serverInfo=apiclientcore.serverInfo();if(serverInfo&&"localview"===options.ParentId)return getLocalFolders(serverInfo.Id,userId).then(function(items){var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(serverInfo&&options&&(isLocalId(options.ParentId)||isLocalViewId(options.ParentId)))return localassetmanager.getViewItems(serverInfo.Id,userId,options).then(function(items){items.forEach(function(item){adjustGuidProperties(item)}),items.sort(function(a,b){return a.SortName.toLowerCase().localeCompare(b.SortName.toLowerCase())});var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(options&&options.ExcludeItemIds&&options.ExcludeItemIds.length){var exItems=options.ExcludeItemIds.split(",");for(i=0;i0?Promise.resolve(views[0]):Promise.reject()}):isLocalId(itemId)&&(serverInfo=apiclientcore.serverInfo())?localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return adjustGuidProperties(item.Item),Promise.resolve(item.Item)}):apiclientcore.getItem(userId,itemId)}function adjustGuidProperties(downloadedItem){downloadedItem.Id=convertGuidToLocal(downloadedItem.Id),downloadedItem.SeriesId=convertGuidToLocal(downloadedItem.SeriesId),downloadedItem.SeasonId=convertGuidToLocal(downloadedItem.SeasonId),downloadedItem.AlbumId=convertGuidToLocal(downloadedItem.AlbumId),downloadedItem.ParentId=convertGuidToLocal(downloadedItem.ParentId),downloadedItem.ParentThumbItemId=convertGuidToLocal(downloadedItem.ParentThumbItemId),downloadedItem.ParentPrimaryImageItemId=convertGuidToLocal(downloadedItem.ParentPrimaryImageItemId),downloadedItem.PrimaryImageItemId=convertGuidToLocal(downloadedItem.PrimaryImageItemId),downloadedItem.ParentLogoItemId=convertGuidToLocal(downloadedItem.ParentLogoItemId),downloadedItem.ParentBackdropItemID=convertGuidToLocal(downloadedItem.ParentBackdropItemID),downloadedItem.ParentBackdropImageTags=null}function convertGuidToLocal(guid){return guid?isLocalId(guid)?guid:"local:"+guid:null}function getNextUpEpisodes(options){return options.SeriesId&&isLocalId(options.SeriesId)?Promise.resolve(createEmptyList()):apiclientcore.getNextUpEpisodes(options)}function getSeasons(itemId,options){return isLocalId(itemId)?(options.ParentId=itemId,getItems(apiclientcore.getCurrentUserId(),options)):apiclientcore.getSeasons(itemId,options)}function getEpisodes(itemId,options){return isLocalId(options.SeasonId)?(options.ParentId=options.SeasonId,getItems(apiclientcore.getCurrentUserId(),options)):isLocalId(options.seasonId)?(options.ParentId=options.seasonId,getItems(apiclientcore.getCurrentUserId(),options)):isLocalId(itemId)?(options.ParentId=itemId,options.Recursive=!0,getItems(apiclientcore.getCurrentUserId(),options).then(function(items){var items2=items.Items.filter(function(item){return"episode"===item.Type.toLowerCase()}),result={Items:items2,TotalRecordCount:items2.length};return Promise.resolve(result)})):apiclientcore.getEpisodes(itemId,options)}function getThemeMedia(userId,itemId,inherit){return isLocalViewId(itemId)||isLocalId(itemId)?Promise.reject():apiclientcore.getThemeMedia(userId,itemId,inherit)}function getSimilarItems(itemId,options){return isLocalId(itemId)?Promise.resolve(createEmptyList()):apiclientcore.getSimilarItems(itemId,options)}function updateFavoriteStatus(userId,itemId,isFavorite){return isLocalId(itemId)?Promise.resolve():apiclientcore.updateFavoriteStatus(userId,itemId,isFavorite)}function getScaledImageUrl(itemId,options){if(isLocalId(itemId)||options&&options.itemid&&isLocalId(options.itemid)){var serverInfo=apiclientcore.serverInfo(),id=stripLocalPrefix(itemId);return localassetmanager.getImageUrl(serverInfo.Id,id,options.type,0)}return apiclientcore.getScaledImageUrl(itemId,options)}function onWebSocketMessage(e,msg){events.trigger(self,"websocketmessage",[msg])}function getPlaybackInfo(itemId,options,deviceProfile){return isLocalId(itemId)?localassetmanager.getLocalItem(apiclientcore.serverId(),stripLocalPrefix(itemId)).then(function(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return{MediaSources:mediaSources}}):localassetmanager.getLocalItem(apiclientcore.serverId(),itemId).then(function(item){if(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return localassetmanager.fileExists(item.LocalPath).then(function(exists){if(exists){var res={MediaSources:mediaSources};return Promise.resolve(res)}return apiclientcore.getPlaybackInfo(itemId,options,deviceProfile)})}return apiclientcore.getPlaybackInfo(itemId,options,deviceProfile)})}function reportPlaybackStart(options){if(!options)throw new Error("null options");return isLocalId(options.ItemId)?Promise.resolve():apiclientcore.reportPlaybackStart(options)}function reportPlaybackProgress(options){if(!options)throw new Error("null options");return isLocalId(options.ItemId)?Promise.resolve():apiclientcore.reportPlaybackProgress(options)}function reportPlaybackStopped(options){if(!options)throw new Error("null options");if(isLocalId(options.ItemId)){var serverInfo=apiclientcore.serverInfo(),action={Date:(new Date).getTime(),ItemId:stripLocalPrefix(options.ItemId),PositionTicks:options.PositionTicks,ServerId:serverInfo.Id,Type:0,UserId:apiclientcore.getCurrentUserId()};return localassetmanager.recordUserAction(action)}return apiclientcore.reportPlaybackStopped(options)}function getIntros(itemId){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):apiclientcore.getIntros(itemId)}function getInstantMixFromItem(itemId,options){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):apiclientcore.getInstantMixFromItem(itemId,options)}function getItemDownloadUrl(itemId){if(isLocalId(itemId)){var serverInfo=apiclientcore.serverInfo();if(serverInfo)return localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return Promise.resolve(item.LocalPath)})}return apiclientcore.getItemDownloadUrl(itemId)}function isLocalId(str){return startsWith(str,localPrefix)}function isLocalViewId(str){return startsWith(str,localViewPrefix)}function stripLocalPrefix(str){var res=stripStart(str,localPrefix);return res=stripStart(res,localViewPrefix)}function startsWith(str,find){return!!(str&&find&&str.length>find.length&&0===str.indexOf(find))}function stripStart(str,find){return startsWith(str,find)?str.substr(find.length):str}function createEmptyList(){var result={Items:[],TotalRecordCount:0};return result}var apiclientcore=new apiclientcorefactory(serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio),self=Object.assign(this,apiclientcore);events.on(apiclientcore,"websocketmessage",onWebSocketMessage),Object.defineProperty(self,"onAuthenticated",{get:function(){return apiclientcore.onAuthenticated},set:function(newValue){apiclientcore.onAuthenticated=newValue}}),Object.defineProperty(self,"enableAutomaticBitrateDetection",{get:function(){return apiclientcore.enableAutomaticBitrateDetection},set:function(newValue){apiclientcore.enableAutomaticBitrateDetection=newValue}}),self.getLatestOfflineItems=function(options){options.SortBy="DateCreated",options.SortOrder="Descending";var serverInfo=apiclientcore.serverInfo();return serverInfo?localassetmanager.getViewItems(serverInfo.Id,null,options).then(function(items){return items.forEach(function(item){adjustGuidProperties(item)}),Promise.resolve(items)}):Promise.resolve([])},self.getCurrentUser=getCurrentUser,self.getUserViews=getUserViews,self.getItems=getItems,self.getItem=getItem,self.getLocalFolders=getLocalFolders,self.getSeasons=getSeasons,self.getEpisodes=getEpisodes,self.getThemeMedia=getThemeMedia,self.getNextUpEpisodes=getNextUpEpisodes,self.getSimilarItems=getSimilarItems,self.updateFavoriteStatus=updateFavoriteStatus,self.getScaledImageUrl=getScaledImageUrl,self.getPlaybackInfo=getPlaybackInfo,self.reportPlaybackStart=reportPlaybackStart,self.reportPlaybackProgress=reportPlaybackProgress,self.reportPlaybackStopped=reportPlaybackStopped,self.getIntros=getIntros,self.getInstantMixFromItem=getInstantMixFromItem,self.getItemDownloadUrl=getItemDownloadUrl}}); \ No newline at end of file +define(["apiclientcore","localassetmanager","appStorage"],function(ApiClient,localassetmanager,appStorage){"use strict";function isLocalId(str){return startsWith(str,localPrefix)}function isLocalViewId(str){return startsWith(str,localViewPrefix)}function stripLocalPrefix(str){var res=stripStart(str,localPrefix);return res=stripStart(res,localViewPrefix)}function startsWith(str,find){return!!(str&&find&&str.length>find.length&&0===str.indexOf(find))}function stripStart(str,find){return startsWith(str,find)?str.substr(find.length):str}function createEmptyList(){var result={Items:[],TotalRecordCount:0};return result}function convertGuidToLocal(guid){return guid?isLocalId(guid)?guid:"local:"+guid:null}function adjustGuidProperties(downloadedItem){downloadedItem.Id=convertGuidToLocal(downloadedItem.Id),downloadedItem.SeriesId=convertGuidToLocal(downloadedItem.SeriesId),downloadedItem.SeasonId=convertGuidToLocal(downloadedItem.SeasonId),downloadedItem.AlbumId=convertGuidToLocal(downloadedItem.AlbumId),downloadedItem.ParentId=convertGuidToLocal(downloadedItem.ParentId),downloadedItem.ParentThumbItemId=convertGuidToLocal(downloadedItem.ParentThumbItemId),downloadedItem.ParentPrimaryImageItemId=convertGuidToLocal(downloadedItem.ParentPrimaryImageItemId),downloadedItem.PrimaryImageItemId=convertGuidToLocal(downloadedItem.PrimaryImageItemId),downloadedItem.ParentLogoItemId=convertGuidToLocal(downloadedItem.ParentLogoItemId),downloadedItem.ParentBackdropItemID=convertGuidToLocal(downloadedItem.ParentBackdropItemID),downloadedItem.ParentBackdropImageTags=null}function getLocalView(instance,serverId,userId){return instance.getLocalFolders(serverId,userId).then(function(views){var localView=null;return views.length>0&&(localView={Name:instance.downloadsTitleText||"Downloads",ServerId:serverId,Id:"localview",Type:"localview"}),Promise.resolve(localView)})}function ApiClientEx(serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio){ApiClient.call(this,serverAddress,clientName,applicationVersion,deviceName,deviceId,devicePixelRatio)}var localPrefix="local:",localViewPrefix="localview:";return Object.assign(ApiClientEx.prototype,ApiClient.prototype),ApiClientEx.prototype.getPlaybackInfo=function(itemId,options,deviceProfile){if(isLocalId(itemId))return localassetmanager.getLocalItem(this.serverId(),stripLocalPrefix(itemId)).then(function(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return{MediaSources:mediaSources}});var instance=this;return localassetmanager.getLocalItem(this.serverId(),itemId).then(function(item){if(item){var mediaSources=item.Item.MediaSources.map(function(m){return m.SupportsDirectPlay=!0,m.SupportsDirectStream=!1,m.SupportsTranscoding=!1,m.IsLocal=!0,m});return localassetmanager.fileExists(item.LocalPath).then(function(exists){if(exists){var res={MediaSources:mediaSources};return Promise.resolve(res)}return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)})}return ApiClient.prototype.getPlaybackInfo.call(instance,itemId,options,deviceProfile)})},ApiClientEx.prototype.getItems=function(userId,options){var i,serverInfo=this.serverInfo();if(serverInfo&&"localview"===options.ParentId)return this.getLocalFolders(serverInfo.Id,userId).then(function(items){var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(serverInfo&&options&&(isLocalId(options.ParentId)||isLocalViewId(options.ParentId)))return localassetmanager.getViewItems(serverInfo.Id,userId,options).then(function(items){items.forEach(function(item){adjustGuidProperties(item)}),items.sort(function(a,b){return a.SortName.toLowerCase().localeCompare(b.SortName.toLowerCase())});var result={Items:items,TotalRecordCount:items.length};return Promise.resolve(result)});if(options&&options.ExcludeItemIds&&options.ExcludeItemIds.length){var exItems=options.ExcludeItemIds.split(",");for(i=0;i0?Promise.resolve(views[0]):Promise.reject()}):isLocalId(itemId)&&(serverInfo=this.serverInfo())?localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return adjustGuidProperties(item.Item),Promise.resolve(item.Item)}):ApiClient.prototype.getItem.call(this,userId,itemId)},ApiClientEx.prototype.getLocalFolders=function(userId){var serverInfo=this.serverInfo();return userId=userId||serverInfo.UserId,localassetmanager.getViews(serverInfo.Id,userId)},ApiClientEx.prototype.getCurrentUser=function(){var instance=this;return ApiClient.prototype.getCurrentUser.call(this).then(function(user){return appStorage.setItem("user-"+user.Id,JSON.stringify(user)),user},function(error){var userId=instance.getCurrentUserId();if(userId&&instance.accessToken()){var json=appStorage.getItem("user-"+userId);if(json)return Promise.resolve(JSON.parse(json))}return Promise.reject(error)})},ApiClientEx.prototype.getNextUpEpisodes=function(options){return options.SeriesId&&isLocalId(options.SeriesId)?Promise.resolve(createEmptyList()):ApiClient.prototype.getNextUpEpisodes.call(this,options)},ApiClientEx.prototype.getSeasons=function(itemId,options){return isLocalId(itemId)?(options.ParentId=itemId,this.getItems(this.getCurrentUserId(),options)):ApiClient.prototype.getSeasons.call(this,itemId,options)},ApiClientEx.prototype.getEpisodes=function(itemId,options){return isLocalId(options.SeasonId)?(options.ParentId=options.SeasonId,this.getItems(this.getCurrentUserId(),options)):isLocalId(options.seasonId)?(options.ParentId=options.seasonId,this.getItems(this.getCurrentUserId(),options)):isLocalId(itemId)?(options.ParentId=itemId,options.Recursive=!0,this.getItems(this.getCurrentUserId(),options).then(function(items){var items2=items.Items.filter(function(item){return"episode"===item.Type.toLowerCase()}),result={Items:items2,TotalRecordCount:items2.length};return Promise.resolve(result)})):ApiClient.prototype.getEpisodes.call(this,itemId,options)},ApiClientEx.prototype.getLatestOfflineItems=function(options){options.SortBy="DateCreated",options.SortOrder="Descending";var serverInfo=this.serverInfo();return serverInfo?localassetmanager.getViewItems(serverInfo.Id,null,options).then(function(items){return items.forEach(function(item){adjustGuidProperties(item)}),Promise.resolve(items)}):Promise.resolve([])},ApiClientEx.prototype.getThemeMedia=function(userId,itemId,inherit){return isLocalViewId(itemId)||isLocalId(itemId)?Promise.reject():ApiClient.prototype.getThemeMedia.call(this,userId,itemId,inherit)},ApiClientEx.prototype.getSimilarItems=function(itemId,options){return isLocalId(itemId)?Promise.resolve(createEmptyList()):ApiClient.prototype.getSimilarItems.call(this,itemId,options)},ApiClientEx.prototype.updateFavoriteStatus=function(userId,itemId,isFavorite){return isLocalId(itemId)?Promise.resolve():ApiClient.prototype.updateFavoriteStatus.call(this,userId,itemId,isFavorite)},ApiClientEx.prototype.getScaledImageUrl=function(itemId,options){if(isLocalId(itemId)||options&&options.itemid&&isLocalId(options.itemid)){var serverInfo=this.serverInfo(),id=stripLocalPrefix(itemId);return localassetmanager.getImageUrl(serverInfo.Id,id,options.type,0)}return ApiClient.prototype.getScaledImageUrl.call(this,itemId,options)},ApiClientEx.prototype.reportPlaybackStart=function(options){if(!options)throw new Error("null options");return isLocalId(options.ItemId)?Promise.resolve():ApiClient.prototype.reportPlaybackStart.call(this,options)},ApiClientEx.prototype.reportPlaybackProgress=function(options){if(!options)throw new Error("null options");return isLocalId(options.ItemId)?Promise.resolve():ApiClient.prototype.reportPlaybackProgress.call(this,options)},ApiClientEx.prototype.reportPlaybackStopped=function(options){if(!options)throw new Error("null options");if(isLocalId(options.ItemId)){var serverInfo=this.serverInfo(),action={Date:(new Date).getTime(),ItemId:stripLocalPrefix(options.ItemId),PositionTicks:options.PositionTicks,ServerId:serverInfo.Id,Type:0,UserId:this.getCurrentUserId()};return localassetmanager.recordUserAction(action)}return ApiClient.prototype.reportPlaybackStopped.call(this,options)},ApiClientEx.prototype.getIntros=function(itemId){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):ApiClient.prototype.getIntros.call(this,itemId)},ApiClientEx.prototype.getInstantMixFromItem=function(itemId,options){return isLocalId(itemId)?Promise.resolve({Items:[],TotalRecordCount:0}):ApiClient.prototype.getInstantMixFromItem.call(this,itemId,options)},ApiClientEx.prototype.getItemDownloadUrl=function(itemId){if(isLocalId(itemId)){var serverInfo=this.serverInfo();if(serverInfo)return localassetmanager.getLocalItem(serverInfo.Id,stripLocalPrefix(itemId)).then(function(item){return Promise.resolve(item.LocalPath)})}return ApiClient.prototype.getItemDownloadUrl.call(this,itemId)},ApiClientEx}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js b/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js index 71e58ea197..73711b3125 100644 --- a/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js +++ b/dashboard-ui/bower_components/emby-apiclient/appstorage-cache.js @@ -1 +1 @@ -define([],function(){"use strict";function updateCache(){cache.put("data",new Response(JSON.stringify(localData)))}var cache,localData,myStore={};return myStore.setItem=function(name,value){if(localData){var changed=localData[name]!==value;changed&&(localData[name]=value,updateCache())}},myStore.getItem=function(name){if(localData)return localData[name]},myStore.removeItem=function(name){localData&&(localData[name]=null,delete localData[name],updateCache())},myStore.init=function(){return caches.open("embydata").then(function(result){cache=result,localData={}})},myStore}); \ No newline at end of file +define([],function(){"use strict";function MyStore(){}function updateCache(instance){instance.cache.put("data",new Response(JSON.stringify(instance.localData)))}return MyStore.prototype.init=function(){var instance=this;return caches.open("embydata").then(function(result){instance.cache=result,instance.localData={}})},MyStore.prototype.setItem=function(name,value){if(this.localData){var changed=this.localData[name]!==value;changed&&(this.localData[name]=value,updateCache(this))}},MyStore.prototype.getItem=function(name){if(this.localData)return this.localData[name]},MyStore.prototype.removeItem=function(name){this.localData&&(this.localData[name]=null,delete this.localData[name],updateCache(this))},new MyStore}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js b/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js index 5131581e79..4c2124406d 100644 --- a/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js +++ b/dashboard-ui/bower_components/emby-apiclient/appstorage-localstorage.js @@ -1 +1 @@ -define([],function(){"use strict";function updateCache(){cache&&cache.put("data",new Response(JSON.stringify(localData)))}var cache,localData,myStore={};myStore.setItem=function(name,value){if(localStorage.setItem(name,value),localData){var changed=localData[name]!==value;changed&&(localData[name]=value,updateCache())}},myStore.getItem=function(name){return localStorage.getItem(name)},myStore.removeItem=function(name){localStorage.removeItem(name),localData&&(localData[name]=null,delete localData[name],updateCache())};try{self.caches&&caches.open("embydata").then(function(result){cache=result,localData={}})}catch(err){console.log("Error opening cache: "+err)}return myStore}); \ No newline at end of file +define([],function(){"use strict";function updateCache(instance){var cache=instance.cache;cache&&cache.put("data",new Response(JSON.stringify(instance.localData)))}function onCacheOpened(result){this.cache=result,this.localData={}}function MyStore(){try{self.caches&&caches.open("embydata").then(onCacheOpened.bind(this))}catch(err){console.log("Error opening cache: "+err)}}return MyStore.prototype.setItem=function(name,value){localStorage.setItem(name,value);var localData=this.localData;if(localData){var changed=localData[name]!==value;changed&&(localData[name]=value,updateCache(this))}},MyStore.prototype.getItem=function(name){return localStorage.getItem(name)},MyStore.prototype.removeItem=function(name){localStorage.removeItem(name);var localData=this.localData;localData&&(localData[name]=null,delete localData[name],updateCache(this))},new MyStore}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-apiclient/appstorage-memory.js b/dashboard-ui/bower_components/emby-apiclient/appstorage-memory.js index d6ccc0ca3a..370934de37 100644 --- a/dashboard-ui/bower_components/emby-apiclient/appstorage-memory.js +++ b/dashboard-ui/bower_components/emby-apiclient/appstorage-memory.js @@ -1 +1 @@ -define([],function(){"use strict";function MyStore(defaultObject){this.localData={}}return MyStore.prototype.setItem=function(name,value){this.localData[name]=value},MyStore.prototype.getItem=function(name){return this.localData[name]},MyStore.prototype.removeItem=function(name){this.localData[name]=null},new MyStore}); \ No newline at end of file +define([],function(){"use strict";function MyStore(){this.localData={}}return MyStore.prototype.setItem=function(name,value){this.localData[name]=value},MyStore.prototype.getItem=function(name){return this.localData[name]},MyStore.prototype.removeItem=function(name){this.localData[name]=null},new MyStore}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js b/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js index eec3399a70..3a12ca4236 100644 --- a/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js +++ b/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js @@ -1 +1 @@ -define(["events","apiclient","appStorage"],function(events,apiClientFactory,appStorage){"use strict";var ConnectionState={Unavailable:0,ServerSelection:1,ServerSignIn:2,SignedIn:3,ConnectSignIn:4,ServerUpdateNeeded:5},ConnectionMode={Local:0,Remote:1,Manual:2},ServerInfo={getServerAddress:function(server,mode){switch(mode){case ConnectionMode.Local:return server.LocalAddress;case ConnectionMode.Manual:return server.ManualAddress;case ConnectionMode.Remote:return server.RemoteAddress;default:return server.ManualAddress||server.LocalAddress||server.RemoteAddress}}},ConnectionManager=function(credentialProvider,appName,appVersion,deviceName,deviceId,capabilities,devicePixelRatio){function mergeServers(list1,list2){for(var i=0,length=list2.length;i0})}function findServers(){return new Promise(function(resolve,reject){var onFinish=function(foundServers){var servers=foundServers.map(function(foundServer){var info={Id:foundServer.Id,LocalAddress:convertEndpointAddressToManualAddress(foundServer)||foundServer.Address,Name:foundServer.Name};return info.LastConnectionMode=info.ManualAddress?ConnectionMode.Manual:ConnectionMode.Local,info});resolve(servers)};require(["serverdiscovery"],function(serverDiscovery){serverDiscovery.findServers(1e3).then(onFinish,function(){onFinish([])})})})}function convertEndpointAddressToManualAddress(info){if(info.Address&&info.EndpointAddress){var address=info.EndpointAddress.split(":")[0],parts=info.Address.split(":");if(parts.length>1){var portString=parts[parts.length-1];isNaN(parseInt(portString))||(address+=":"+portString)}return normalizeAddress(address)}return null}function stringEqualsIgnoreCase(str1,str2){return(str1||"").toLowerCase()===(str2||"").toLowerCase()}function compareVersions(a,b){a=a.split("."),b=b.split(".");for(var i=0,length=Math.max(a.length,b.length);ibVal)return 1}return 0}function testNextConnectionMode(tests,index,server,options,resolve){if(index>=tests.length)return console.log("Tested all connection modes. Failing server connection."),void resolveFailure(resolve);var mode=tests[index],address=ServerInfo.getServerAddress(server,mode),enableRetry=!1,skipTest=!1,timeout=defaultTimeout;return mode===ConnectionMode.Local?(enableRetry=!0,timeout=8e3,stringEqualsIgnoreCase(address,server.ManualAddress)&&(console.log("skipping LocalAddress test because it is the same as ManualAddress"),skipTest=!0)):mode===ConnectionMode.Manual&&stringEqualsIgnoreCase(address,server.LocalAddress)&&(enableRetry=!0,timeout=8e3),skipTest||!address?(console.log("skipping test at index "+index),void testNextConnectionMode(tests,index+1,server,options,resolve)):(console.log("testing connection mode "+mode+" with server "+server.Name),void tryConnect(address,timeout).then(function(result){1===compareVersions(self.minServerVersion(),result.Version)?(console.log("minServerVersion requirement not met. Server version: "+result.Version),resolve({State:ConnectionState.ServerUpdateNeeded,Servers:[server]})):result.Id!==server.Id?testNextConnectionMode(tests,index+1,server,options,resolve):(console.log("calling onSuccessfulConnection with connection mode "+mode+" with server "+server.Name),onSuccessfulConnection(server,result,mode,options,resolve))},function(){console.log("test failed for connection mode "+mode+" with server "+server.Name),enableRetry?testNextConnectionMode(tests,index+1,server,options,resolve):testNextConnectionMode(tests,index+1,server,options,resolve)}))}function onSuccessfulConnection(server,systemInfo,connectionMode,options,resolve){var credentials=credentialProvider.credentials();options=options||{},credentials.ConnectAccessToken&&options.enableAutoLogin!==!1?ensureConnectUser(credentials).then(function(){server.ExchangeToken?addAuthenticationInfoFromConnect(server,connectionMode,credentials).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)},function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}function afterConnectValidated(server,credentials,systemInfo,connectionMode,verifyLocalAuthentication,options,resolve){if(options=options||{},options.enableAutoLogin===!1)server.UserId=null,server.AccessToken=null;else if(verifyLocalAuthentication&&server.AccessToken&&options.enableAutoLogin!==!1)return void validateAuthentication(server,connectionMode).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!1,options,resolve)});updateServerInfo(server,systemInfo),server.LastConnectionMode=connectionMode,options.updateDateLastAccessed!==!1&&(server.DateLastAccessed=(new Date).getTime()),credentialProvider.addOrUpdateServer(credentials.Servers,server),credentialProvider.credentials(credentials);var result={Servers:[]};result.ApiClient=getOrAddApiClient(server,connectionMode),result.State=server.AccessToken&&options.enableAutoLogin!==!1?ConnectionState.SignedIn:ConnectionState.ServerSignIn,result.Servers.push(server),result.ApiClient.updateServerInfo(server,connectionMode),result.State===ConnectionState.SignedIn&&afterConnected(result.ApiClient,options),resolve(result),events.trigger(self,"connected",[result])}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function normalizeAddress(address){return address=address.trim(),0!==address.toLowerCase().indexOf("http")&&(address="http://"+address),address=replaceAll(address,"Http:","http:"),address=replaceAll(address,"Https:","https:")}function addAppInfoToConnectRequest(request){request.headers=request.headers||{},request.headers["X-Application"]=appName+"/"+appVersion}function exchangePin(pinInfo){if(!pinInfo)throw new Error("pinInfo cannot be null");var request={type:"POST",url:getConnectUrl("pin/authenticate"),data:{deviceId:pinInfo.DeviceId,pin:pinInfo.Pin},dataType:"json"};return addAppInfoToConnectRequest(request),ajax(request)}console.log("Begin ConnectionManager constructor");var connectUser,self=this,apiClients=[],defaultTimeout=2e4;self.connectUser=function(){return connectUser};var minServerVersion="3.1.5";return self.minServerVersion=function(val){return val&&(minServerVersion=val),minServerVersion},self.appVersion=function(){return appVersion},self.capabilities=function(){return capabilities},self.deviceId=function(){return deviceId},self.credentialProvider=function(){return credentialProvider},self.connectUserId=function(){return credentialProvider.credentials().ConnectUserId},self.connectToken=function(){return credentialProvider.credentials().ConnectAccessToken},self.getApiClients=function(){var servers=self.getSavedServers();return servers.map(function(s){self.getOrCreateApiClient(s.Id)}),apiClients},self.getServerInfo=function(id){var servers=credentialProvider.credentials().Servers;return servers.filter(function(s){return s.Id===id})[0]},self.getLastUsedServer=function(){var servers=credentialProvider.credentials().Servers;return servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),servers.length?servers[0]:null},self.getLastUsedApiClient=function(){var servers=credentialProvider.credentials().Servers;if(servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),!servers.length)return null;var server=servers[0];return getOrAddApiClient(server,server.LastConnectionMode)},self.addApiClient=function(apiClient){apiClients.push(apiClient);var existingServers=credentialProvider.credentials().Servers.filter(function(s){return stringEqualsIgnoreCase(s.ManualAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.LocalAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.RemoteAddress,apiClient.serverAddress())}),existingServer=existingServers.length?existingServers[0]:{};if(existingServer.DateLastAccessed=(new Date).getTime(),existingServer.LastConnectionMode=ConnectionMode.Manual,existingServer.ManualAddress=apiClient.serverAddress(),apiClient.serverInfo(existingServer),apiClient.onAuthenticated=function(instance,result){onAuthenticated(instance,result,{},!0)},!existingServers.length){var credentials=credentialProvider.credentials();credentials.Servers=[existingServer],credentialProvider.credentials(credentials)}events.trigger(self,"apiclientcreated",[apiClient]),existingServer.Id||apiClient.getPublicSystemInfo().then(function(systemInfo){var credentials=credentialProvider.credentials();existingServer.Id=systemInfo.Id,apiClient.serverInfo(existingServer),credentials.Servers=[existingServer],credentialProvider.credentials(credentials)})},self.clearData=function(){console.log("connection manager clearing data"),connectUser=null;var credentials=credentialProvider.credentials();credentials.ConnectAccessToken=null,credentials.ConnectUserId=null,credentials.Servers=[],credentialProvider.credentials(credentials)},self.getOrCreateApiClient=function(serverId){var credentials=credentialProvider.credentials(),servers=credentials.Servers.filter(function(s){return stringEqualsIgnoreCase(s.Id,serverId)});if(!servers.length)throw new Error("Server not found: "+serverId);var server=servers[0];return getOrAddApiClient(server,server.LastConnectionMode)},self.user=function(apiClient){return new Promise(function(resolve,reject){function onLocalUserDone(e){var image=getImageUrl(localUser);resolve({localUser:localUser,name:connectUser?connectUser.Name:localUser?localUser.Name:null,imageUrl:image.url,supportsImageParams:image.supportsParams})}function onEnsureConnectUserDone(){apiClient&&apiClient.getCurrentUserId()?apiClient.getCurrentUser().then(function(u){localUser=u,onLocalUserDone()},onLocalUserDone):onLocalUserDone()}var localUser,credentials=credentialProvider.credentials();!credentials.ConnectUserId||!credentials.ConnectAccessToken||apiClient&&apiClient.getCurrentUserId()?onEnsureConnectUserDone():ensureConnectUser(credentials).then(onEnsureConnectUserDone,onEnsureConnectUserDone)})},self.isLoggedIntoConnect=function(){return!(!self.connectToken()||!self.connectUserId())},self.logout=function(){console.log("begin connectionManager loguot");for(var promises=[],i=0,length=apiClients.length;i0})}function findServers(){return new Promise(function(resolve,reject){var onFinish=function(foundServers){var servers=foundServers.map(function(foundServer){var info={Id:foundServer.Id,LocalAddress:convertEndpointAddressToManualAddress(foundServer)||foundServer.Address,Name:foundServer.Name};return info.LastConnectionMode=info.ManualAddress?ConnectionMode.Manual:ConnectionMode.Local,info});resolve(servers)};require(["serverdiscovery"],function(serverDiscovery){serverDiscovery.findServers(1e3).then(onFinish,function(){onFinish([])})})})}function convertEndpointAddressToManualAddress(info){if(info.Address&&info.EndpointAddress){var address=info.EndpointAddress.split(":")[0],parts=info.Address.split(":");if(parts.length>1){var portString=parts[parts.length-1];isNaN(parseInt(portString))||(address+=":"+portString)}return normalizeAddress(address)}return null}function stringEqualsIgnoreCase(str1,str2){return(str1||"").toLowerCase()===(str2||"").toLowerCase()}function compareVersions(a,b){a=a.split("."),b=b.split(".");for(var i=0,length=Math.max(a.length,b.length);ibVal)return 1}return 0}function testNextConnectionMode(tests,index,server,options,resolve){if(index>=tests.length)return console.log("Tested all connection modes. Failing server connection."),void resolveFailure(self,resolve);var mode=tests[index],address=ServerInfo.getServerAddress(server,mode),enableRetry=!1,skipTest=!1,timeout=defaultTimeout;return mode===ConnectionMode.Local?(enableRetry=!0,timeout=8e3,stringEqualsIgnoreCase(address,server.ManualAddress)&&(console.log("skipping LocalAddress test because it is the same as ManualAddress"),skipTest=!0)):mode===ConnectionMode.Manual&&stringEqualsIgnoreCase(address,server.LocalAddress)&&(enableRetry=!0,timeout=8e3),skipTest||!address?(console.log("skipping test at index "+index),void testNextConnectionMode(tests,index+1,server,options,resolve)):(console.log("testing connection mode "+mode+" with server "+server.Name),void tryConnect(address,timeout).then(function(result){1===compareVersions(self.minServerVersion(),result.Version)?(console.log("minServerVersion requirement not met. Server version: "+result.Version),resolve({State:ConnectionState.ServerUpdateNeeded,Servers:[server]})):result.Id!==server.Id?testNextConnectionMode(tests,index+1,server,options,resolve):(console.log("calling onSuccessfulConnection with connection mode "+mode+" with server "+server.Name),onSuccessfulConnection(server,result,mode,options,resolve))},function(){console.log("test failed for connection mode "+mode+" with server "+server.Name),enableRetry?testNextConnectionMode(tests,index+1,server,options,resolve):testNextConnectionMode(tests,index+1,server,options,resolve)}))}function onSuccessfulConnection(server,systemInfo,connectionMode,options,resolve){var credentials=credentialProvider.credentials();options=options||{},credentials.ConnectAccessToken&&options.enableAutoLogin!==!1?ensureConnectUser(credentials).then(function(){server.ExchangeToken?addAuthenticationInfoFromConnect(server,connectionMode,credentials).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)},function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}):afterConnectValidated(server,credentials,systemInfo,connectionMode,!0,options,resolve)}function afterConnectValidated(server,credentials,systemInfo,connectionMode,verifyLocalAuthentication,options,resolve){if(options=options||{},options.enableAutoLogin===!1)server.UserId=null,server.AccessToken=null;else if(verifyLocalAuthentication&&server.AccessToken&&options.enableAutoLogin!==!1)return void validateAuthentication(server,connectionMode).then(function(){afterConnectValidated(server,credentials,systemInfo,connectionMode,!1,options,resolve)});updateServerInfo(server,systemInfo),server.LastConnectionMode=connectionMode,options.updateDateLastAccessed!==!1&&(server.DateLastAccessed=(new Date).getTime()),credentialProvider.addOrUpdateServer(credentials.Servers,server),credentialProvider.credentials(credentials);var result={Servers:[]};result.ApiClient=getOrAddApiClient(server,connectionMode),result.State=server.AccessToken&&options.enableAutoLogin!==!1?ConnectionState.SignedIn:ConnectionState.ServerSignIn,result.Servers.push(server),result.ApiClient.updateServerInfo(server,connectionMode),result.State===ConnectionState.SignedIn&&afterConnected(result.ApiClient,options),resolve(result),events.trigger(self,"connected",[result])}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function normalizeAddress(address){return address=address.trim(),0!==address.toLowerCase().indexOf("http")&&(address="http://"+address),address=replaceAll(address,"Http:","http:"),address=replaceAll(address,"Https:","https:")}function addAppInfoToConnectRequest(request){request.headers=request.headers||{},request.headers["X-Application"]=appName+"/"+appVersion}function exchangePin(pinInfo){if(!pinInfo)throw new Error("pinInfo cannot be null");var request={type:"POST",url:getConnectUrl("pin/authenticate"),data:{deviceId:pinInfo.DeviceId,pin:pinInfo.Pin},dataType:"json"};return addAppInfoToConnectRequest(request),ajax(request)}console.log("Begin ConnectionManager constructor");var self=this;this._apiClients=[];var connectUser;return self.connectUser=function(){return connectUser},self._minServerVersion="3.1.5",self.appVersion=function(){return appVersion},self.capabilities=function(){return capabilities},self.deviceId=function(){return deviceId},self.credentialProvider=function(){return credentialProvider},self.connectUserId=function(){return credentialProvider.credentials().ConnectUserId},self.connectToken=function(){return credentialProvider.credentials().ConnectAccessToken},self.getServerInfo=function(id){var servers=credentialProvider.credentials().Servers;return servers.filter(function(s){return s.Id===id})[0]},self.getLastUsedServer=function(){var servers=credentialProvider.credentials().Servers;return servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),servers.length?servers[0]:null},self.getLastUsedApiClient=function(){var servers=credentialProvider.credentials().Servers;if(servers.sort(function(a,b){return(b.DateLastAccessed||0)-(a.DateLastAccessed||0)}),!servers.length)return null;var server=servers[0];return getOrAddApiClient(server,server.LastConnectionMode)},self.addApiClient=function(apiClient){self._apiClients.push(apiClient);var existingServers=credentialProvider.credentials().Servers.filter(function(s){return stringEqualsIgnoreCase(s.ManualAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.LocalAddress,apiClient.serverAddress())||stringEqualsIgnoreCase(s.RemoteAddress,apiClient.serverAddress())}),existingServer=existingServers.length?existingServers[0]:{};if(existingServer.DateLastAccessed=(new Date).getTime(),existingServer.LastConnectionMode=ConnectionMode.Manual,existingServer.ManualAddress=apiClient.serverAddress(),apiClient.serverInfo(existingServer),apiClient.onAuthenticated=function(instance,result){onAuthenticated(instance,result,{},!0)},!existingServers.length){var credentials=credentialProvider.credentials();credentials.Servers=[existingServer],credentialProvider.credentials(credentials)}events.trigger(self,"apiclientcreated",[apiClient]),existingServer.Id||apiClient.getPublicSystemInfo().then(function(systemInfo){var credentials=credentialProvider.credentials();existingServer.Id=systemInfo.Id,apiClient.serverInfo(existingServer),credentials.Servers=[existingServer],credentialProvider.credentials(credentials)})},self.clearData=function(){console.log("connection manager clearing data"),connectUser=null;var credentials=credentialProvider.credentials();credentials.ConnectAccessToken=null,credentials.ConnectUserId=null,credentials.Servers=[],credentialProvider.credentials(credentials)},self.getOrCreateApiClient=function(serverId){var credentials=credentialProvider.credentials(),servers=credentials.Servers.filter(function(s){return stringEqualsIgnoreCase(s.Id,serverId)});if(!servers.length)throw new Error("Server not found: "+serverId);var server=servers[0];return getOrAddApiClient(server,server.LastConnectionMode)},self.user=function(apiClient){return new Promise(function(resolve,reject){function onLocalUserDone(e){var image=getImageUrl(localUser);resolve({localUser:localUser,name:connectUser?connectUser.Name:localUser?localUser.Name:null,imageUrl:image.url,supportsImageParams:image.supportsParams})}function onEnsureConnectUserDone(){apiClient&&apiClient.getCurrentUserId()?apiClient.getCurrentUser().then(function(u){localUser=u,onLocalUserDone()},onLocalUserDone):onLocalUserDone()}var localUser,credentials=credentialProvider.credentials();!credentials.ConnectUserId||!credentials.ConnectAccessToken||apiClient&&apiClient.getCurrentUserId()?onEnsureConnectUserDone():ensureConnectUser(credentials).then(onEnsureConnectUserDone,onEnsureConnectUserDone)})},self.isLoggedIntoConnect=function(){return!(!self.connectToken()||!self.connectUserId())},self.logout=function(){console.log("begin connectionManager loguot");for(var promises=[],i=0,length=self._apiClients.length;i=length)return void resolve();var server=servers[index];console.log("Creating ServerSync to server: "+server.Id),new ServerSync(connectionManager).sync(server,options).then(function(){syncNext(connectionManager,servers,index+1,options,resolve,reject)},function(){syncNext(connectionManager,servers,index+1,options,resolve,reject)})}return function(connectionManager){var self=this;self.sync=function(options){return new Promise(function(resolve,reject){var servers=connectionManager.getSavedServers();syncNext(connectionManager,servers,0,options,resolve,reject)})}}}); \ No newline at end of file +define(["serversync"],function(ServerSync){"use strict";function syncNext(connectionManager,servers,index,options,resolve,reject){var length=servers.length;if(index>=length)return void resolve();var server=servers[index];console.log("Creating ServerSync to server: "+server.Id),(new ServerSync).sync(connectionManager,server,options).then(function(){syncNext(connectionManager,servers,index+1,options,resolve,reject)},function(){syncNext(connectionManager,servers,index+1,options,resolve,reject)})}function MultiServerSync(){}return MultiServerSync.prototype.sync=function(connectionManager,options){return new Promise(function(resolve,reject){var servers=connectionManager.getSavedServers();syncNext(connectionManager,servers,0,options,resolve,reject)})},MultiServerSync}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js b/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js index 328c307179..62aba5b887 100644 --- a/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js +++ b/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js @@ -1 +1 @@ -define([],function(){"use strict";return function(connectionManager){function performSync(server,options){console.log("ServerSync.performSync to server: "+server.Id),options=options||{};var uploadPhotos=options.uploadPhotos!==!1;options.cameraUploadServers&&options.cameraUploadServers.indexOf(server.Id)===-1&&(uploadPhotos=!1);var pr=Promise.resolve();return pr.then(function(){return uploadPhotos?uploadContent(server,options):Promise.resolve()}).then(function(){return syncMedia(server,options)})}function uploadContent(server,options){return new Promise(function(resolve,reject){require(["contentuploader"],function(contentuploader){uploader=new ContentUploader(connectionManager),uploader.uploadImages(server).then(resolve,reject)})})}function syncMedia(server,options){return new Promise(function(resolve,reject){require(["mediasync"],function(MediaSync){var apiClient=connectionManager.getApiClient(server.Id);(new MediaSync).sync(apiClient,server,options).then(resolve,reject)})})}var self=this;self.sync=function(server,options){if(!server.AccessToken&&!server.ExchangeToken)return console.log("Skipping sync to server "+server.Id+" because there is no saved authentication information."),Promise.resolve();var connectionOptions={updateDateLastAccessed:!1,enableWebSocket:!1,reportCapabilities:!1,enableAutomaticBitrateDetection:!1};return connectionManager.connectToServer(server,connectionOptions).then(function(result){return result.State===MediaBrowser.ConnectionState.SignedIn?performSync(server,options):(console.log("Unable to connect to server id: "+server.Id),Promise.reject())},function(err){throw console.log("Unable to connect to server id: "+server.Id),err})}}}); \ No newline at end of file +define([],function(){"use strict";function performSync(connectionManager,server,options){console.log("ServerSync.performSync to server: "+server.Id),options=options||{};var uploadPhotos=options.uploadPhotos!==!1;options.cameraUploadServers&&options.cameraUploadServers.indexOf(server.Id)===-1&&(uploadPhotos=!1);var pr=Promise.resolve();return pr.then(function(){return uploadPhotos?uploadContent(connectionManager,server,options):Promise.resolve()}).then(function(){return syncMedia(connectionManager,server,options)})}function uploadContent(connectionManager,server,options){return new Promise(function(resolve,reject){require(["contentuploader"],function(contentuploader){uploader=new ContentUploader(connectionManager),uploader.uploadImages(server).then(resolve,reject)})})}function syncMedia(connectionManager,server,options){return new Promise(function(resolve,reject){require(["mediasync"],function(MediaSync){var apiClient=connectionManager.getApiClient(server.Id);(new MediaSync).sync(apiClient,server,options).then(resolve,reject)})})}function ServerSync(){}return ServerSync.prototype.sync=function(connectionManager,server,options){if(!server.AccessToken&&!server.ExchangeToken)return console.log("Skipping sync to server "+server.Id+" because there is no saved authentication information."),Promise.resolve();var connectionOptions={updateDateLastAccessed:!1,enableWebSocket:!1,reportCapabilities:!1,enableAutomaticBitrateDetection:!1};return connectionManager.connectToServer(server,connectionOptions).then(function(result){return result.State===MediaBrowser.ConnectionState.SignedIn?performSync(server,options):(console.log("Unable to connect to server id: "+server.Id),Promise.reject())},function(err){throw console.log("Unable to connect to server id: "+server.Id),err})},ServerSync}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js b/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js index 433f520eb9..d1842a679d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js +++ b/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js @@ -1 +1 @@ -define(["focusManager","layoutManager","css!./style.css","paper-icon-button-light","material-icons"],function(focusManager,layoutManager){"use strict";function focus(){var scope=this,selected=scope.querySelector("."+selectedButtonClass);selected?focusManager.focus(selected):focusManager.autoFocus(scope,!0)}function getAlphaPickerButtonClassName(){var alphaPickerButtonClassName="alphaPickerButton";return layoutManager.tv&&(alphaPickerButtonClassName+=" alphaPickerButton-tv"),alphaPickerButtonClassName}function getLetterButton(l){return'"}function render(element,options){element.classList.add("alphaPicker"),element.classList.contains("alphaPicker-vertical")||element.classList.add("focuscontainer-x");var letters,html="",alphaPickerButtonClassName=getAlphaPickerButtonClassName(),rowClassName="alphaPickerRow";element.classList.contains("alphaPicker-vertical")&&(rowClassName+=" alphaPickerRow-vertical"),html+='
',"keyboard"===options.mode?html+='':(letters=["#"],html+=letters.map(getLetterButton).join("")),letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],html+=letters.map(getLetterButton).join(""),"keyboard"===options.mode?(html+='',html+="
",letters=["0","1","2","3","4","5","6","7","8","9"],html+='
',html+="
",html+=letters.map(getLetterButton).join(""),html+="
"):html+="
",element.innerHTML=html,element.classList.add("focusable"),element.focus=focus}function AlphaPicker(options){function onItemFocusTimeout(){itemFocusTimeout=null,self.value(itemFocusValue)}function onAlphaFocusTimeout(){if(alphaFocusTimeout=null,document.activeElement===alphaFocusedElement){var value=alphaFocusedElement.getAttribute("data-value");self.value(value,!0)}}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onAlphaPickerInKeyboardModeClick(e){var alphaPickerButton=parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");element.dispatchEvent(new CustomEvent("alphavalueclicked",{cancelable:!1,detail:{value:value}}))}}function onAlphaPickerClick(e){var alphaPickerButton=parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");currentValue===value.toUpperCase()?self.value(null,!0):self.value(value,!0)}}function onAlphaPickerFocusIn(e){alphaFocusTimeout&&(clearTimeout(alphaFocusTimeout),alphaFocusTimeout=null);var alphaPickerButton=parentWithClass(e.target,"alphaPickerButton");alphaPickerButton&&(alphaFocusedElement=alphaPickerButton,alphaFocusTimeout=setTimeout(onAlphaFocusTimeout,100))}function onItemsFocusIn(e){var item=parentWithClass(e.target,itemClass);if(item){var prefix=item.getAttribute("data-prefix");prefix&&prefix.length&&(itemFocusValue=prefix[0],itemFocusTimeout&&clearTimeout(itemFocusTimeout),itemFocusTimeout=setTimeout(onItemFocusTimeout,100))}}var itemFocusValue,itemFocusTimeout,alphaFocusedElement,alphaFocusTimeout,self=this,element=options.element,itemsContainer=options.itemsContainer,itemClass=options.itemClass;self.enabled=function(enabled){enabled?(itemsContainer&&itemsContainer.addEventListener("focus",onItemsFocusIn,!0),"keyboard"===options.mode&&element.addEventListener("click",onAlphaPickerInKeyboardModeClick),"click"!==options.valueChangeEvent?element.addEventListener("focus",onAlphaPickerFocusIn,!0):element.addEventListener("click",onAlphaPickerClick)):(itemsContainer&&itemsContainer.removeEventListener("focus",onItemsFocusIn,!0),element.removeEventListener("click",onAlphaPickerInKeyboardModeClick),element.removeEventListener("focus",onAlphaPickerFocusIn,!0),element.removeEventListener("click",onAlphaPickerClick))},self.on=function(name,fn){element.addEventListener(name,fn)},self.off=function(name,fn){element.removeEventListener(name,fn)},self.destroy=function(){self.enabled(!1),element.classList.remove("focuscontainer-x")},self.visible=function(visible){element.style.visibility=visible?"visible":"hidden"};var currentValue;self.value=function(value,applyValue){var btn,selected;return void 0!==value&&(null!=value?(value=value.toUpperCase(),currentValue=value,"keyboard"!==options.mode&&(selected=element.querySelector("."+selectedButtonClass),btn=element.querySelector(".alphaPickerButton[data-value='"+value+"']"),btn&&btn!==selected&&btn.classList.add(selectedButtonClass),selected&&selected!==btn&&selected.classList.remove(selectedButtonClass))):(currentValue=value,selected=element.querySelector("."+selectedButtonClass),selected&&selected.classList.remove(selectedButtonClass))),applyValue&&element.dispatchEvent(new CustomEvent("alphavaluechanged",{cancelable:!1,detail:{value:value}})),currentValue},self.values=function(){for(var elems=element.querySelectorAll(".alphaPickerButton"),values=[],i=0,length=elems.length;i'+l+""}function render(element,options){element.classList.add("alphaPicker"),element.classList.contains("alphaPicker-vertical")||element.classList.add("focuscontainer-x");var letters,html="",alphaPickerButtonClassName=getAlphaPickerButtonClassName(),rowClassName="alphaPickerRow";element.classList.contains("alphaPicker-vertical")&&(rowClassName+=" alphaPickerRow-vertical"),html+='
',"keyboard"===options.mode?html+='':(letters=["#"],html+=letters.map(getLetterButton).join("")),letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],html+=letters.map(getLetterButton).join(""),"keyboard"===options.mode?(html+='',html+="
",letters=["0","1","2","3","4","5","6","7","8","9"],html+='
',html+="
",html+=letters.map(getLetterButton).join(""),html+="
"):html+="
",element.innerHTML=html,element.classList.add("focusable"),element.focus=focus}function AlphaPicker(options){function onItemFocusTimeout(){itemFocusTimeout=null,self.value(itemFocusValue)}function onAlphaFocusTimeout(){if(alphaFocusTimeout=null,document.activeElement===alphaFocusedElement){var value=alphaFocusedElement.getAttribute("data-value");self.value(value,!0)}}function onAlphaPickerInKeyboardModeClick(e){var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");element.dispatchEvent(new CustomEvent("alphavalueclicked",{cancelable:!1,detail:{value:value}}))}}function onAlphaPickerClick(e){var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");if(alphaPickerButton){var value=alphaPickerButton.getAttribute("data-value");this._currentValue===value.toUpperCase()?self.value(null,!0):self.value(value,!0)}}function onAlphaPickerFocusIn(e){alphaFocusTimeout&&(clearTimeout(alphaFocusTimeout),alphaFocusTimeout=null);var alphaPickerButton=dom.parentWithClass(e.target,"alphaPickerButton");alphaPickerButton&&(alphaFocusedElement=alphaPickerButton,alphaFocusTimeout=setTimeout(onAlphaFocusTimeout,100))}function onItemsFocusIn(e){var item=dom.parentWithClass(e.target,itemClass);if(item){var prefix=item.getAttribute("data-prefix");prefix&&prefix.length&&(itemFocusValue=prefix[0],itemFocusTimeout&&clearTimeout(itemFocusTimeout),itemFocusTimeout=setTimeout(onItemFocusTimeout,100))}}var self=this;this.options=options;var itemFocusValue,itemFocusTimeout,alphaFocusedElement,alphaFocusTimeout,element=options.element,itemsContainer=options.itemsContainer,itemClass=options.itemClass;self.enabled=function(enabled){enabled?(itemsContainer&&itemsContainer.addEventListener("focus",onItemsFocusIn,!0),"keyboard"===options.mode&&element.addEventListener("click",onAlphaPickerInKeyboardModeClick),"click"!==options.valueChangeEvent?element.addEventListener("focus",onAlphaPickerFocusIn,!0):element.addEventListener("click",onAlphaPickerClick)):(itemsContainer&&itemsContainer.removeEventListener("focus",onItemsFocusIn,!0),element.removeEventListener("click",onAlphaPickerInKeyboardModeClick),element.removeEventListener("focus",onAlphaPickerFocusIn,!0),element.removeEventListener("click",onAlphaPickerClick))},render(element,options),this.enabled(!0),this.visible(!0)}var selectedButtonClass="alphaPickerButton-selected";return AlphaPicker.prototype.value=function(value,applyValue){var btn,selected,element=this.options.element;if(void 0!==value)if(null!=value){if(value=value.toUpperCase(),this._currentValue=value,"keyboard"!==this.options.mode){selected=element.querySelector("."+selectedButtonClass);try{btn=element.querySelector(".alphaPickerButton[data-value='"+value+"']")}catch(err){console.log("Error in querySelector: "+err)}btn&&btn!==selected&&btn.classList.add(selectedButtonClass),selected&&selected!==btn&&selected.classList.remove(selectedButtonClass)}}else this._currentValue=value,selected=element.querySelector("."+selectedButtonClass),selected&&selected.classList.remove(selectedButtonClass);return applyValue&&element.dispatchEvent(new CustomEvent("alphavaluechanged",{cancelable:!1,detail:{value:value}})),this._currentValue},AlphaPicker.prototype.on=function(name,fn){var element=this.options.element;element.addEventListener(name,fn)},AlphaPicker.prototype.off=function(name,fn){var element=this.options.element;element.removeEventListener(name,fn)},AlphaPicker.prototype.visible=function(visible){var element=this.options.element;element.style.visibility=visible?"visible":"hidden"},AlphaPicker.prototype.values=function(){for(var element=this.options.element,elems=element.querySelectorAll(".alphaPickerButton"),values=[],i=0,length=elems.length;i.card{contain:layout style}.cardScalable{position:relative}.cardPadder-backdrop,.cardPadder-overflowBackdrop,.cardPadder-overflowSmallBackdrop,.cardPadder-smallBackdrop{padding-bottom:56.25%}.cardPadder-overflowSquare,.cardPadder-square{padding-bottom:100%}.cardPadder-overflowPortrait,.cardPadder-portrait,.overflowPortraitCard-textCardPadder{padding-bottom:150%}.cardPadder-banner{padding-bottom:18.5%}.cardBox{padding:0!important;margin:.427em;-webkit-transition:none;-o-transition:none;transition:none;border:0 solid transparent;background-color:transparent}.layout-tv .cardBox{margin:.5em}.layout-mobile .cardBox{margin:.3em}.card-focuscontent{border:.12em solid transparent}.cardBox-focustransform{will-change:transform;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.card:focus>.cardBox-focustransform{-webkit-transform:scale(1.16,1.16);transform:scale(1.16,1.16)}.card:focus{position:relative!important;z-index:10!important}.cardBox-bottompadded{margin-bottom:1.2em!important}.btnCardOptions{position:absolute;bottom:.25em;right:0;margin:0!important;z-index:1}.mediaSourceIndicator{display:flex;position:absolute;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;top:.3em;left:.3em;text-align:center;vertical-align:middle;width:24px;height:24px;-webkit-border-radius:50%;border-radius:50%;color:#fff;background:#38c}.cardText,.innerCardFooter{overflow:hidden;text-align:left}.cardImageContainer{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center center;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;-webkit-background-clip:content-box!important;background-clip:content-box!important;color:inherit;height:100%}.chapterCardImageContainer{background-color:#000;-webkit-border-radius:0;border-radius:0}.textCardImageContainer{background-color:#444}.cardImageContainer-button{border:0;padding:0;background-color:transparent;-webkit-box-sizing:content-box;box-sizing:content-box}.forceRelative{position:relative}.cardContent,.cardImage{position:absolute;top:0;left:0;right:0;bottom:0}.cardContent{overflow:hidden;display:block;height:100%}.cardContent-shadow{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.cardImage{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center bottom}.cardImage-img{max-height:100%;max-width:100%;min-height:70%;min-width:70%;margin:auto}.coveredImage-img{width:100%;height:100%}.coveredImage-noscale-img{max-height:none;max-width:none}.coveredImage{-webkit-background-size:100% 100%;background-size:100% 100%;background-position:center center}.coveredImage-noScale{-webkit-background-size:cover;background-size:cover}.cardFooter{padding:.5em .3em;position:relative}.cardFooter-transparent{padding-top:.16em}.layout-tv .cardFooter-transparent{padding-top:0}.visualCardBox{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);background-color:#222326;-webkit-border-radius:2px;border-radius:2px}.innerCardFooter{background:rgba(0,0,0,.7);position:absolute;bottom:0;left:0;z-index:1;max-width:100%;color:#fff}.innerCardFooterClear{background-color:transparent}.fullInnerCardFooter{right:0}.cardText{padding:.1em .5em;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:inherit}.cardDefaultText,.cardTextCentered{text-align:center}.layout-tv .cardText{padding:0 .5em;font-size:92%}.innerCardFooter>.cardText{padding:.3em .5em}.cardFooter-transparent>.cardText{color:#ccc}.cardText-secondary{color:#888!important}.visualCardBox .cardText-secondary{color:inherit!important;opacity:.5}.card:focus .cardText{color:#fff!important}.cardText-rightmargin{margin-right:2em}.cardDefaultText{white-space:normal}.textActionButton{background:0 0;border:0!important;padding:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit}.textActionButton:hover{text-decoration:underline}.cardFooterLogo{margin-right:1em}.cardImageIcon{width:auto;height:auto;font-size:5em;color:inherit}.cardIndicators{right:2.5%;top:2.5%;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.portraitCardIndicators{right:3%;top:2%}.backdropCardIndicators{right:1.5%;top:2.8%}.cardOverlayButton{color:#fff!important;background-color:rgba(0,0,0,.8)!important;-webkit-border-radius:500px;border-radius:500px;position:absolute;bottom:0;right:0;margin:0 .35em .5em 0;z-index:1;padding:6px}.cardOverlayButton:hover{background-color:rgba(0,0,0,.9)!important;-webkit-transition:background-color .5s ease-out;-o-transition:background-color .5s ease-out;transition:background-color .5s ease-out}.defaultCardColor1{background-color:#009688}.defaultCardColor2{background-color:#D32F2F}.defaultCardColor3{background-color:#0288D1}.defaultCardColor4{background-color:#388E3C}.defaultCardColor5{background-color:#F57F17}.backdropCard-scalable,.bannerCard-scalable{width:100%}.smallBackdropCard-scalable,.squareCard-scalable{width:50%}.portraitCard-scalable{width:33.333333333333333333333333333333%}.overflowPortraitCard-scalable{width:42vw}.overflowBackdropCard-scalable{width:72vw}.overflowSmallBackdropCard-scalable{width:60%}.overflowSquareCard-scalable{width:42vw}@media all and (min-width:400px){.backdropCard-scalable{width:50%}}@media all and (min-width:500px){.smallBackdropCard-scalable,.squareCard-scalable{width:33.333333333333333333333333333333%}}@media all and (min-width:540px){.overflowPortraitCard-scalable{width:30vw}.overflowBackdropCard-scalable{width:64vw}.overflowSquareCard-scalable{width:30vw}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:640px){.portraitCard-scalable{width:25%}.overflowBackdropCard-scalable{width:56vw}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:700px){.squareCard-scalable{width:25%}}@media all and (min-width:770px){.backdropCard-scalable{width:33.333333333333333333333333333333%}.overflowSmallBackdropCard-scalable{width:30%}}@media all and (min-width:800px){.bannerCard-scalable{width:50%}.portraitCard-scalable{width:20%}.smallBackdropCard-scalable{width:25%}}@media all and (min-width:900px){.squareCard-scalable{width:20%}}@media all and (min-width:1000px){.smallBackdropCard-scalable{width:20%}.overflowPortraitCard-scalable{width:22vw}.overflowBackdropCard-scalable{width:40vw}.overflowSmallBackdropCard-scalable{width:24%}.overflowSquareCard-scalable{width:22vw}}@media all and (min-width:1200px){.backdropCard-scalable{width:25%}.squareCard-scalable{width:16.666666666666666666666666666667%}.bannerCard-scalable{width:33.333333333333333333333333333333%}.portraitCard-scalable,.smallBackdropCard-scalable{width:16.666666666666666666666666666667%}.overflowSmallBackdropCard-scalable{width:18%}.overflowPortraitCard-scalable,.overflowSquareCard-scalable{width:18vw}}@media all and (min-width:1400px){.portraitCard-scalable,.smallBackdropCard-scalable,.squareCard-scalable{width:14.285714285714285714285714285714%}.overflowPortraitCard-scalable,.overflowSquareCard-scalable{width:15vw}.overflowBackdropCard-scalable{width:30vw}}@media all and (min-width:1600px){.portraitCard-scalable,.smallBackdropCard-scalable{width:12.5%}.backdropCard-scalable{width:20%}.squareCard-scalable{width:12.5%}}@media all and (min-width:1800px){.smallBackdropCard-scalable{width:10%}.overflowBackdropCard-scalable{width:23.5vw}}@media all and (min-width:1920px){.squareCard-scalable{width:11.111111111111111111111111111111%}.smallBackdropCard-scalable{width:10%}}@media all and (min-width:2100px){.backdropCard-scalable{width:20%}.portraitCard-scalable{width:11.111111111111111111111111111111%}}@media all and (min-width:2200px){.bannerCard-scalable{width:25%}.portraitCard-scalable{width:10%}}@media all and (min-width:2500px){.backdropCard-scalable{width:16.666666666666666666666666666667%}}.itemsContainer-tv>.backdropCard-scalable{width:25%}.itemsContainer-tv>.portraitCard-scalable,.itemsContainer-tv>.squareCard-scalable{width:16.666666666666666666666666666667%}.itemsContainer-tv>.overflowSmallBackdropCard-scalable{width:18vw}.itemsContainer-tv>.overflowBackdropCard-scalable{width:23.3vw}.overflowBackdropCard-textCard{width:15.5vw!important}.overflowBackdropCard-textCardPadder{padding-bottom:87.75%}.itemsContainer-tv>.overflowPortraitCard-scalable,.itemsContainer-tv>.overflowSquareCard-scalable{width:15.5vw} \ No newline at end of file +.card,.cardImageContainer-button,.textActionButton{cursor:pointer;outline:0!important}.card,.card:focus{font-weight:inherit!important}.card,.cardBox,.textActionButton{outline:0!important}button::-moz-focus-inner{padding:0;border:0}button{-webkit-border-fit:border!important}.card{border:0;font-size:inherit!important;font-family:inherit!important;text-transform:none;background:0 0!important;margin:0;padding:0;display:block;color:inherit!important;contain:style;-webkit-flex-shrink:0;flex-shrink:0}.itemsContainer,.vertical-list{display:-webkit-box;display:-webkit-flex}.itemsContainer{display:flex}.vertical-list{display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap}.mediaSourceIndicator,.vertical-wrap{display:-webkit-box;display:-webkit-flex}.vertical-wrap{display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;flex-wrap:wrap}.vertical-wrap.centered{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.vertical-wrap>.card{contain:layout style}.cardScalable{position:relative}.cardPadder-backdrop,.cardPadder-overflowBackdrop,.cardPadder-overflowSmallBackdrop,.cardPadder-smallBackdrop{padding-bottom:56.25%}.cardPadder-overflowSquare,.cardPadder-square{padding-bottom:100%}.cardPadder-overflowPortrait,.cardPadder-portrait,.overflowPortraitCard-textCardPadder{padding-bottom:150%}.cardPadder-banner{padding-bottom:18.5%}.cardBox{padding:0!important;margin:.427em;-webkit-transition:none;-o-transition:none;transition:none;border:0 solid transparent;background-color:transparent}.layout-tv .cardBox{margin:.5em}.layout-mobile .cardBox{margin:.3em}.card-focuscontent{border:.12em solid transparent}.cardBox-focustransform{will-change:transform;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.card:focus>.cardBox-focustransform{-webkit-transform:scale(1.16,1.16);transform:scale(1.16,1.16)}.card:focus{position:relative!important;z-index:10!important}.cardBox-bottompadded{margin-bottom:1.2em!important}.btnCardOptions{position:absolute;bottom:.25em;right:0;margin:0!important;z-index:1}.mediaSourceIndicator{display:flex;position:absolute;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;top:.3em;left:.3em;text-align:center;vertical-align:middle;width:1.6em;height:1.6em;-webkit-border-radius:50%;border-radius:50%;color:#fff;background:#38c}.cardText,.innerCardFooter{overflow:hidden;text-align:left}.cardImageContainer{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center center;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;-webkit-background-clip:content-box!important;background-clip:content-box!important;color:inherit;height:100%}.chapterCardImageContainer{background-color:#000;-webkit-border-radius:0;border-radius:0}.textCardImageContainer{background-color:#444}.cardImageContainer-button{border:0;padding:0;background-color:transparent;-webkit-box-sizing:content-box;box-sizing:content-box}.forceRelative{position:relative}.cardContent,.cardImage{position:absolute;top:0;left:0;right:0;bottom:0}.cardContent{overflow:hidden;display:block;height:100%}.cardContent-shadow{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.cardImage{-webkit-background-size:contain;background-size:contain;background-repeat:no-repeat;background-position:center bottom}.cardImage-img{max-height:100%;max-width:100%;min-height:70%;min-width:70%;margin:auto}.coveredImage-img{width:100%;height:100%}.coveredImage-noscale-img{max-height:none;max-width:none}.coveredImage{-webkit-background-size:100% 100%;background-size:100% 100%;background-position:center center}.coveredImage-noScale{-webkit-background-size:cover;background-size:cover}.cardFooter{padding:.5em .3em;position:relative}.cardFooter-transparent{padding-top:.16em}.layout-tv .cardFooter-transparent{padding-top:0}.visualCardBox{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);background-color:#222326;-webkit-border-radius:2px;border-radius:2px}.innerCardFooter{background:rgba(0,0,0,.7);position:absolute;bottom:0;left:0;z-index:1;max-width:100%;color:#fff}.innerCardFooterClear{background-color:transparent}.fullInnerCardFooter{right:0}.cardText{padding:.1em .5em;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:inherit}.cardDefaultText,.cardTextCentered{text-align:center}.layout-tv .cardText{padding:0 .5em;font-size:92%}.innerCardFooter>.cardText{padding:.3em .5em}.cardFooter-transparent>.cardText{color:#ccc}.cardText-secondary{color:#888!important}.visualCardBox .cardText-secondary{color:inherit!important;opacity:.5}.card:focus .cardText{color:#fff!important}.cardText-rightmargin{margin-right:2em}.cardDefaultText{white-space:normal}.textActionButton{background:0 0;border:0!important;padding:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit}.textActionButton:hover{text-decoration:underline}.cardFooterLogo{margin-right:1em}.cardImageIcon{width:auto;height:auto;font-size:5em;color:inherit}.cardIndicators{right:2.5%;top:2.5%;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.portraitCardIndicators{right:3%;top:2%}.backdropCardIndicators{right:1.5%;top:2.8%}.cardOverlayButton{color:#fff!important;background-color:rgba(0,0,0,.8)!important;-webkit-border-radius:500px;border-radius:500px;position:absolute;bottom:0;right:0;margin:0 .35em .5em 0;z-index:1;padding:.427em}.cardOverlayButton:hover{background-color:rgba(0,0,0,.9)!important;-webkit-transition:background-color .5s ease-out;-o-transition:background-color .5s ease-out;transition:background-color .5s ease-out}.defaultCardColor1{background-color:#009688}.defaultCardColor2{background-color:#D32F2F}.defaultCardColor3{background-color:#0288D1}.defaultCardColor4{background-color:#388E3C}.defaultCardColor5{background-color:#F57F17}.backdropCard-scalable,.bannerCard-scalable{width:100%}.smallBackdropCard-scalable,.squareCard-scalable{width:50%}.portraitCard-scalable{width:33.333333333333333333333333333333%}.overflowPortraitCard-scalable{width:42vw}.overflowBackdropCard-scalable{width:72vw}.overflowSmallBackdropCard-scalable{width:60%}.overflowSquareCard-scalable{width:42vw}@media all and (min-width:400px){.backdropCard-scalable{width:50%}}@media all and (min-width:500px){.smallBackdropCard-scalable,.squareCard-scalable{width:33.333333333333333333333333333333%}}@media all and (min-width:540px){.overflowPortraitCard-scalable{width:30vw}.overflowBackdropCard-scalable{width:64vw}.overflowSquareCard-scalable{width:30vw}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:640px){.portraitCard-scalable{width:25%}.overflowBackdropCard-scalable{width:56vw}.overflowSmallBackdropCard-scalable{width:40%}}@media all and (min-width:700px){.squareCard-scalable{width:25%}}@media all and (min-width:770px){.backdropCard-scalable{width:33.333333333333333333333333333333%}.overflowSmallBackdropCard-scalable{width:30%}}@media all and (min-width:800px){.bannerCard-scalable{width:50%}.portraitCard-scalable{width:20%}.smallBackdropCard-scalable{width:25%}}@media all and (min-width:900px){.squareCard-scalable{width:20%}}@media all and (min-width:1000px){.smallBackdropCard-scalable{width:20%}.overflowPortraitCard-scalable{width:22vw}.overflowBackdropCard-scalable{width:40vw}.overflowSmallBackdropCard-scalable{width:24%}.overflowSquareCard-scalable{width:22vw}}@media all and (min-width:1200px){.backdropCard-scalable{width:25%}.squareCard-scalable{width:16.666666666666666666666666666667%}.bannerCard-scalable{width:33.333333333333333333333333333333%}.portraitCard-scalable,.smallBackdropCard-scalable{width:16.666666666666666666666666666667%}.overflowSmallBackdropCard-scalable{width:18%}.overflowPortraitCard-scalable,.overflowSquareCard-scalable{width:18vw}}@media all and (min-width:1400px){.portraitCard-scalable,.smallBackdropCard-scalable,.squareCard-scalable{width:14.285714285714285714285714285714%}.overflowPortraitCard-scalable,.overflowSquareCard-scalable{width:15vw}.overflowBackdropCard-scalable{width:30vw}}@media all and (min-width:1600px){.portraitCard-scalable,.smallBackdropCard-scalable{width:12.5%}.backdropCard-scalable{width:20%}.squareCard-scalable{width:12.5%}}@media all and (min-width:1800px){.overflowBackdropCard-scalable{width:23.5vw}}@media all and (min-width:1920px){.squareCard-scalable{width:11.111111111111111111111111111111%}.smallBackdropCard-scalable{width:10%}}@media all and (min-width:2100px){.backdropCard-scalable{width:20%}.portraitCard-scalable{width:11.111111111111111111111111111111%}}@media all and (min-width:2200px){.bannerCard-scalable{width:25%}.portraitCard-scalable{width:10%}}@media all and (min-width:2500px){.backdropCard-scalable{width:16.666666666666666666666666666667%}}.itemsContainer-tv>.backdropCard-scalable{width:25%}.itemsContainer-tv>.portraitCard-scalable,.itemsContainer-tv>.squareCard-scalable{width:16.666666666666666666666666666667%}.itemsContainer-tv>.overflowSmallBackdropCard-scalable{width:18vw}.itemsContainer-tv>.overflowBackdropCard-scalable{width:23.3vw}.overflowBackdropCard-textCard{width:15.5vw!important}.overflowBackdropCard-textCardPadder{padding-bottom:87.75%}.itemsContainer-tv>.overflowPortraitCard-scalable,.itemsContainer-tv>.overflowSquareCard-scalable{width:15.5vw} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 35d19b56ef..31c52d8630 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -1,2 +1,2 @@ -define(["datetime","imageLoader","connectionManager","itemHelper","focusManager","indicators","globalize","layoutManager","apphost","dom","browser","itemShortcuts","css!./card","paper-icon-button-light","clearButtonStyle"],function(datetime,imageLoader,connectionManager,itemHelper,focusManager,indicators,globalize,layoutManager,appHost,dom,browser,itemShortcuts){"use strict";function getCardsHtml(items,options){1===arguments.length&&(options=arguments[0],items=options.items);var html=buildCardsHtmlInternal(items,options);return html}function getPostersPerRow(shape,screenWidth){switch(shape){case"portrait":return screenWidth>=2200?10:screenWidth>=2100?9:screenWidth>=1600?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=800?5:screenWidth>=640?4:3;case"square":return screenWidth>=2100?9:screenWidth>=1800?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=900?5:screenWidth>=700?4:screenWidth>=500?3:2;case"banner":return screenWidth>=2200?4:screenWidth>=1200?3:screenWidth>=800?2:1;case"backdrop":return screenWidth>=2500?6:screenWidth>=1600?5:screenWidth>=1200?4:screenWidth>=770?3:screenWidth>=420?2:1;case"smallBackdrop":return screenWidth>=1440?8:screenWidth>=1100?6:screenWidth>=800?5:screenWidth>=600?4:screenWidth>=540?3:screenWidth>=420?2:1;case"overflowPortrait":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowSquare":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowBackdrop":return screenWidth>=1e3?2.5:screenWidth>=640?100/56:screenWidth>=540?1.5625:100/72;case"overflowSmallBackdrop":return screenWidth>=1200?100/18:screenWidth>=1e3?100/24:screenWidth>=770?100/30:screenWidth>=540?2.5:100/60;default:return 4}}function isResizable(windowWidth){var screen=window.screen;if(screen){var screenWidth=screen.availWidth;if(screenWidth-windowWidth>20)return!0}return!1}function getImageWidth(shape){var screenWidth=dom.getWindowSize().innerWidth;if(isResizable(screenWidth)){var roundScreenTo=100;screenWidth=Math.floor(screenWidth/roundScreenTo)*roundScreenTo}window.screen&&(screenWidth=Math.min(screenWidth,screen.availWidth||screenWidth));var imagesPerRow=getPostersPerRow(shape,screenWidth),shapeWidth=screenWidth/imagesPerRow;return Math.round(shapeWidth)}function setCardData(items,options){options.shape=options.shape||"auto";var primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio(items),isThumbAspectRatio=primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1.777777778)<.3,isSquareAspectRatio=primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1)<.33||primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1.3333334)<.01;"auto"!==options.shape&&"autohome"!==options.shape&&"autooverflow"!==options.shape&&"autoVertical"!==options.shape||(options.preferThumb===!0||isThumbAspectRatio?options.shape="autooverflow"===options.shape?"overflowBackdrop":"backdrop":isSquareAspectRatio?(options.coverImage=!0,options.shape="autooverflow"===options.shape?"overflowSquare":"square"):primaryImageAspectRatio&&primaryImageAspectRatio>1.9?(options.shape="banner",options.coverImage=!0):primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-.6666667)<.2?options.shape="autooverflow"===options.shape?"overflowPortrait":"portrait":options.shape=options.defaultShape||("autooverflow"===options.shape?"overflowSquare":"square")),"auto"===options.preferThumb&&(options.preferThumb="backdrop"===options.shape||"overflowBackdrop"===options.shape),options.uiAspect=getDesiredAspect(options.shape),options.primaryImageAspectRatio=primaryImageAspectRatio,!options.width&&options.widths&&(options.width=options.widths[options.shape]),options.rows&&"number"!=typeof options.rows&&(options.rows=options.rows[options.shape]),layoutManager.tv&&("backdrop"===options.shape?options.width=options.width||500:"portrait"===options.shape?options.width=options.width||256:"square"===options.shape?options.width=options.width||256:"banner"===options.shape&&(options.width=options.width||800)),options.width=options.width||getImageWidth(options.shape)}function buildCardsHtmlInternal(items,options){var isVertical;"autoVertical"===options.shape&&(isVertical=!0),options.vibrant&&!appHost.supports("imageanalysis")&&(options.vibrant=!1),setCardData(items,options);var className="card";options.shape&&(className+=" "+options.shape+"Card"),options.cardCssClass&&(className+=" "+options.cardCssClass);var currentIndexValue,hasOpenRow,hasOpenSection,apiClient,lastServerId,i,length,html="",itemsInRow=0,sectionTitleTagName=options.sectionTitleTagName||"div";for(i=0,length=items.length;i=.5?.5:0)+"+":null);newIndexValue!==currentIndexValue&&(hasOpenRow&&(html+="
",hasOpenRow=!1,itemsInRow=0),hasOpenSection&&(html+="
",isVertical&&(html+="
"),hasOpenSection=!1),html+=isVertical?'
':'
',html+="<"+sectionTitleTagName+' class="sectionTitle">'+newIndexValue+"",isVertical&&(html+='
'),currentIndexValue=newIndexValue,hasOpenSection=!0)}options.rows&&0===itemsInRow&&(hasOpenRow&&(html+="
",hasOpenRow=!1),html+='
',hasOpenRow=!0);var cardClass=className;html+=buildCard(i,item,apiClient,options,cardClass),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(html+="
",hasOpenRow=!1,itemsInRow=0)}if(hasOpenRow&&(html+="
"),hasOpenSection&&(html+="
",isVertical&&(html+="
")),options.leadingButtons)for(i=0,length=options.leadingButtons.length;i
'+options.leadingButtons[i].name+"
"+html;if(options.trailingButtons)for(i=0,length=options.trailingButtons.length;i
'+options.trailingButtons[i].name+"
";return html}function getDesiredAspect(shape){if(shape){if(shape=shape.toLowerCase(),shape.indexOf("portrait")!==-1)return 2/3;if(shape.indexOf("backdrop")!==-1)return 16/9;if(shape.indexOf("square")!==-1)return 1;if(shape.indexOf("banner")!==-1)return 1e3/185}return null}function getCardImageUrl(item,apiClient,options){var imageItem=item.ProgramInfo||item;item=imageItem;var width=options.width,height=null,primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio([item]),forceName=!1,imgUrl=null,coverImage=!1,uiAspect=null;return options.preferThumb&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):options.preferBanner&&item.ImageTags&&item.ImageTags.Banner?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Banner",maxWidth:width,tag:item.ImageTags.Banner}):options.preferThumb&&item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):options.preferThumb&&item.ParentThumbItemId&&options.inheritThumb!==!1&&"Photo"!==item.MediaType?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):options.preferThumb&&item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}),forceName=!0):item.ImageTags&&item.ImageTags.Primary?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.ImageTags.Primary}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):item.PrimaryImageTag?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.PrimaryImageItemId||item.Id||item.ItemId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.PrimaryImageTag}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):item.ParentPrimaryImageTag?imgUrl=apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId,{type:"Primary",maxWidth:width,tag:item.ParentPrimaryImageTag}):item.AlbumId&&item.AlbumPrimaryImageTag?(width=primaryImageAspectRatio?Math.round(height*primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.AlbumId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.AlbumPrimaryImageTag}),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):"Season"===item.Type&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.BackdropImageTags&&item.BackdropImageTags.length?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}):item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):item.ParentThumbItemId&&options.inheritThumb!==!1&&(imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag})),{imgUrl:imgUrl,forceName:forceName,coverImage:coverImage}}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getDefaultColorIndex(str){if(str){for(var charIndex=Math.floor(str.length/2),character=String(str.substr(charIndex,1).charCodeAt()),sum=0,i=0;i0&&isOuterFooter&&(currentCssClass+=" cardText-secondary"),addRightMargin&&(currentCssClass+=" cardText-rightmargin"),text&&(html+="
",html+=text,html+="
",valid++,maxLines&&valid>=maxLines))break}if(forceLines)for(length=Math.min(lines.length,maxLines||lines.length);valid 
",valid++;return html}function isUsingLiveTvNaming(item){return"Program"===item.Type||"Timer"===item.Type||"Recording"===item.Type}function getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerClass,progressHtml,isOuterFooter,cardFooterId,vibrantSwatch){var html="",showOtherText=isOuterFooter?!overlayText:overlayText;if(isOuterFooter&&options.cardLayout&&!layoutManager.tv&&"none"!==options.cardFooterAside){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='"}var titleAdded,cssClass=options.centerText?"cardText cardTextCentered":"cardText",lines=[],parentTitleUnderneath="MusicAlbum"===item.Type||"Audio"===item.Type||"MusicVideo"===item.Type;if(showOtherText&&(options.showParentTitle||options.showParentTitleOrTitle)&&!parentTitleUnderneath)if(isOuterFooter&&"Episode"===item.Type&&item.SeriesName&&item.SeriesId)lines.push(getTextActionButton({Id:item.SeriesId,ServerId:item.ServerId,Name:item.SeriesName,Type:"Series",IsFolder:!0}));else if(isUsingLiveTvNaming(item))lines.push(item.Name),item.IsSeries||(titleAdded=!0);else{var parentTitle=item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"";(parentTitle||showTitle)&&lines.push(parentTitle)}var showMediaTitle=showTitle&&!titleAdded||options.showParentTitleOrTitle&&!lines.length;if(showMediaTitle||titleAdded||!showTitle&&!forceName||(showMediaTitle=!0),showMediaTitle){var name="auto"!==options.showTitle||item.IsFolder||"Photo"!==item.MediaType?itemHelper.getDisplayName(item,{includeParentInfo:options.includeParentInfoInTitle}):"";lines.push(name)}if(showOtherText){if(options.showParentTitle&&parentTitleUnderneath&&(isOuterFooter&&item.AlbumArtists&&item.AlbumArtists.length?(item.AlbumArtists[0].Type="MusicArtist",item.AlbumArtists[0].IsFolder=!0,lines.push(getTextActionButton(item.AlbumArtists[0],null,item.ServerId))):lines.push(isUsingLiveTvNaming(item)?item.Name:item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"")),options.showItemCounts){var itemCountHtml=getItemCountsHtml(options,item);lines.push(itemCountHtml)}if(options.textLines)for(var additionalLines=options.textLines(item),i=0,length=additionalLines.length;i"+html,html+="
"}return html}function getTextActionButton(item,text,serverId){if(text||(text=itemHelper.getDisplayName(item)),layoutManager.tv)return text;var html=""}function getItemCountsHtml(options,item){var childText,counts=[];if("Playlist"===item.Type){if(childText="",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;minutes=minutes||1,childText+=globalize.translate("sharedcomponents#ValueMinutes",Math.round(minutes))}else childText+=globalize.translate("sharedcomponents#ValueMinutes",0);counts.push(childText)}else"Genre"===item.Type||"Studio"===item.Type?(item.MovieCount&&(childText=1===item.MovieCount?globalize.translate("sharedcomponents#ValueOneMovie"):globalize.translate("sharedcomponents#ValueMovieCount",item.MovieCount),counts.push(childText)),item.SeriesCount&&(childText=1===item.SeriesCount?globalize.translate("sharedcomponents#ValueOneSeries"):globalize.translate("sharedcomponents#ValueSeriesCount",item.SeriesCount),counts.push(childText)),item.EpisodeCount&&(childText=1===item.EpisodeCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.EpisodeCount),counts.push(childText)),item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText))):"GameGenre"===item.Type?item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText)):"MusicGenre"===item.Type||"MusicArtist"===options.context?(item.AlbumCount&&(childText=1===item.AlbumCount?globalize.translate("sharedcomponents#ValueOneAlbum"):globalize.translate("sharedcomponents#ValueAlbumCount",item.AlbumCount),counts.push(childText)),item.SongCount&&(childText=1===item.SongCount?globalize.translate("sharedcomponents#ValueOneSong"):globalize.translate("sharedcomponents#ValueSongCount",item.SongCount),counts.push(childText)),item.MusicVideoCount&&(childText=1===item.MusicVideoCount?globalize.translate("sharedcomponents#ValueOneMusicVideo"):globalize.translate("sharedcomponents#ValueMusicVideoCount",item.MusicVideoCount),counts.push(childText))):"Series"===item.Type&&(childText=1===item.RecursiveItemCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.RecursiveItemCount),counts.push(childText));return counts.join(", ")}function buildCard(index,item,apiClient,options,className){var action=options.action||"link",scalable=options.scalable!==!1;scalable&&(className+=" scalableCard "+options.shape+"Card-scalable");var imgInfo=getCardImageUrl(item,apiClient,options),imgUrl=imgInfo.imgUrl,forceName=imgInfo.forceName,showTitle="auto"===options.showTitle||(options.showTitle||"PhotoAlbum"===item.Type||"Folder"===item.Type),overlayText=options.overlayText;forceName&&!options.cardLayout&&null==overlayText&&(overlayText=!0);var cardImageContainerClass="cardImageContainer",coveredImage=options.coverImage||imgInfo.coverImage;coveredImage&&(cardImageContainerClass+=" coveredImage",("Photo"===item.MediaType||"PhotoAlbum"===item.Type||"Folder"===item.Type||item.ProgramInfo||"Program"===item.Type||"Recording"===item.Type)&&(cardImageContainerClass+=" coveredImage-noScale")),imgUrl||(cardImageContainerClass+=" "+getDefaultColorClass(item.Name));var separateCardBox=scalable,cardBoxClass=options.cardLayout?"cardBox visualCardBox":"cardBox";layoutManager.tv&&(cardBoxClass+=" cardBox-focustransform",!options.cardLayout&&separateCardBox||(cardBoxClass+=" card-focuscontent"));var footerCssClass,progressHtml=indicators.getProgressBarHtml(item),innerCardFooter="",footerOverlayed=!1,cardFooterId="cardFooter"+uniqueFooterIndex;uniqueFooterIndex++,overlayText?(footerCssClass=progressHtml?"innerCardFooter fullInnerCardFooter":"innerCardFooter",innerCardFooter+=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!1,cardFooterId),footerOverlayed=!0):progressHtml&&(innerCardFooter+='
',innerCardFooter+=progressHtml,innerCardFooter+="
",progressHtml="");var mediaSourceCount=item.MediaSourceCount||1;mediaSourceCount>1&&(innerCardFooter+='
'+mediaSourceCount+"
");var vibrantSwatch=options.vibrant&&imgUrl?imageLoader.getCachedVibrantInfo(imgUrl):null,outerCardFooter="";overlayText||footerOverlayed||(footerCssClass=options.cardLayout?"cardFooter":"cardFooter cardFooter-transparent",outerCardFooter=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!0,cardFooterId,vibrantSwatch)),outerCardFooter&&!options.cardLayout&&options.allowBottomPadding!==!1&&(cardBoxClass+=" cardBox-bottompadded"),separateCardBox||(cardImageContainerClass+=" "+cardBoxClass);var overlayButtons="";if(!layoutManager.tv){var overlayPlayButton=options.overlayPlayButton;if(null!=overlayPlayButton||options.overlayMoreButton||options.cardLayout||(overlayPlayButton="Video"===item.MediaType),!overlayPlayButton||item.IsPlaceHolder||"Virtual"===item.LocationType&&item.MediaType&&"Program"!==item.Type||"Person"===item.Type||(overlayButtons+=''),options.overlayMoreButton){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";overlayButtons+='"}}options.showChildCountIndicator&&item.ChildCount&&(className+=" groupedCard");var cardImageContainerOpen,cardImageContainerClose="",cardBoxClose="",cardContentClose="",cardScalableClose="";if(separateCardBox){var cardContentOpen,cardContentClass="cardContent";options.cardLayout||(cardContentClass+=" cardContent-shadow"),layoutManager.tv?(cardContentOpen='
',cardContentClose="
"):(cardContentOpen='");var vibrantAttributes=options.vibrant&&imgUrl&&!vibrantSwatch?' data-vibrant="'+cardFooterId+'" data-swatch="db"':"";if(vibrantAttributes&&!browser.safari){cardImageContainerOpen='
';var imgClass="cardImage cardImage-img lazy";coveredImage&&(imgClass+=1===devicePixelRatio?" coveredImage-noscale-img":" coveredImage-img"),cardImageContainerOpen+=''}else cardImageContainerOpen=imgUrl?'
':'
';var cardScalableClass="cardScalable";layoutManager.tv&&!options.cardLayout&&(cardScalableClass+=" card-focuscontent"),cardImageContainerOpen='
'+cardContentOpen+cardImageContainerOpen,cardBoxClose="
",cardScalableClose="
",cardImageContainerClose="
"}else overlayButtons&&!separateCardBox?(cardImageContainerClass+=" cardImageContainerClass-button",cardImageContainerOpen=imgUrl?'",className+=" forceRelative"):(cardImageContainerOpen=imgUrl?'
':'
',cardImageContainerClose="
");var indicatorsHtml="";if(indicatorsHtml+=indicators.getSyncIndicator(item),indicatorsHtml+=indicators.getTimerIndicator(item),indicatorsHtml+=options.showGroupCount?indicators.getChildCountIndicatorHtml(item,{minCount:1}):indicators.getPlayedIndicatorHtml(item),indicatorsHtml&&(cardImageContainerOpen+='
'+indicatorsHtml+"
"),!imgUrl){var defaultName=isUsingLiveTvNaming(item)?item.Name:itemHelper.getDisplayName(item);cardImageContainerOpen+='
'+defaultName+"
"}var tagName=!layoutManager.tv&&scalable||overlayButtons?"div":"button",nameWithPrefix=item.SortName||item.Name||"",prefix=nameWithPrefix.substring(0,Math.min(3,nameWithPrefix.length));prefix&&(prefix=prefix.toUpperCase());var timerAttributes="";item.TimerId&&(timerAttributes+=' data-timerid="'+item.TimerId+'"'),item.SeriesTimerId&&(timerAttributes+=' data-seriestimerid="'+item.SeriesTimerId+'"');var actionAttribute;"button"===tagName?(className+=" itemAction",actionAttribute=' data-action="'+action+'"'):actionAttribute="","MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type&&"Audio"!==item.Type&&(className+=" card-withuserdata");var positionTicksData=item.UserData&&item.UserData.PlaybackPositionTicks?' data-positionticks="'+item.UserData.PlaybackPositionTicks+'"':"",collectionIdData=options.collectionId?' data-collectionid="'+options.collectionId+'"':"",playlistIdData=options.playlistId?' data-playlistid="'+options.playlistId+'"':"",mediaTypeData=item.MediaType?' data-mediatype="'+item.MediaType+'"':"",collectionTypeData=item.CollectionType?' data-collectiontype="'+item.CollectionType+'"':"",channelIdData=item.ChannelId?' data-channelid="'+item.ChannelId+'"':"",contextData=options.context?' data-context="'+options.context+'"':"",parentIdData=options.parentId?' data-parentid="'+options.parentId+'"':"";return"<"+tagName+' data-index="'+index+'"'+timerAttributes+actionAttribute+' data-isfolder="'+(item.IsFolder||!1)+'" data-serverid="'+(item.ServerId||options.serverId)+'" data-id="'+(item.Id||item.ItemId)+'" data-type="'+item.Type+'"'+mediaTypeData+collectionTypeData+channelIdData+positionTicksData+collectionIdData+playlistIdData+contextData+parentIdData+' data-prefix="'+prefix+'" class="'+className+'">'+cardImageContainerOpen+innerCardFooter+cardImageContainerClose+cardContentClose+overlayButtons+cardScalableClose+outerCardFooter+cardBoxClose+""}function buildCards(items,options){if(document.body.contains(options.itemsContainer)){if(options.parentContainer){if(!items.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildCardsHtmlInternal(items,options);html?(options.itemsContainer.cardBuilderHtml!==html&&(options.itemsContainer.innerHTML=html,items.length<50?options.itemsContainer.cardBuilderHtml=html:options.itemsContainer.cardBuilderHtml=null),imageLoader.lazyChildren(options.itemsContainer)):(options.itemsContainer.innerHTML=html,options.itemsContainer.cardBuilderHtml=null),options.autoFocus&&focusManager.autoFocus(options.itemsContainer,!0)}}function ensureIndicators(card,indicatorsElem){if(indicatorsElem)return indicatorsElem;if(indicatorsElem=card.querySelector(".cardIndicators"),!indicatorsElem){var cardImageContainer=card.querySelector(".cardImageContainer");indicatorsElem=document.createElement("div"),indicatorsElem.classList.add("cardIndicators"),cardImageContainer.appendChild(indicatorsElem)}return indicatorsElem}function updateUserData(card,userData){var type=card.getAttribute("data-type"),enableCountIndicator="Series"===type||"BoxSet"===type||"Season"===type,indicatorsElem=null,playedIndicator=null,countIndicator=null,itemProgressBar=null;userData.Played?(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator||(playedIndicator=document.createElement("div"),playedIndicator.classList.add("playedIndicator"),playedIndicator.classList.add("indicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(playedIndicator)),playedIndicator.innerHTML='check'):(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator&&playedIndicator.parentNode.removeChild(playedIndicator)),userData.UnplayedItemCount?(countIndicator=card.querySelector(".countIndicator"),countIndicator||(countIndicator=document.createElement("div"),countIndicator.classList.add("countIndicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(countIndicator)),countIndicator.innerHTML=userData.UnplayedItemCount):enableCountIndicator&&(countIndicator=card.querySelector(".countIndicator"),countIndicator&&countIndicator.parentNode.removeChild(countIndicator));var progressHtml=indicators.getProgressBarHtml({Type:type,UserData:userData,MediaType:"Video"});if(progressHtml){if(itemProgressBar=card.querySelector(".itemProgressBar"),!itemProgressBar){itemProgressBar=document.createElement("div"),itemProgressBar.classList.add("itemProgressBar");var innerCardFooter=card.querySelector(".innerCardFooter");if(!innerCardFooter){innerCardFooter=document.createElement("div"),innerCardFooter.classList.add("innerCardFooter");var cardImageContainer=card.querySelector(".cardImageContainer");cardImageContainer.appendChild(innerCardFooter)}innerCardFooter.appendChild(itemProgressBar)}itemProgressBar.innerHTML=progressHtml}else itemProgressBar=card.querySelector(".itemProgressBar"),itemProgressBar&&itemProgressBar.parentNode.removeChild(itemProgressBar)}function onUserDataChanged(userData,scope){for(var cards=(scope||document.body).querySelectorAll('.card-withuserdata[data-id="'+userData.ItemId+'"]'),i=0,length=cards.length;i'); +define(["datetime","imageLoader","connectionManager","itemHelper","focusManager","indicators","globalize","layoutManager","apphost","dom","browser","itemShortcuts","css!./card","paper-icon-button-light","clearButtonStyle"],function(datetime,imageLoader,connectionManager,itemHelper,focusManager,indicators,globalize,layoutManager,appHost,dom,browser,itemShortcuts){"use strict";function getCardsHtml(items,options){1===arguments.length&&(options=arguments[0],items=options.items);var html=buildCardsHtmlInternal(items,options);return html}function getPostersPerRow(shape,screenWidth){switch(shape){case"portrait":return screenWidth>=2200?10:screenWidth>=2100?9:screenWidth>=1600?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=800?5:screenWidth>=640?4:3;case"square":return screenWidth>=2100?9:screenWidth>=1800?8:screenWidth>=1400?7:screenWidth>=1200?6:screenWidth>=900?5:screenWidth>=700?4:screenWidth>=500?3:2;case"banner":return screenWidth>=2200?4:screenWidth>=1200?3:screenWidth>=800?2:1;case"backdrop":return screenWidth>=2500?6:screenWidth>=1600?5:screenWidth>=1200?4:screenWidth>=770?3:screenWidth>=420?2:1;case"smallBackdrop":return screenWidth>=1440?8:screenWidth>=1100?6:screenWidth>=800?5:screenWidth>=600?4:screenWidth>=540?3:screenWidth>=420?2:1;case"overflowPortrait":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowSquare":return screenWidth>=1e3?100/22:screenWidth>=540?100/30:100/42;case"overflowBackdrop":return screenWidth>=1e3?2.5:screenWidth>=640?100/56:screenWidth>=540?1.5625:100/72;case"overflowSmallBackdrop":return screenWidth>=1200?100/18:screenWidth>=1e3?100/24:screenWidth>=770?100/30:screenWidth>=540?2.5:100/60;default:return 4}}function isResizable(windowWidth){var screen=window.screen;if(screen){var screenWidth=screen.availWidth;if(screenWidth-windowWidth>20)return!0}return!1}function getImageWidth(shape){var screenWidth=dom.getWindowSize().innerWidth;if(isResizable(screenWidth)){var roundScreenTo=100;screenWidth=Math.floor(screenWidth/roundScreenTo)*roundScreenTo}window.screen&&(screenWidth=Math.min(screenWidth,screen.availWidth||screenWidth));var imagesPerRow=getPostersPerRow(shape,screenWidth),shapeWidth=screenWidth/imagesPerRow;return Math.round(shapeWidth)}function setCardData(items,options){options.shape=options.shape||"auto";var primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio(items),isThumbAspectRatio=primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1.777777778)<.3,isSquareAspectRatio=primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1)<.33||primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-1.3333334)<.01;"auto"!==options.shape&&"autohome"!==options.shape&&"autooverflow"!==options.shape&&"autoVertical"!==options.shape||(options.preferThumb===!0||isThumbAspectRatio?options.shape="autooverflow"===options.shape?"overflowBackdrop":"backdrop":isSquareAspectRatio?(options.coverImage=!0,options.shape="autooverflow"===options.shape?"overflowSquare":"square"):primaryImageAspectRatio&&primaryImageAspectRatio>1.9?(options.shape="banner",options.coverImage=!0):primaryImageAspectRatio&&Math.abs(primaryImageAspectRatio-.6666667)<.2?options.shape="autooverflow"===options.shape?"overflowPortrait":"portrait":options.shape=options.defaultShape||("autooverflow"===options.shape?"overflowSquare":"square")),"auto"===options.preferThumb&&(options.preferThumb="backdrop"===options.shape||"overflowBackdrop"===options.shape),options.uiAspect=getDesiredAspect(options.shape),options.primaryImageAspectRatio=primaryImageAspectRatio,!options.width&&options.widths&&(options.width=options.widths[options.shape]),options.rows&&"number"!=typeof options.rows&&(options.rows=options.rows[options.shape]),layoutManager.tv&&("backdrop"===options.shape?options.width=options.width||500:"portrait"===options.shape?options.width=options.width||256:"square"===options.shape?options.width=options.width||256:"banner"===options.shape&&(options.width=options.width||800)),options.width=options.width||getImageWidth(options.shape)}function buildCardsHtmlInternal(items,options){var isVertical;"autoVertical"===options.shape&&(isVertical=!0),options.vibrant&&!appHost.supports("imageanalysis")&&(options.vibrant=!1),setCardData(items,options);var className="card";options.shape&&(className+=" "+options.shape+"Card"),options.cardCssClass&&(className+=" "+options.cardCssClass);var currentIndexValue,hasOpenRow,hasOpenSection,apiClient,lastServerId,i,length,html="",itemsInRow=0,sectionTitleTagName=options.sectionTitleTagName||"div";for(i=0,length=items.length;i=.5?.5:0)+"+":null);newIndexValue!==currentIndexValue&&(hasOpenRow&&(html+="
",hasOpenRow=!1,itemsInRow=0),hasOpenSection&&(html+="
",isVertical&&(html+="
"),hasOpenSection=!1),html+=isVertical?'
':'
',html+="<"+sectionTitleTagName+' class="sectionTitle">'+newIndexValue+"",isVertical&&(html+='
'),currentIndexValue=newIndexValue,hasOpenSection=!0)}options.rows&&0===itemsInRow&&(hasOpenRow&&(html+="
",hasOpenRow=!1),html+='
',hasOpenRow=!0);var cardClass=className;html+=buildCard(i,item,apiClient,options,cardClass),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(html+="
",hasOpenRow=!1,itemsInRow=0)}if(hasOpenRow&&(html+="
"),hasOpenSection&&(html+="
",isVertical&&(html+="
")),options.leadingButtons)for(i=0,length=options.leadingButtons.length;i
'+options.leadingButtons[i].name+"
"+html;if(options.trailingButtons)for(i=0,length=options.trailingButtons.length;i
'+options.trailingButtons[i].name+"
";return html}function getDesiredAspect(shape){if(shape){if(shape=shape.toLowerCase(),shape.indexOf("portrait")!==-1)return 2/3;if(shape.indexOf("backdrop")!==-1)return 16/9;if(shape.indexOf("square")!==-1)return 1;if(shape.indexOf("banner")!==-1)return 1e3/185}return null}function getCardImageUrl(item,apiClient,options){var imageItem=item.ProgramInfo||item;item=imageItem;var width=options.width,height=null,primaryImageAspectRatio=imageLoader.getPrimaryImageAspectRatio([item]),forceName=!1,imgUrl=null,coverImage=!1,uiAspect=null;return options.preferThumb&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):options.preferBanner&&item.ImageTags&&item.ImageTags.Banner?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Banner",maxWidth:width,tag:item.ImageTags.Banner}):options.preferThumb&&item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):options.preferThumb&&item.ParentThumbItemId&&options.inheritThumb!==!1&&"Photo"!==item.MediaType?imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag}):options.preferThumb&&item.BackdropImageTags&&item.BackdropImageTags.length?(imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}),forceName=!0):item.ImageTags&&item.ImageTags.Primary?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.ImageTags.Primary}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):item.PrimaryImageTag?(height=width&&primaryImageAspectRatio?Math.round(width/primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.PrimaryImageItemId||item.Id||item.ItemId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.PrimaryImageTag}),options.preferThumb&&options.showTitle!==!1&&(forceName=!0),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):item.ParentPrimaryImageTag?imgUrl=apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId,{type:"Primary",maxWidth:width,tag:item.ParentPrimaryImageTag}):item.AlbumId&&item.AlbumPrimaryImageTag?(width=primaryImageAspectRatio?Math.round(height*primaryImageAspectRatio):null,imgUrl=apiClient.getScaledImageUrl(item.AlbumId,{type:"Primary",maxHeight:height,maxWidth:width,tag:item.AlbumPrimaryImageTag}),primaryImageAspectRatio&&(uiAspect=getDesiredAspect(options.shape),uiAspect&&(coverImage=Math.abs(primaryImageAspectRatio-uiAspect)<=.2))):"Season"===item.Type&&item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.BackdropImageTags&&item.BackdropImageTags.length?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Backdrop",maxWidth:width,tag:item.BackdropImageTags[0]}):item.ImageTags&&item.ImageTags.Thumb?imgUrl=apiClient.getScaledImageUrl(item.Id,{type:"Thumb",maxWidth:width,tag:item.ImageTags.Thumb}):item.SeriesThumbImageTag&&options.inheritThumb!==!1?imgUrl=apiClient.getScaledImageUrl(item.SeriesId,{type:"Thumb",maxWidth:width,tag:item.SeriesThumbImageTag}):item.ParentThumbItemId&&options.inheritThumb!==!1&&(imgUrl=apiClient.getScaledImageUrl(item.ParentThumbItemId,{type:"Thumb",maxWidth:width,tag:item.ParentThumbImageTag})),{imgUrl:imgUrl,forceName:forceName,coverImage:coverImage}}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getDefaultColorIndex(str){if(str){for(var charIndex=Math.floor(str.length/2),character=String(str.substr(charIndex,1).charCodeAt()),sum=0,i=0;i0&&isOuterFooter&&(currentCssClass+=" cardText-secondary"),addRightMargin&&(currentCssClass+=" cardText-rightmargin"),text&&(html+="
",html+=text,html+="
",valid++,maxLines&&valid>=maxLines))break}if(forceLines)for(length=Math.min(lines.length,maxLines||lines.length);valid 
",valid++;return html}function isUsingLiveTvNaming(item){return"Program"===item.Type||"Timer"===item.Type||"Recording"===item.Type}function getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerClass,progressHtml,isOuterFooter,cardFooterId,vibrantSwatch){var html="",showOtherText=isOuterFooter?!overlayText:overlayText;if(isOuterFooter&&options.cardLayout&&!layoutManager.tv&&"none"!==options.cardFooterAside){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='"}var titleAdded,cssClass=options.centerText?"cardText cardTextCentered":"cardText",lines=[],parentTitleUnderneath="MusicAlbum"===item.Type||"Audio"===item.Type||"MusicVideo"===item.Type;if(showOtherText&&(options.showParentTitle||options.showParentTitleOrTitle)&&!parentTitleUnderneath)if(isOuterFooter&&"Episode"===item.Type&&item.SeriesName&&item.SeriesId)lines.push(getTextActionButton({Id:item.SeriesId,ServerId:item.ServerId,Name:item.SeriesName,Type:"Series",IsFolder:!0}));else if(isUsingLiveTvNaming(item))lines.push(item.Name),item.IsSeries||(titleAdded=!0);else{var parentTitle=item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"";(parentTitle||showTitle)&&lines.push(parentTitle)}var showMediaTitle=showTitle&&!titleAdded||options.showParentTitleOrTitle&&!lines.length;if(showMediaTitle||titleAdded||!showTitle&&!forceName||(showMediaTitle=!0),showMediaTitle){var name="auto"!==options.showTitle||item.IsFolder||"Photo"!==item.MediaType?itemHelper.getDisplayName(item,{includeParentInfo:options.includeParentInfoInTitle}):"";lines.push(name)}if(showOtherText){if(options.showParentTitle&&parentTitleUnderneath&&(isOuterFooter&&item.AlbumArtists&&item.AlbumArtists.length?(item.AlbumArtists[0].Type="MusicArtist",item.AlbumArtists[0].IsFolder=!0,lines.push(getTextActionButton(item.AlbumArtists[0],null,item.ServerId))):lines.push(isUsingLiveTvNaming(item)?item.Name:item.SeriesName||item.Series||item.Album||item.AlbumArtist||item.GameSystem||"")),options.showItemCounts){var itemCountHtml=getItemCountsHtml(options,item);lines.push(itemCountHtml)}if(options.textLines)for(var additionalLines=options.textLines(item),i=0,length=additionalLines.length;i"+html,html+="
"}return html}function getTextActionButton(item,text,serverId){if(text||(text=itemHelper.getDisplayName(item)),layoutManager.tv)return text;var html=""}function getItemCountsHtml(options,item){var childText,counts=[];if("Playlist"===item.Type){if(childText="",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;minutes=minutes||1,childText+=globalize.translate("sharedcomponents#ValueMinutes",Math.round(minutes))}else childText+=globalize.translate("sharedcomponents#ValueMinutes",0);counts.push(childText)}else"Genre"===item.Type||"Studio"===item.Type?(item.MovieCount&&(childText=1===item.MovieCount?globalize.translate("sharedcomponents#ValueOneMovie"):globalize.translate("sharedcomponents#ValueMovieCount",item.MovieCount),counts.push(childText)),item.SeriesCount&&(childText=1===item.SeriesCount?globalize.translate("sharedcomponents#ValueOneSeries"):globalize.translate("sharedcomponents#ValueSeriesCount",item.SeriesCount),counts.push(childText)),item.EpisodeCount&&(childText=1===item.EpisodeCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.EpisodeCount),counts.push(childText)),item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText))):"GameGenre"===item.Type?item.GameCount&&(childText=1===item.GameCount?globalize.translate("sharedcomponents#ValueOneGame"):globalize.translate("sharedcomponents#ValueGameCount",item.GameCount),counts.push(childText)):"MusicGenre"===item.Type||"MusicArtist"===options.context?(item.AlbumCount&&(childText=1===item.AlbumCount?globalize.translate("sharedcomponents#ValueOneAlbum"):globalize.translate("sharedcomponents#ValueAlbumCount",item.AlbumCount),counts.push(childText)),item.SongCount&&(childText=1===item.SongCount?globalize.translate("sharedcomponents#ValueOneSong"):globalize.translate("sharedcomponents#ValueSongCount",item.SongCount),counts.push(childText)),item.MusicVideoCount&&(childText=1===item.MusicVideoCount?globalize.translate("sharedcomponents#ValueOneMusicVideo"):globalize.translate("sharedcomponents#ValueMusicVideoCount",item.MusicVideoCount),counts.push(childText))):"Series"===item.Type&&(childText=1===item.RecursiveItemCount?globalize.translate("sharedcomponents#ValueOneEpisode"):globalize.translate("sharedcomponents#ValueEpisodeCount",item.RecursiveItemCount),counts.push(childText));return counts.join(", ")}function buildCard(index,item,apiClient,options,className){var action=options.action||"link",scalable=options.scalable!==!1;scalable&&(className+=" scalableCard "+options.shape+"Card-scalable");var imgInfo=getCardImageUrl(item,apiClient,options),imgUrl=imgInfo.imgUrl,forceName=imgInfo.forceName,showTitle="auto"===options.showTitle||(options.showTitle||"PhotoAlbum"===item.Type||"Folder"===item.Type),overlayText=options.overlayText;forceName&&!options.cardLayout&&null==overlayText&&(overlayText=!0);var cardImageContainerClass="cardImageContainer",coveredImage=options.coverImage||imgInfo.coverImage;coveredImage&&(cardImageContainerClass+=" coveredImage",("Photo"===item.MediaType||"PhotoAlbum"===item.Type||"Folder"===item.Type||item.ProgramInfo||"Program"===item.Type||"Recording"===item.Type)&&(cardImageContainerClass+=" coveredImage-noScale")),imgUrl||(cardImageContainerClass+=" "+getDefaultColorClass(item.Name));var separateCardBox=scalable,cardBoxClass=options.cardLayout?"cardBox visualCardBox":"cardBox";layoutManager.tv&&(browser.slow||(cardBoxClass+=" cardBox-focustransform"),!options.cardLayout&&separateCardBox||(cardBoxClass+=" card-focuscontent"));var footerCssClass,progressHtml=indicators.getProgressBarHtml(item),innerCardFooter="",footerOverlayed=!1,cardFooterId="cardFooter"+uniqueFooterIndex;uniqueFooterIndex++,overlayText?(footerCssClass=progressHtml?"innerCardFooter fullInnerCardFooter":"innerCardFooter",innerCardFooter+=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!1,cardFooterId),footerOverlayed=!0):progressHtml&&(innerCardFooter+='
',innerCardFooter+=progressHtml,innerCardFooter+="
",progressHtml="");var mediaSourceCount=item.MediaSourceCount||1;mediaSourceCount>1&&(innerCardFooter+='
'+mediaSourceCount+"
");var vibrantSwatch=options.vibrant&&imgUrl?imageLoader.getCachedVibrantInfo(imgUrl):null,outerCardFooter="";overlayText||footerOverlayed||(footerCssClass=options.cardLayout?"cardFooter":"cardFooter cardFooter-transparent",outerCardFooter=getCardFooterText(item,apiClient,options,showTitle,forceName,overlayText,imgUrl,footerCssClass,progressHtml,!0,cardFooterId,vibrantSwatch)),outerCardFooter&&!options.cardLayout&&options.allowBottomPadding!==!1&&(cardBoxClass+=" cardBox-bottompadded"),separateCardBox||(cardImageContainerClass+=" "+cardBoxClass);var overlayButtons="";if(!layoutManager.tv){var overlayPlayButton=options.overlayPlayButton;if(null!=overlayPlayButton||options.overlayMoreButton||options.cardLayout||(overlayPlayButton="Video"===item.MediaType),!overlayPlayButton||item.IsPlaceHolder||"Virtual"===item.LocationType&&item.MediaType&&"Program"!==item.Type||"Person"===item.Type||(overlayButtons+=''),options.overlayMoreButton){var moreIcon="dots-horiz"===appHost.moreIcon?"":"";overlayButtons+='"}}options.showChildCountIndicator&&item.ChildCount&&(className+=" groupedCard");var cardImageContainerOpen,cardImageContainerClose="",cardBoxClose="",cardContentClose="",cardScalableClose="";if(separateCardBox){var cardContentOpen,cardContentClass="cardContent";options.cardLayout||(cardContentClass+=" cardContent-shadow"),layoutManager.tv?(cardContentOpen='
',cardContentClose="
"):(cardContentOpen='");var vibrantAttributes=options.vibrant&&imgUrl&&!vibrantSwatch?' data-vibrant="'+cardFooterId+'" data-swatch="db"':"";if(vibrantAttributes&&!browser.safari){cardImageContainerOpen='
';var imgClass="cardImage cardImage-img lazy";coveredImage&&(imgClass+=1===devicePixelRatio?" coveredImage-noscale-img":" coveredImage-img"),cardImageContainerOpen+=''}else cardImageContainerOpen=imgUrl?'
':'
';var cardScalableClass="cardScalable";layoutManager.tv&&!options.cardLayout&&(cardScalableClass+=" card-focuscontent"),cardImageContainerOpen='
'+cardContentOpen+cardImageContainerOpen,cardBoxClose="
",cardScalableClose="
",cardImageContainerClose="
"}else overlayButtons&&!separateCardBox?(cardImageContainerClass+=" cardImageContainerClass-button",cardImageContainerOpen=imgUrl?'",className+=" forceRelative"):(cardImageContainerOpen=imgUrl?'
':'
',cardImageContainerClose="
");var indicatorsHtml="";if(indicatorsHtml+=indicators.getSyncIndicator(item),indicatorsHtml+=indicators.getTimerIndicator(item),indicatorsHtml+=options.showGroupCount?indicators.getChildCountIndicatorHtml(item,{minCount:1}):indicators.getPlayedIndicatorHtml(item),indicatorsHtml&&(cardImageContainerOpen+='
'+indicatorsHtml+"
"),!imgUrl){var defaultName=isUsingLiveTvNaming(item)?item.Name:itemHelper.getDisplayName(item);cardImageContainerOpen+='
'+defaultName+"
"}var tagName=!layoutManager.tv&&scalable||overlayButtons?"div":"button",nameWithPrefix=item.SortName||item.Name||"",prefix=nameWithPrefix.substring(0,Math.min(3,nameWithPrefix.length));prefix&&(prefix=prefix.toUpperCase());var timerAttributes="";item.TimerId&&(timerAttributes+=' data-timerid="'+item.TimerId+'"'),item.SeriesTimerId&&(timerAttributes+=' data-seriestimerid="'+item.SeriesTimerId+'"');var actionAttribute;"button"===tagName?(className+=" itemAction",actionAttribute=' data-action="'+action+'"'):actionAttribute="","MusicAlbum"!==item.Type&&"MusicArtist"!==item.Type&&"Audio"!==item.Type&&(className+=" card-withuserdata");var positionTicksData=item.UserData&&item.UserData.PlaybackPositionTicks?' data-positionticks="'+item.UserData.PlaybackPositionTicks+'"':"",collectionIdData=options.collectionId?' data-collectionid="'+options.collectionId+'"':"",playlistIdData=options.playlistId?' data-playlistid="'+options.playlistId+'"':"",mediaTypeData=item.MediaType?' data-mediatype="'+item.MediaType+'"':"",collectionTypeData=item.CollectionType?' data-collectiontype="'+item.CollectionType+'"':"",channelIdData=item.ChannelId?' data-channelid="'+item.ChannelId+'"':"",contextData=options.context?' data-context="'+options.context+'"':"",parentIdData=options.parentId?' data-parentid="'+options.parentId+'"':"";return"<"+tagName+' data-index="'+index+'"'+timerAttributes+actionAttribute+' data-isfolder="'+(item.IsFolder||!1)+'" data-serverid="'+(item.ServerId||options.serverId)+'" data-id="'+(item.Id||item.ItemId)+'" data-type="'+item.Type+'"'+mediaTypeData+collectionTypeData+channelIdData+positionTicksData+collectionIdData+playlistIdData+contextData+parentIdData+' data-prefix="'+prefix+'" class="'+className+'">'+cardImageContainerOpen+innerCardFooter+cardImageContainerClose+cardContentClose+overlayButtons+cardScalableClose+outerCardFooter+cardBoxClose+""}function buildCards(items,options){if(document.body.contains(options.itemsContainer)){if(options.parentContainer){if(!items.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildCardsHtmlInternal(items,options);html?(options.itemsContainer.cardBuilderHtml!==html&&(options.itemsContainer.innerHTML=html,items.length<50?options.itemsContainer.cardBuilderHtml=html:options.itemsContainer.cardBuilderHtml=null),imageLoader.lazyChildren(options.itemsContainer)):(options.itemsContainer.innerHTML=html,options.itemsContainer.cardBuilderHtml=null),options.autoFocus&&focusManager.autoFocus(options.itemsContainer,!0)}}function ensureIndicators(card,indicatorsElem){if(indicatorsElem)return indicatorsElem;if(indicatorsElem=card.querySelector(".cardIndicators"),!indicatorsElem){var cardImageContainer=card.querySelector(".cardImageContainer");indicatorsElem=document.createElement("div"),indicatorsElem.classList.add("cardIndicators"),cardImageContainer.appendChild(indicatorsElem)}return indicatorsElem}function updateUserData(card,userData){var type=card.getAttribute("data-type"),enableCountIndicator="Series"===type||"BoxSet"===type||"Season"===type,indicatorsElem=null,playedIndicator=null,countIndicator=null,itemProgressBar=null;userData.Played?(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator||(playedIndicator=document.createElement("div"),playedIndicator.classList.add("playedIndicator"),playedIndicator.classList.add("indicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(playedIndicator)),playedIndicator.innerHTML='check'):(playedIndicator=card.querySelector(".playedIndicator"),playedIndicator&&playedIndicator.parentNode.removeChild(playedIndicator)),userData.UnplayedItemCount?(countIndicator=card.querySelector(".countIndicator"),countIndicator||(countIndicator=document.createElement("div"),countIndicator.classList.add("countIndicator"),indicatorsElem=ensureIndicators(card,indicatorsElem),indicatorsElem.appendChild(countIndicator)),countIndicator.innerHTML=userData.UnplayedItemCount):enableCountIndicator&&(countIndicator=card.querySelector(".countIndicator"),countIndicator&&countIndicator.parentNode.removeChild(countIndicator));var progressHtml=indicators.getProgressBarHtml({Type:type,UserData:userData,MediaType:"Video"});if(progressHtml){if(itemProgressBar=card.querySelector(".itemProgressBar"),!itemProgressBar){itemProgressBar=document.createElement("div"),itemProgressBar.classList.add("itemProgressBar");var innerCardFooter=card.querySelector(".innerCardFooter");if(!innerCardFooter){innerCardFooter=document.createElement("div"),innerCardFooter.classList.add("innerCardFooter");var cardImageContainer=card.querySelector(".cardImageContainer");cardImageContainer.appendChild(innerCardFooter)}innerCardFooter.appendChild(itemProgressBar)}itemProgressBar.innerHTML=progressHtml}else itemProgressBar=card.querySelector(".itemProgressBar"),itemProgressBar&&itemProgressBar.parentNode.removeChild(itemProgressBar)}function onUserDataChanged(userData,scope){for(var cards=(scope||document.body).querySelectorAll('.card-withuserdata[data-id="'+userData.ItemId+'"]'),i=0,length=cards.length;i'); }cell.setAttribute("data-timerid",newTimerId)}}function onTimerCancelled(id,itemsContainer){for(var cells=itemsContainer.querySelectorAll('.card[data-timerid="'+id+'"]'),i=0,length=cells.length;i');var chapter=chapters[i];html+=buildChapterCard(item,apiClient,chapter,i,options,className,shape),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(itemsInRow=0,html+="
")}return html}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function buildChapterCard(item,apiClient,chapter,index,options,className,shape){var imgUrl=getImgUrl(item,chapter,index,options.width||400,apiClient),cardImageContainerClass="cardImageContainer chapterCardImageContainer";options.coverImage&&(cardImageContainerClass+=" coveredImage");var dataAttributes=' data-action="play" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'" data-mediatype="'+item.MediaType+'" data-positionticks="'+chapter.StartPositionTicks+'"',cardImageContainer=imgUrl?'
':'
';imgUrl||(cardImageContainer+='local_movies');var nameHtml="";nameHtml+='
'+chapter.Name+"
",nameHtml+='
'+datetime.getDisplayRunningTime(chapter.StartPositionTicks)+"
";var cardBoxCssClass="cardBox";layoutManager.tv&&(cardBoxCssClass+=" cardBox-focustransform card-focuscontent");var html='
";return html}function buildChapterCards(item,chapters,options){if(options.parentContainer){if(!document.body.contains(options.parentContainer))return;if(!chapters.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildChapterCardsHtml(item,chapters,options);options.itemsContainer.innerHTML=html,imageLoader.lazyChildren(options.itemsContainer)}return{buildChapterCards:buildChapterCards}}); \ No newline at end of file +define(["datetime","imageLoader","connectionManager","layoutManager","browser"],function(datetime,imageLoader,connectionManager,layoutManager,browser){"use strict";function buildChapterCardsHtml(item,chapters,options){var className="card scalableCard itemAction chapterCard";layoutManager.tv&&(browser.animate||browser.edge)&&(className+=" card-focusscale");var mediaStreams=((item.MediaSources||[])[0]||{}).MediaStreams||[],videoStream=mediaStreams.filter(function(i){return"Video"===i.Type})[0]||{},shape=options.backdropShape||"backdrop";videoStream.Width&&videoStream.Height&&videoStream.Width/videoStream.Height<=1.2&&(shape=options.squareShape||"square"),className+=" "+shape+"Card",className+=" "+shape+"Card-scalable",(options.block||options.rows)&&(className+=" block");for(var html="",itemsInRow=0,apiClient=connectionManager.getApiClient(item.ServerId),i=0,length=chapters.length;i');var chapter=chapters[i];html+=buildChapterCard(item,apiClient,chapter,i,options,className,shape),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(itemsInRow=0,html+="
")}return html}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function buildChapterCard(item,apiClient,chapter,index,options,className,shape){var imgUrl=getImgUrl(item,chapter,index,options.width||400,apiClient),cardImageContainerClass="cardImageContainer chapterCardImageContainer";options.coverImage&&(cardImageContainerClass+=" coveredImage");var dataAttributes=' data-action="play" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'" data-mediatype="'+item.MediaType+'" data-positionticks="'+chapter.StartPositionTicks+'"',cardImageContainer=imgUrl?'
':'
';imgUrl||(cardImageContainer+='local_movies');var nameHtml="";nameHtml+='
'+chapter.Name+"
",nameHtml+='
'+datetime.getDisplayRunningTime(chapter.StartPositionTicks)+"
";var cardBoxCssClass="cardBox";layoutManager.tv&&!browser.slow&&(cardBoxCssClass+=" cardBox-focustransform card-focuscontent");var html='
";return html}function buildChapterCards(item,chapters,options){if(options.parentContainer){if(!document.body.contains(options.parentContainer))return;if(!chapters.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildChapterCardsHtml(item,chapters,options);options.itemsContainer.innerHTML=html,imageLoader.lazyChildren(options.itemsContainer)}return{buildChapterCards:buildChapterCards}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js b/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js index d14738f0a3..bb8d1df698 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js +++ b/dashboard-ui/bower_components/emby-webcomponents/chromecastplayer.js @@ -1 +1 @@ -define(["appSettings","playbackManager","connectionManager","globalize","events","castSenderApiLoader"],function(appSettings,playbackManager,connectionManager,globalize,events,castSenderApiLoader){"use strict";function sendConnectionResult(isOk){var resolve=currentResolve,reject=currentReject;currentResolve=null,currentReject=null,isOk?resolve&&resolve():reject?reject():playbackManager.removeActivePlayer(PlayerName)}function alertText(text,title){require(["alert"],function(alert){alert({text:text,title:title})})}function chromecastPlayer(){function initializeChromecast(){castPlayer=new CastPlayer,document.dispatchEvent(new CustomEvent("chromecastloaded",{detail:{player:self}})),events.on(castPlayer,"connect",function(e){currentResolve?sendConnectionResult(!0):playbackManager.setActivePlayer(PlayerName,self.getCurrentTargetInfo()),console.log("cc: connect"),self.lastPlayerData=null}),events.on(castPlayer,"playbackstart",function(e,data){console.log("cc: playbackstart"),castPlayer.initializeCastPlayer();var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstart",[state])}),events.on(castPlayer,"playbackstop",function(e,data){console.log("cc: playbackstop");var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstop",[state]),self.lastPlayerData={}}),events.on(castPlayer,"playbackprogress",function(e,data){console.log("cc: positionchange");var state=self.getPlayerStateInternal(data);events.trigger(self,"timeupdate",[state])}),events.on(castPlayer,"volumechange",function(e,data){console.log("cc: volumechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"volumechange",[state])}),events.on(castPlayer,"repeatmodechange",function(e,data){console.log("cc: repeatmodechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"repeatmodechange",[state])}),events.on(castPlayer,"playstatechange",function(e,data){console.log("cc: playstatechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"pause",[state])})}function normalizeImages(state){if(state&&state.NowPlayingItem){var item=state.NowPlayingItem;item.ImageTags&&item.ImageTags.Primary||item.PrimaryImageTag&&(item.ImageTags=item.ImageTags||{},item.ImageTags.Primary=item.PrimaryImageTag),item.BackdropImageTag&&item.BackdropItemId===item.Id&&(item.BackdropImageTags=[item.BackdropImageTag]),item.BackdropImageTag&&item.BackdropItemId!==item.Id&&(item.ParentBackdropImageTags=[item.BackdropImageTag],item.ParentBackdropItemId=item.BackdropItemId)}}var castPlayer,self=this;self.name=PlayerName,self.type="mediaplayer",self.id="chromecast",self.isLocalPlayer=!1,self.getItemsForPlayback=function(query){var apiClient=ApiClient,userId=apiClient.getCurrentUserId();return query.Ids&&1===query.Ids.split(",").length?apiClient.getItem(userId,query.Ids.split(",")).then(function(item){return{Items:[item],TotalRecordCount:1}}):(query.Limit=query.Limit||100,query.ExcludeLocationTypes="Virtual",apiClient.getItems(userId,query))},self.play=function(options){return options.items?self.playWithCommand(options,"PlayNow"):self.getItemsForPlayback({Ids:options.ids.join(",")}).then(function(result){return options.items=result.Items,self.playWithCommand(options,"PlayNow")})},self.playWithCommand=function(options,command){if(!options.items){var apiClient=connectionManager.getApiClient(options.serverId);return apiClient.getItem(apiClient.getCurrentUserId(),options.ids[0]).then(function(item){return options.items=[item],self.playWithCommand(options,command)})}return castPlayer.loadMedia(options,command)},self.unpause=function(){castPlayer.sendMessage({options:{},command:"Unpause"})},self.playPause=function(){castPlayer.sendMessage({options:{},command:"PlayPause"})},self.pause=function(){castPlayer.sendMessage({options:{},command:"Pause"})},self.shuffle=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"Shuffle")})},self.instantMix=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"InstantMix")})},self.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},self.canQueueMediaType=function(mediaType){return self.canPlayMediaType(mediaType)},self.queue=function(options){self.playWithCommand(options,"PlayLast")},self.queueNext=function(options){self.playWithCommand(options,"PlayNext")},self.stop=function(){return castPlayer.sendMessage({options:{},command:"Stop"})},self.displayContent=function(options){castPlayer.sendMessage({options:options,command:"DisplayContent"})},self.isPlaying=function(){var state=self.lastPlayerData||{};return null!=state.NowPlayingItem},self.isPlayingVideo=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},self.isPlayingAudio=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},self.currentTime=function(val){if(null!=val)return self.seek(val);var state=self.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},self.duration=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},self.paused=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},self.isMuted=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsMuted},self.setMute=function(isMuted){isMuted?castPlayer.sendMessage({options:{},command:"Mute"}):castPlayer.sendMessage({options:{},command:"Unmute"})},self.getRepeatMode=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.RepeatMode},self.setRepeatMode=function(mode){castPlayer.sendMessage({options:{RepeatMode:mode},command:"SetRepeatMode"})},self.toggleMute=function(){castPlayer.sendMessage({options:{},command:"ToggleMute"})},self.getTargets=function(){var targets=[];return castPlayer.hasReceivers&&targets.push(self.getCurrentTargetInfo()),Promise.resolve(targets)},self.getCurrentTargetInfo=function(){var appName=null;return castPlayer.session&&castPlayer.session.receiver&&castPlayer.session.receiver.friendlyName&&(appName=castPlayer.session.receiver.friendlyName),{name:PlayerName,id:PlayerName,playerName:PlayerName,playableMediaTypes:["Audio","Video"],isLocalPlayer:!1,appName:PlayerName,deviceName:appName,supportedCommands:["VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","SetRepeatMode","EndSession"]}},self.seek=function(position){position=parseInt(position),position/=1e7,castPlayer.sendMessage({options:{position:position},command:"Seek"})},self.audioTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},self.setAudioStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetAudioStreamIndex"})},self.getAudioStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},self.subtitleTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},self.getSubtitleStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},self.setSubtitleStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetSubtitleStreamIndex"})},self.getMaxStreamingBitrate=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.MaxStreamingBitrate},self.setMaxStreamingBitrate=function(options){castPlayer.sendMessage({options:options,command:"SetMaxStreamingBitrate"})},self.isFullscreen=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsFullscreen},self.toggleFullscreen=function(){},self.nextTrack=function(){castPlayer.sendMessage({options:{},command:"NextTrack"})},self.previousTrack=function(){castPlayer.sendMessage({options:{},command:"PreviousTrack"})},self.beginPlayerUpdates=function(){},self.endPlayerUpdates=function(){},self.getVolume=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},null==state.VolumeLevel?100:state.VolumeLevel},self.volumeDown=function(){castPlayer.sendMessage({options:{},command:"VolumeDown"})},self.endSession=function(){self.stop().then(function(){setTimeout(function(){castPlayer.stopApp()},1e3)})},self.volumeUp=function(){castPlayer.sendMessage({options:{},command:"VolumeUp"})},self.setVolume=function(vol){vol=Math.min(vol,100),vol=Math.max(vol,0),castPlayer.sendMessage({options:{volume:vol},command:"SetVolume"})},self.getPlaylist=function(){return Promise.resolve([])},self.getCurrentPlaylistItemId=function(){},self.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},self.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},self.getPlayerState=function(){return Promise.resolve(self.getPlayerStateInternal()||{})},self.lastPlayerData={},self.getPlayerStateInternal=function(data){var triggerStateChange=!1;return data&&!self.lastPlayerData&&(triggerStateChange=!0),data=data||self.lastPlayerData,self.lastPlayerData=data,normalizeImages(data),triggerStateChange&&events.trigger(self,"statechange",[data]),data},self.tryPair=function(target){return castPlayer.deviceState!==DEVICE_STATE.ACTIVE&&castPlayer.isInitialized?new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,castPlayer.launchApp()}):(currentResolve=null,currentReject=null,Promise.reject())},castSenderApiLoader.load().then(initializeChromecast)}var currentResolve,currentReject,PlayerName="Chromecast",DEVICE_STATE={IDLE:0,ACTIVE:1,WARNING:2,ERROR:3},PLAYER_STATE={IDLE:"IDLE",LOADING:"LOADING",LOADED:"LOADED",PLAYING:"PLAYING",PAUSED:"PAUSED",STOPPED:"STOPPED",SEEKING:"SEEKING",ERROR:"ERROR"},applicationID="2D4B1DA3",messageNamespace="urn:x-cast:com.connectsdk",CastPlayer=function(){this.deviceState=DEVICE_STATE.IDLE,this.currentMediaSession=null,this.session=null,this.castPlayerState=PLAYER_STATE.IDLE,this.hasReceivers=!1,this.errorHandler=this.onError.bind(this),this.mediaStatusUpdateHandler=this.onMediaStatusUpdate.bind(this),this.initializeCastPlayer()};return CastPlayer.prototype.initializeCastPlayer=function(){var chrome=window.chrome;if(chrome){if(!chrome.cast||!chrome.cast.isAvailable)return void setTimeout(this.initializeCastPlayer.bind(this),1e3);var sessionRequest=new chrome.cast.SessionRequest(applicationID),apiConfig=new chrome.cast.ApiConfig(sessionRequest,this.sessionListener.bind(this),this.receiverListener.bind(this),"origin_scoped");console.log("chromecast.initialize"),chrome.cast.initialize(apiConfig,this.onInitSuccess.bind(this),this.errorHandler)}},CastPlayer.prototype.onInitSuccess=function(){this.isInitialized=!0,console.log("chromecast init success")},CastPlayer.prototype.onError=function(){console.log("chromecast error")},CastPlayer.prototype.sessionListener=function(e){this.session=e,this.session&&(console.log("sessionListener "+JSON.stringify(e)),this.session.media[0]&&this.onMediaDiscovered("activeSession",this.session.media[0]),this.onSessionConnected(e))},CastPlayer.prototype.messageListener=function(namespace,message){if("string"==typeof message&&(message=JSON.parse(message)),"playbackerror"===message.type){var errorCode=message.data;setTimeout(function(){alertText(globalize.translate("MessagePlaybackError"+errorCode),globalize.translate("HeaderPlaybackError"))},300)}else"connectionerror"===message.type?setTimeout(function(){alertText(globalize.translate("MessageChromecastConnectionError"),globalize.translate("HeaderError"))},300):message.type&&events.trigger(this,message.type,[message.data])},CastPlayer.prototype.receiverListener=function(e){"available"===e?(console.log("chromecast receiver found"),this.hasReceivers=!0):(console.log("chromecast receiver list empty"),this.hasReceivers=!1)},CastPlayer.prototype.sessionUpdateListener=function(isAlive){console.log("sessionUpdateListener alive: "+isAlive),isAlive||(this.session=null,this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("sessionUpdateListener: setting currentMediaSession to null"),this.currentMediaSession=null,sendConnectionResult(!1))},CastPlayer.prototype.launchApp=function(){console.log("chromecast launching app..."),chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this),this.onLaunchError.bind(this))},CastPlayer.prototype.onRequestSessionSuccess=function(e){console.log("chromecast session success: "+e.sessionId),this.onSessionConnected(e)},CastPlayer.prototype.onSessionConnected=function(session){this.session=session,this.deviceState=DEVICE_STATE.ACTIVE,this.session.addMessageListener(messageNamespace,this.messageListener.bind(this)),this.session.addMediaListener(this.sessionMediaListener.bind(this)),this.session.addUpdateListener(this.sessionUpdateListener.bind(this)),events.trigger(this,"connect"),this.sendMessage({options:{},command:"Identify"})},CastPlayer.prototype.sessionMediaListener=function(e){console.log("sessionMediaListener"),this.currentMediaSession=e,this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onLaunchError=function(){console.log("chromecast launch error"),this.deviceState=DEVICE_STATE.ERROR,sendConnectionResult(!1)},CastPlayer.prototype.stopApp=function(){this.session&&this.session.stop(this.onStopAppSuccess.bind(this,"Session stopped"),this.errorHandler)},CastPlayer.prototype.onStopAppSuccess=function(message){console.log(message),this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("onStopAppSuccess: setting currentMediaSession to null"),this.currentMediaSession=null},CastPlayer.prototype.loadMedia=function(options,command){return this.session?(options.items=options.items.map(function(i){return{Id:i.Id,Name:i.Name,Type:i.Type,MediaType:i.MediaType,IsFolder:i.IsFolder}}),this.sendMessage({options:options,command:command})):(console.log("no session"),Promise.reject())},CastPlayer.prototype.sendMessage=function(message){var player=this,receiverName=null,session=player.session;session&&session.receiver&&session.receiver.friendlyName&&(receiverName=session.receiver.friendlyName);var apiClient=ApiClient;message=Object.assign(message,{userId:apiClient.getCurrentUserId(),deviceId:apiClient.deviceId(),accessToken:apiClient.accessToken(),serverAddress:apiClient.serverAddress(),receiverName:receiverName});var bitrateSetting=appSettings.maxChromecastBitrate();return bitrateSetting&&(message.maxBitrate=bitrateSetting),new Promise(function(resolve,reject){require(["chromecasthelpers"],function(chromecasthelpers){chromecasthelpers.getServerAddress(apiClient).then(function(serverAddress){message.serverAddress=serverAddress,player.sendMessageInternal(message).then(resolve,reject)},reject)})})},CastPlayer.prototype.sendMessageInternal=function(message){return message=JSON.stringify(message),this.session.sendMessage(messageNamespace,message,this.onPlayCommandSuccess.bind(this),this.errorHandler),Promise.resolve()},CastPlayer.prototype.onPlayCommandSuccess=function(){console.log("Message was sent to receiver ok.")},CastPlayer.prototype.onMediaDiscovered=function(how,mediaSession){console.log("chromecast new media session ID:"+mediaSession.mediaSessionId+" ("+how+")"),this.currentMediaSession=mediaSession,"loadMedia"===how&&(this.castPlayerState=PLAYER_STATE.PLAYING),"activeSession"===how&&(this.castPlayerState=mediaSession.playerState),this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onMediaStatusUpdate=function(e){e===!1&&(this.castPlayerState=PLAYER_STATE.IDLE),console.log("chromecast updating media: "+e)},CastPlayer.prototype.setReceiverVolume=function(mute,vol){return this.currentMediaSession?void(mute?this.session.setReceiverMuted(!0,this.mediaCommandSuccessCallback.bind(this),this.errorHandler):this.session.setReceiverVolumeLevel(vol||1,this.mediaCommandSuccessCallback.bind(this),this.errorHandler)):void console.log("this.currentMediaSession is null")},CastPlayer.prototype.mute=function(){this.setReceiverVolume(!0)},CastPlayer.prototype.mediaCommandSuccessCallback=function(info,e){console.log(info)},chromecastPlayer}); \ No newline at end of file +define(["appSettings","playbackManager","connectionManager","globalize","events","castSenderApiLoader"],function(appSettings,playbackManager,connectionManager,globalize,events,castSenderApiLoader){"use strict";function sendConnectionResult(isOk){var resolve=currentResolve,reject=currentReject;currentResolve=null,currentReject=null,isOk?resolve&&resolve():reject?reject():playbackManager.removeActivePlayer(PlayerName)}function alertText(text,title){require(["alert"],function(alert){alert({text:text,title:title})})}function chromecastPlayer(){function initializeChromecast(){castPlayer=new CastPlayer,document.dispatchEvent(new CustomEvent("chromecastloaded",{detail:{player:self}})),events.on(castPlayer,"connect",function(e){currentResolve?sendConnectionResult(!0):playbackManager.setActivePlayer(PlayerName,self.getCurrentTargetInfo()),console.log("cc: connect"),self.lastPlayerData=null}),events.on(castPlayer,"playbackstart",function(e,data){console.log("cc: playbackstart"),castPlayer.initializeCastPlayer();var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstart",[state])}),events.on(castPlayer,"playbackstop",function(e,data){console.log("cc: playbackstop");var state=self.getPlayerStateInternal(data);events.trigger(self,"playbackstop",[state]),self.lastPlayerData={}}),events.on(castPlayer,"playbackprogress",function(e,data){console.log("cc: positionchange");var state=self.getPlayerStateInternal(data);events.trigger(self,"timeupdate",[state])}),events.on(castPlayer,"volumechange",function(e,data){console.log("cc: volumechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"volumechange",[state])}),events.on(castPlayer,"repeatmodechange",function(e,data){console.log("cc: repeatmodechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"repeatmodechange",[state])}),events.on(castPlayer,"playstatechange",function(e,data){console.log("cc: playstatechange");var state=self.getPlayerStateInternal(data);events.trigger(self,"pause",[state])})}function normalizeImages(state){if(state&&state.NowPlayingItem){var item=state.NowPlayingItem;item.ImageTags&&item.ImageTags.Primary||item.PrimaryImageTag&&(item.ImageTags=item.ImageTags||{},item.ImageTags.Primary=item.PrimaryImageTag),item.BackdropImageTag&&item.BackdropItemId===item.Id&&(item.BackdropImageTags=[item.BackdropImageTag]),item.BackdropImageTag&&item.BackdropItemId!==item.Id&&(item.ParentBackdropImageTags=[item.BackdropImageTag],item.ParentBackdropItemId=item.BackdropItemId)}}var castPlayer,self=this;self.name=PlayerName,self.type="mediaplayer",self.id="chromecast",self.isLocalPlayer=!1,self.getItemsForPlayback=function(query){var apiClient=ApiClient,userId=apiClient.getCurrentUserId();return query.Ids&&1===query.Ids.split(",").length?apiClient.getItem(userId,query.Ids.split(",")).then(function(item){return{Items:[item],TotalRecordCount:1}}):(query.Limit=query.Limit||100,query.ExcludeLocationTypes="Virtual",apiClient.getItems(userId,query))},self.play=function(options){return options.items?self.playWithCommand(options,"PlayNow"):self.getItemsForPlayback({Ids:options.ids.join(",")}).then(function(result){return options.items=result.Items,self.playWithCommand(options,"PlayNow")})},self.playWithCommand=function(options,command){if(!options.items){var apiClient=connectionManager.getApiClient(options.serverId);return apiClient.getItem(apiClient.getCurrentUserId(),options.ids[0]).then(function(item){return options.items=[item],self.playWithCommand(options,command)})}return castPlayer.loadMedia(options,command)},self.unpause=function(){castPlayer.sendMessage({options:{},command:"Unpause"})},self.playPause=function(){castPlayer.sendMessage({options:{},command:"PlayPause"})},self.pause=function(){castPlayer.sendMessage({options:{},command:"Pause"})},self.shuffle=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"Shuffle")})},self.instantMix=function(item){var apiClient=connectionManager.getApiClient(item.ServerId),userId=apiClient.getCurrentUserId();apiClient.getItem(userId,item.Id).then(function(item){self.playWithCommand({items:[item]},"InstantMix")})},self.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},self.canQueueMediaType=function(mediaType){return self.canPlayMediaType(mediaType)},self.queue=function(options){self.playWithCommand(options,"PlayLast")},self.queueNext=function(options){self.playWithCommand(options,"PlayNext")},self.stop=function(){return castPlayer.sendMessage({options:{},command:"Stop"})},self.displayContent=function(options){castPlayer.sendMessage({options:options,command:"DisplayContent"})},self.isPlaying=function(){var state=self.lastPlayerData||{};return null!=state.NowPlayingItem},self.isPlayingVideo=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},self.isPlayingAudio=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},self.currentTime=function(val){if(null!=val)return self.seek(val);var state=self.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},self.duration=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},self.paused=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},self.isMuted=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsMuted},self.setMute=function(isMuted){isMuted?castPlayer.sendMessage({options:{},command:"Mute"}):castPlayer.sendMessage({options:{},command:"Unmute"})},self.getRepeatMode=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.RepeatMode},self.setRepeatMode=function(mode){castPlayer.sendMessage({options:{RepeatMode:mode},command:"SetRepeatMode"})},self.toggleMute=function(){castPlayer.sendMessage({options:{},command:"ToggleMute"})},self.getTargets=function(){var targets=[];return castPlayer.hasReceivers&&targets.push(self.getCurrentTargetInfo()),Promise.resolve(targets)},self.getCurrentTargetInfo=function(){var appName=null;return castPlayer.session&&castPlayer.session.receiver&&castPlayer.session.receiver.friendlyName&&(appName=castPlayer.session.receiver.friendlyName),{name:PlayerName,id:PlayerName,playerName:PlayerName,playableMediaTypes:["Audio","Video"],isLocalPlayer:!1,appName:PlayerName,deviceName:appName,supportedCommands:["VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","DisplayContent","SetRepeatMode","EndSession"]}},self.seek=function(position){position=parseInt(position),position/=1e7,castPlayer.sendMessage({options:{position:position},command:"Seek"})},self.audioTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},self.setAudioStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetAudioStreamIndex"})},self.getAudioStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},self.subtitleTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},self.getSubtitleStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},self.setSubtitleStreamIndex=function(index){castPlayer.sendMessage({options:{index:index},command:"SetSubtitleStreamIndex"})},self.getMaxStreamingBitrate=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.MaxStreamingBitrate},self.setMaxStreamingBitrate=function(options){castPlayer.sendMessage({options:options,command:"SetMaxStreamingBitrate"})},self.isFullscreen=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsFullscreen},self.toggleFullscreen=function(){},self.nextTrack=function(){castPlayer.sendMessage({options:{},command:"NextTrack"})},self.previousTrack=function(){castPlayer.sendMessage({options:{},command:"PreviousTrack"})},self.beginPlayerUpdates=function(){},self.endPlayerUpdates=function(){},self.getVolume=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},null==state.VolumeLevel?100:state.VolumeLevel},self.volumeDown=function(){castPlayer.sendMessage({options:{},command:"VolumeDown"})},self.endSession=function(){self.stop().then(function(){setTimeout(function(){castPlayer.stopApp()},1e3)})},self.volumeUp=function(){castPlayer.sendMessage({options:{},command:"VolumeUp"})},self.setVolume=function(vol){vol=Math.min(vol,100),vol=Math.max(vol,0),castPlayer.sendMessage({options:{volume:vol},command:"SetVolume"})},self.getPlaylist=function(){return Promise.resolve([])},self.getCurrentPlaylistItemId=function(){},self.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},self.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},self.getPlayerState=function(){return Promise.resolve(self.getPlayerStateInternal()||{})},self.lastPlayerData={},self.getPlayerStateInternal=function(data){var triggerStateChange=!1;return data&&!self.lastPlayerData&&(triggerStateChange=!0),data=data||self.lastPlayerData,self.lastPlayerData=data,normalizeImages(data),triggerStateChange&&events.trigger(self,"statechange",[data]),data},self.tryPair=function(target){return castPlayer.deviceState!==DEVICE_STATE.ACTIVE&&castPlayer.isInitialized?new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,castPlayer.launchApp()}):(currentResolve=null,currentReject=null,Promise.reject())},castSenderApiLoader.load().then(initializeChromecast)}var currentResolve,currentReject,PlayerName="Chromecast",DEVICE_STATE={IDLE:0,ACTIVE:1,WARNING:2,ERROR:3},PLAYER_STATE={IDLE:"IDLE",LOADING:"LOADING",LOADED:"LOADED",PLAYING:"PLAYING",PAUSED:"PAUSED",STOPPED:"STOPPED",SEEKING:"SEEKING",ERROR:"ERROR"},applicationID="2D4B1DA3",messageNamespace="urn:x-cast:com.connectsdk",CastPlayer=function(){this.deviceState=DEVICE_STATE.IDLE,this.currentMediaSession=null,this.session=null,this.castPlayerState=PLAYER_STATE.IDLE,this.hasReceivers=!1,this.errorHandler=this.onError.bind(this),this.mediaStatusUpdateHandler=this.onMediaStatusUpdate.bind(this),this.initializeCastPlayer()};return CastPlayer.prototype.initializeCastPlayer=function(){var chrome=window.chrome;if(chrome){if(!chrome.cast||!chrome.cast.isAvailable)return void setTimeout(this.initializeCastPlayer.bind(this),1e3);var sessionRequest=new chrome.cast.SessionRequest(applicationID),apiConfig=new chrome.cast.ApiConfig(sessionRequest,this.sessionListener.bind(this),this.receiverListener.bind(this),"origin_scoped");console.log("chromecast.initialize"),chrome.cast.initialize(apiConfig,this.onInitSuccess.bind(this),this.errorHandler)}},CastPlayer.prototype.onInitSuccess=function(){this.isInitialized=!0,console.log("chromecast init success")},CastPlayer.prototype.onError=function(){console.log("chromecast error")},CastPlayer.prototype.sessionListener=function(e){this.session=e,this.session&&(console.log("sessionListener "+JSON.stringify(e)),this.session.media[0]&&this.onMediaDiscovered("activeSession",this.session.media[0]),this.onSessionConnected(e))},CastPlayer.prototype.messageListener=function(namespace,message){if("string"==typeof message&&(message=JSON.parse(message)),"playbackerror"===message.type){var errorCode=message.data;setTimeout(function(){alertText(globalize.translate("MessagePlaybackError"+errorCode),globalize.translate("HeaderPlaybackError"))},300)}else"connectionerror"===message.type?setTimeout(function(){alertText(globalize.translate("MessageChromecastConnectionError"),globalize.translate("HeaderError"))},300):message.type&&events.trigger(this,message.type,[message.data])},CastPlayer.prototype.receiverListener=function(e){"available"===e?(console.log("chromecast receiver found"),this.hasReceivers=!0):(console.log("chromecast receiver list empty"),this.hasReceivers=!1)},CastPlayer.prototype.sessionUpdateListener=function(isAlive){console.log("sessionUpdateListener alive: "+isAlive),isAlive||(this.session=null,this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("sessionUpdateListener: setting currentMediaSession to null"),this.currentMediaSession=null,sendConnectionResult(!1))},CastPlayer.prototype.launchApp=function(){console.log("chromecast launching app..."),chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this),this.onLaunchError.bind(this))},CastPlayer.prototype.onRequestSessionSuccess=function(e){console.log("chromecast session success: "+e.sessionId),this.onSessionConnected(e)},CastPlayer.prototype.onSessionConnected=function(session){this.session=session,this.deviceState=DEVICE_STATE.ACTIVE,this.session.addMessageListener(messageNamespace,this.messageListener.bind(this)),this.session.addMediaListener(this.sessionMediaListener.bind(this)),this.session.addUpdateListener(this.sessionUpdateListener.bind(this)),events.trigger(this,"connect"),this.sendMessage({options:{},command:"Identify"})},CastPlayer.prototype.sessionMediaListener=function(e){console.log("sessionMediaListener"),this.currentMediaSession=e,this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onLaunchError=function(){console.log("chromecast launch error"),this.deviceState=DEVICE_STATE.ERROR,sendConnectionResult(!1)},CastPlayer.prototype.stopApp=function(){this.session&&this.session.stop(this.onStopAppSuccess.bind(this,"Session stopped"),this.errorHandler)},CastPlayer.prototype.onStopAppSuccess=function(message){console.log(message),this.deviceState=DEVICE_STATE.IDLE,this.castPlayerState=PLAYER_STATE.IDLE,console.log("onStopAppSuccess: setting currentMediaSession to null"),this.currentMediaSession=null},CastPlayer.prototype.loadMedia=function(options,command){return this.session?(options.items=options.items.map(function(i){return{Id:i.Id,ServerId:i.ServerId,Name:i.Name,Type:i.Type,MediaType:i.MediaType,IsFolder:i.IsFolder}}),this.sendMessage({options:options,command:command})):(console.log("no session"),Promise.reject())},CastPlayer.prototype.sendMessage=function(message){var player=this,receiverName=null,session=player.session;session&&session.receiver&&session.receiver.friendlyName&&(receiverName=session.receiver.friendlyName);var apiClient=ApiClient;message=Object.assign(message,{userId:apiClient.getCurrentUserId(),deviceId:apiClient.deviceId(),accessToken:apiClient.accessToken(),serverAddress:apiClient.serverAddress(),serverId:apiClient.serverId(),receiverName:receiverName});var bitrateSetting=appSettings.maxChromecastBitrate();return bitrateSetting&&(message.maxBitrate=bitrateSetting),new Promise(function(resolve,reject){require(["chromecasthelpers"],function(chromecasthelpers){chromecasthelpers.getServerAddress(apiClient).then(function(serverAddress){message.serverAddress=serverAddress,player.sendMessageInternal(message).then(resolve,reject)},reject)})})},CastPlayer.prototype.sendMessageInternal=function(message){return message=JSON.stringify(message),this.session.sendMessage(messageNamespace,message,this.onPlayCommandSuccess.bind(this),this.errorHandler),Promise.resolve()},CastPlayer.prototype.onPlayCommandSuccess=function(){console.log("Message was sent to receiver ok.")},CastPlayer.prototype.onMediaDiscovered=function(how,mediaSession){console.log("chromecast new media session ID:"+mediaSession.mediaSessionId+" ("+how+")"),this.currentMediaSession=mediaSession,"loadMedia"===how&&(this.castPlayerState=PLAYER_STATE.PLAYING),"activeSession"===how&&(this.castPlayerState=mediaSession.playerState),this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler)},CastPlayer.prototype.onMediaStatusUpdate=function(e){e===!1&&(this.castPlayerState=PLAYER_STATE.IDLE),console.log("chromecast updating media: "+e)},CastPlayer.prototype.setReceiverVolume=function(mute,vol){return this.currentMediaSession?void(mute?this.session.setReceiverMuted(!0,this.mediaCommandSuccessCallback.bind(this),this.errorHandler):this.session.setReceiverVolumeLevel(vol||1,this.mediaCommandSuccessCallback.bind(this),this.errorHandler)):void console.log("this.currentMediaSession is null")},CastPlayer.prototype.mute=function(){this.setReceiverVolume(!0)},CastPlayer.prototype.mediaCommandSuccessCallback=function(info,e){console.log(info)},chromecastPlayer}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js b/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js index b85376e0b1..c69d963d35 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/collectioneditor/collectioneditor.js @@ -1 +1 @@ -define(["shell","dialogHelper","loading","layoutManager","connectionManager","embyRouter","globalize","emby-checkbox","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,connectionManager,embyRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onSubmit(e){loading.show();var panel=parentWithClass(this,"dialog"),collectionId=panel.querySelector("#selectCollectionToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return collectionId?addToCollection(apiClient,panel,collectionId):createCollection(apiClient,panel),e.preventDefault(),!1}function createCollection(apiClient,dlg){var url=apiClient.getUrl("Collections",{Name:dlg.querySelector("#txtNewCollectionName").value,IsLocked:!dlg.querySelector("#chkEnableInternetMetadata").checked,Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dialogHelper.close(dlg),redirectToCollection(apiClient,id)})}function redirectToCollection(apiClient,id){apiClient.getItem(apiClient.getCurrentUserId(),id).then(function(item){embyRouter.showItem(item)})}function addToCollection(apiClient,dlg,id){var url=apiClient.getUrl("Collections/"+id+"/Items",{Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemsAdded"))})})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populateCollections(panel){loading.show();var select=panel.querySelector("#selectCollectionToAddTo");panel.querySelector(".newCollectionInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"BoxSet",SortBy:"SortName"},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html,select.value="",triggerChange(select),loading.hide()})}function getEditorHtml(){var html="";return html+='
',html+='
',html+='',html+="
",html+=globalize.translate("sharedcomponents#NewCollectionHelp"),html+="
",html+='
',html+="
",html+="
",html+='
',html+='',html+="
",html+="
",html+='
',html+='
',html+='',html+='
'+globalize.translate("sharedcomponents#NewCollectionNameExample")+"
",html+="
",html+='",html+="
",html+='
',html+='",html+="
",html+='',html+="",html+="
",html+="
"}function initEditor(content,items){if(content.querySelector("#selectCollectionToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newCollectionInfo").classList.add("hide"),content.querySelector("#txtNewCollectionName").removeAttribute("required")):(content.querySelector(".newCollectionInfo").classList.remove("hide"),content.querySelector("#txtNewCollectionName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectCollection").classList.remove("hide"),populateCollections(content);else{content.querySelector(".fldSelectCollection").classList.add("hide");var selectCollectionToAddTo=content.querySelector("#selectCollectionToAddTo");selectCollectionToAddTo.innerHTML="",selectCollectionToAddTo.value="",triggerChange(selectCollectionToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function collectioneditor(){var self=this;self.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=items.length?globalize.translate("sharedcomponents#HeaderAddToCollection"):globalize.translate("sharedcomponents#NewCollection");return html+='
',html+='',html+='

',html+=title,html+="

",html+='info'+globalize.translate("sharedcomponents#Help")+"",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),new Promise(function(resolve,reject){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})}}var currentServerId;return collectioneditor}); \ No newline at end of file +define(["dialogHelper","loading","layoutManager","connectionManager","embyRouter","globalize","emby-checkbox","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button","emby-linkbutton"],function(dialogHelper,loading,layoutManager,connectionManager,embyRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onSubmit(e){loading.show();var panel=parentWithClass(this,"dialog"),collectionId=panel.querySelector("#selectCollectionToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return collectionId?addToCollection(apiClient,panel,collectionId):createCollection(apiClient,panel),e.preventDefault(),!1}function createCollection(apiClient,dlg){var url=apiClient.getUrl("Collections",{Name:dlg.querySelector("#txtNewCollectionName").value,IsLocked:!dlg.querySelector("#chkEnableInternetMetadata").checked,Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dlg.submitted=!0,dialogHelper.close(dlg),redirectToCollection(apiClient,id)})}function redirectToCollection(apiClient,id){apiClient.getItem(apiClient.getCurrentUserId(),id).then(function(item){embyRouter.showItem(item)})}function addToCollection(apiClient,dlg,id){var url=apiClient.getUrl("Collections/"+id+"/Items",{Ids:dlg.querySelector(".fldSelectedItemIds").value||""});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemsAdded"))})})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populateCollections(panel){loading.show();var select=panel.querySelector("#selectCollectionToAddTo");panel.querySelector(".newCollectionInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"BoxSet",SortBy:"SortName"},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html,select.value="",triggerChange(select),loading.hide()})}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+="
",html+=globalize.translate("sharedcomponents#NewCollectionHelp"),html+="
",html+='
',html+="
",html+="
",html+='
',html+='',html+="
",html+="
",html+='
',html+='
',html+='',html+='
'+globalize.translate("sharedcomponents#NewCollectionNameExample")+"
",html+="
",html+='",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,items){if(content.querySelector("#selectCollectionToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newCollectionInfo").classList.add("hide"),content.querySelector("#txtNewCollectionName").removeAttribute("required")):(content.querySelector(".newCollectionInfo").classList.remove("hide"),content.querySelector("#txtNewCollectionName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectCollection").classList.remove("hide"),populateCollections(content);else{content.querySelector(".fldSelectCollection").classList.add("hide");var selectCollectionToAddTo=content.querySelector("#selectCollectionToAddTo");selectCollectionToAddTo.innerHTML="",selectCollectionToAddTo.value="",triggerChange(selectCollectionToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function CollectionEditor(){}var currentServerId;return CollectionEditor.prototype.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=items.length?globalize.translate("sharedcomponents#HeaderAddToCollection"):globalize.translate("sharedcomponents#NewCollection");return html+='
',html+='',html+='

',html+=title,html+="

",html+=''+globalize.translate("sharedcomponents#Help")+"",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.submitted?Promise.resolve():Promise.reject()})},CollectionEditor}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.css b/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.css index 95af7264fe..fefa9cc26d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.css +++ b/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.css @@ -1 +1 @@ -.dialogContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999!important;contain:strict}.dialog{margin:0;-webkit-border-radius:4px;border-radius:4px;-webkit-font-smoothing:antialiased;border:0;padding:0;will-change:transform;contain:style;-webkit-box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.4);box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.4)}.dialog-fixedSize{-webkit-border-radius:0;border-radius:0;max-height:none;max-width:none}.dialog-fullscreen{position:fixed!important;top:0;bottom:0;left:0;right:0;margin:0;-webkit-box-shadow:none;box-shadow:none}@-webkit-keyframes scaledown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes scaledown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@-webkit-keyframes scaleup{from{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:none;transform:none}}@keyframes scaleup{from{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:none;transform:none}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}@-webkit-keyframes slideup{from{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes slideup{from{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes slidedown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}}@keyframes slidedown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}}@media all and (max-width:1280px),all and (max-height:720px){.dialog-fixedSize,.dialog-fullscreen-lowres{position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;-webkit-box-shadow:none;box-shadow:none}}@media all and (min-width:1280px) and (min-height:720px){.dialog-medium{width:80%;height:80%}.dialog-medium-tall{width:80%;height:90%}.dialog-small{width:60%;height:80%}.dialog-fullscreen-border{width:90%;height:90%}}.noScroll{overflow-x:hidden!important;overflow-y:hidden!important}.dialogBackdrop{background-color:#000;opacity:0;position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;z-index:999999!important;-webkit-transition:opacity ease-out .2s;-o-transition:opacity ease-out .2s;transition:opacity ease-out .2s}.dialogBackdropOpened{opacity:.6} \ No newline at end of file +.dialogContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999!important;contain:strict}.dialog{margin:0;-webkit-border-radius:4px;border-radius:4px;-webkit-font-smoothing:antialiased;border:0;padding:0;will-change:transform;contain:style;-webkit-box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.4);box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.4)}.dialog-fixedSize{-webkit-border-radius:0;border-radius:0;max-height:none;max-width:none}.dialog-fullscreen{position:fixed!important;top:0;bottom:0;left:0;right:0;margin:0;-webkit-box-shadow:none;box-shadow:none}@-webkit-keyframes scaledown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes scaledown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@-webkit-keyframes scaleup{from{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:none;transform:none}}@keyframes scaleup{from{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:none;transform:none}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}@-webkit-keyframes slideup{from{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes slideup{from{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes slidedown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}}@keyframes slidedown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}}@media all and (max-width:80em),all and (max-height:45em){.dialog-fixedSize,.dialog-fullscreen-lowres{position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;-webkit-box-shadow:none;box-shadow:none}}@media all and (min-width:80em) and (min-height:45em){.dialog-medium{width:80%;height:80%}.dialog-medium-tall{width:80%;height:90%}.dialog-small{width:60%;height:80%}.dialog-fullscreen-border{width:90%;height:90%}}.noScroll{overflow-x:hidden!important;overflow-y:hidden!important}.dialogBackdrop{background-color:#000;opacity:0;position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;z-index:999999!important;-webkit-transition:opacity ease-out .2s;-o-transition:opacity ease-out .2s;transition:opacity ease-out .2s}.dialogBackdropOpened{opacity:.6} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css index 0be8200f0f..65eebb08b1 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.css @@ -1 +1 @@ -.emby-button,.fab{-webkit-box-sizing:border-box}.emby-button,.paper-icon-button-light{text-align:center;font-family:inherit;cursor:pointer;outline:0!important;overflow:hidden}.emby-button,.paper-icon-button-light,.paper-icon-button-light>i,.paper-icon-button-light>img{position:relative;vertical-align:middle}.emby-button{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;margin:0 .29em;font-size:inherit;color:inherit;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;z-index:0;padding:1em .7em;border:0;-webkit-border-radius:2px;border-radius:2px;font-weight:400;-webkit-tap-highlight-color:transparent;text-decoration:none}.emby-button.block,.fab{-webkit-box-align:center}.emby-button::-moz-focus-inner{border:0}.button-flat{background:0 0;-webkit-box-shadow:none;box-shadow:none}.button-flat-accent{color:#52B54B}.emby-button-focusscale{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.emby-button-focusscale:focus{-webkit-transform:scale(1.16);transform:scale(1.16);z-index:1}.emby-button>i{font-size:1.36em;width:1em;height:1em}.fab{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-border-radius:50%;border-radius:50%;background-color:rgba(170,170,190,.5);padding:.6em;box-sizing:border-box;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center;color:#fff;margin:0}.fab>i{height:1em;width:1em;vertical-align:middle;font-size:2.85em}.emby-button-noflex{display:inline-block;white-space:nowrap}.fab.mini{padding:8px}.fab.mini>i{height:1em;width:1em;font-size:1.72em}.emby-button.block{display:block;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;margin:.25em 0;width:100%}.raised:focus{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transition:-webkit-box-shadow .28s cubic-bezier(.4,0,.2,1);-o-transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.button-flat-mini,.raised-mini{padding:.5em .7em}.emby-button>i+span,.emby-button>span+i{margin-left:.5em}.paper-icon-button-light{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 .29em;background:0 0;font-size:inherit;color:inherit;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;z-index:0;min-width:initial;min-height:initial;width:auto;height:auto;padding:8px;border:0;font-weight:500;-webkit-border-radius:50%;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.paper-icon-button-light::-moz-focus-inner{border:0}.paper-icon-button-light[disabled]{opacity:.3}.paper-icon-button-light>i{width:1em;height:1em;font-size:1.6em;z-index:1}.paper-icon-button-light>img{width:1.72em;max-height:100%;z-index:1}.paper-icon-button-light:after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .3s ease-out;-o-transition:opacity .3s ease-out;transition:opacity .3s ease-out;background:currentcolor;opacity:0}.paper-icon-button-light:focus{color:#52B54B}.paper-icon-button-light:focus:after{opacity:.2}.emby-button-ripple-effect,.paper-icon-button-light-ripple-effect{position:absolute;-webkit-border-radius:50%;border-radius:50%;width:50px;height:50px;top:50%;left:50%;background:currentcolor;-webkit-animation:ripple-animation .8s;animation:ripple-animation .8s;opacity:.25;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes ripple-animation{from{-webkit-transform:none;transform:none;opacity:.5}to{-webkit-transform:scale(20);transform:scale(20);opacity:0}}@keyframes ripple-animation{from{-webkit-transform:none;transform:none;opacity:.5}to{-webkit-transform:scale(20);transform:scale(20);opacity:0}}.emby-button-foreground{position:relative;z-index:1}.icon-button-focusscale{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.icon-button-focusscale:focus{-webkit-transform:scale(1.3);transform:scale(1.3);z-index:1} \ No newline at end of file +.emby-button,.fab{-webkit-box-sizing:border-box}.emby-button,.paper-icon-button-light{font-family:inherit;cursor:pointer;overflow:hidden;position:relative}.emby-button{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;margin:0 .29em;text-align:center;font-size:inherit;color:inherit;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;z-index:0;padding:1em .7em;border:0;vertical-align:middle;-webkit-border-radius:2px;border-radius:2px;outline:0!important;font-weight:400;-webkit-tap-highlight-color:transparent;text-decoration:none}.emby-button.block,.fab{-webkit-box-align:center}.button-flat-accent,.button-link{color:#52B54B}.emby-button::-moz-focus-inner{border:0}.button-flat{background:0 0;-webkit-box-shadow:none;box-shadow:none}.button-link{background:0 0;-webkit-box-shadow:none;box-shadow:none;margin:0;padding:0;vertical-align:initial}.emby-button-focusscale{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.emby-button-focusscale:focus{-webkit-transform:scale(1.16);transform:scale(1.16);z-index:1}.emby-button>i{font-size:1.36em;width:1em;height:1em}.button-link>i{font-size:1em}.fab{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-border-radius:50%;border-radius:50%;background-color:rgba(170,170,190,.5);padding:.6em;box-sizing:border-box;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center;color:#fff;margin:0}.fab>i{height:1em;width:1em;vertical-align:middle;font-size:2.85em}.emby-button-noflex{display:inline-block;white-space:nowrap}.fab.mini{padding:8px}.fab.mini>i{height:1em;width:1em;font-size:1.72em}.emby-button.block{display:block;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;margin:.25em 0;width:100%}.raised:focus{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transition:-webkit-box-shadow .28s cubic-bezier(.4,0,.2,1);-o-transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.button-flat-mini,.raised-mini{padding:.5em .7em}.emby-button>i+span,.emby-button>span+i{margin-left:.5em}.paper-icon-button-light{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 .29em;background:0 0;text-align:center;font-size:inherit;color:inherit;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;z-index:0;min-width:initial;min-height:initial;width:auto;height:auto;padding:8px;border:0;vertical-align:middle;outline:0!important;font-weight:500;-webkit-border-radius:50%;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.paper-icon-button-light::-moz-focus-inner{border:0}.paper-icon-button-light[disabled]{opacity:.3}.paper-icon-button-light>i{width:1em;height:1em;font-size:1.6em;position:relative;z-index:1;vertical-align:middle}.paper-icon-button-light>img{width:1.72em;max-height:100%;position:relative;z-index:1;vertical-align:middle}.paper-icon-button-light:after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .3s ease-out;-o-transition:opacity .3s ease-out;transition:opacity .3s ease-out;background:currentcolor;opacity:0}.paper-icon-button-light:focus{color:#52B54B}.paper-icon-button-light:focus:after{opacity:.2}.emby-button-ripple-effect,.paper-icon-button-light-ripple-effect{position:absolute;-webkit-border-radius:50%;border-radius:50%;width:50px;height:50px;top:50%;left:50%;background:currentcolor;-webkit-animation:ripple-animation .8s;animation:ripple-animation .8s;opacity:.25;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes ripple-animation{from{-webkit-transform:none;transform:none;opacity:.5}to{-webkit-transform:scale(20);transform:scale(20);opacity:0}}@keyframes ripple-animation{from{-webkit-transform:none;transform:none;opacity:.5}to{-webkit-transform:scale(20);transform:scale(20);opacity:0}}.emby-button-foreground{position:relative;z-index:1}.icon-button-focusscale{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.icon-button-focusscale:focus{-webkit-transform:scale(1.3);transform:scale(1.3);z-index:1} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js index ad020a7ce9..a15e5b8ecb 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js @@ -1 +1 @@ -define(["browser","dom","layoutManager","shell","embyRouter","apphost","css!./emby-button","registerElement"],function(browser,dom,layoutManager,shell,embyRouter,appHost){"use strict";function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px");var firstChild=btn.firstChild;firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}function onClickOpenTarget(e){shell.openUrl(this.getAttribute("data-target"))}function onAnchorClick(e){var href=this.getAttribute("href");"#"!==href&&(this.getAttribute("target")?(e.preventDefault(),shell.openUrl(href)):embyRouter.handleAnchorClick(e))}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype),EmbyLinkButtonPrototype=Object.create(HTMLAnchorElement.prototype);EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),browser.safari&&this.classList.add("emby-button-noflex"),layoutManager.tv&&(this.classList.add("emby-button-focusscale"),this.classList.add("emby-button-tv")),enableAnimation()&&(dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},EmbyButtonPrototype.attachedCallback=function(){"A"===this.tagName?(dom.removeEventListener(this,"click",onAnchorClick,{}),dom.addEventListener(this,"click",onAnchorClick,{})):this.getAttribute("data-target")&&(dom.removeEventListener(this,"click",onClickOpenTarget,{passive:!0}),dom.addEventListener(this,"click",onClickOpenTarget,{passive:!0}),"false"!==this.getAttribute("data-autohide")&&(appHost.supports("externallinks")?this.classList.remove("hide"):this.classList.add("hide")))},EmbyLinkButtonPrototype.createdCallback=EmbyButtonPrototype.createdCallback,EmbyLinkButtonPrototype.attachedCallback=EmbyButtonPrototype.attachedCallback,document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"}),document.registerElement("emby-linkbutton",{prototype:EmbyLinkButtonPrototype,extends:"a"})}); \ No newline at end of file +define(["browser","dom","layoutManager","shell","embyRouter","apphost","css!./emby-button","registerElement"],function(browser,dom,layoutManager,shell,embyRouter,appHost){"use strict";function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px");var firstChild=btn.firstChild;firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}function onAnchorClick(e){var href=this.getAttribute("href");"#"!==href&&(this.getAttribute("target")?appHost.supports("targetblank")||(e.preventDefault(),shell.openUrl(href)):embyRouter.handleAnchorClick(e))}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype),EmbyLinkButtonPrototype=Object.create(HTMLAnchorElement.prototype);EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),browser.safari&&this.classList.add("emby-button-noflex"),layoutManager.tv&&(this.classList.add("emby-button-focusscale"),this.classList.add("emby-button-tv")),enableAnimation()&&(dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari||browser.firefox&&"A"===this.tagName?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},EmbyButtonPrototype.attachedCallback=function(){"A"===this.tagName&&(dom.removeEventListener(this,"click",onAnchorClick,{}),dom.addEventListener(this,"click",onAnchorClick,{}),"true"===this.getAttribute("data-autohide")&&(appHost.supports("externallinks")?this.classList.remove("hide"):this.classList.add("hide")))},EmbyLinkButtonPrototype.createdCallback=EmbyButtonPrototype.createdCallback,EmbyLinkButtonPrototype.attachedCallback=EmbyButtonPrototype.attachedCallback,document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"}),document.registerElement("emby-linkbutton",{prototype:EmbyLinkButtonPrototype,extends:"a"})}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css b/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css index df9fd7e2a6..eaeaf24b85 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css @@ -1 +1 @@ -.mdl-checkbox{position:relative;z-index:1;vertical-align:middle;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;margin:0;padding:0 0 0 2.6em;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:2.3em}.checkboxFieldDescription{padding-left:2.6em}.checkboxContainer{margin-bottom:1.8em;display:-webkit-box;display:-webkit-flex;display:flex}.checkboxContainer-withDescription{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.mdl-checkbox__input{position:absolute;width:1px;height:1px;margin:0;padding:0;opacity:0;-ms-appearance:none;-moz-appearance:none;-webkit-appearance:none;appearance:none;border:none}.checkboxOutline{position:absolute;top:3px;left:0;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;width:1.83em;height:1.83em;margin:0;cursor:pointer;overflow:hidden;border:2px solid currentcolor;-webkit-border-radius:2px;border-radius:2px;z-index:2}.mdl-checkbox__input:checked+span+span+.checkboxOutline{border-color:#52B54B}.mdl-checkbox__input[disabled]+span+span+.checkboxOutline{border-color:rgba(0,0,0,.26);cursor:auto}.mdl-checkbox__focus-helper{position:absolute;top:-.915em;left:-.915em;width:3.66em;height:3.66em;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:3px 0 0;-webkit-border-radius:50%;border-radius:50%;background-color:transparent}.mdl-checkbox__input:focus+span+.mdl-checkbox__focus-helper{background-color:rgba(82,181,75,.26)}.mdl-checkbox__tick-outline{position:absolute;top:0;left:0;height:100%;width:100%;background:0 0;-webkit-transition-duration:.28s;-o-transition-duration:.28s;transition-duration:.28s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-property:background;-o-transition-property:background;transition-property:background}.mdl-checkbox__input:checked+span+span+.checkboxOutline .mdl-checkbox__tick-outline{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K) #52B54B}.mdl-checkbox__input:checked[disabled]+span+span+.checkboxOutline .mdl-checkbox__tick-outline{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K) rgba(0,0,0,.26)}.checkboxLabel{position:relative;cursor:pointer;margin:0}.mdl-checkbox__input[disabled]+.checkboxLabel{color:rgba(0,0,0,.26);cursor:auto}.checkboxList>.mdl-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;margin:.5em 0}.checkboxList-paperList{padding:1em!important;margin:.75em 0!important}.checkboxListLabel{opacity:.7;margin-bottom:0}@-webkit-keyframes repaintChrome{from,to{padding:0}} \ No newline at end of file +.mdl-checkbox{position:relative;z-index:1;vertical-align:middle;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;margin:0;padding:0 0 0 2.6em;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:2.3em}.checkboxContainer,.checkboxListContainer{margin-bottom:1.8em}.checkboxFieldDescription{padding-left:2.6em}.checkboxContainer{display:-webkit-box;display:-webkit-flex;display:flex}.checkboxContainer-withDescription{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.mdl-checkbox__input{position:absolute;width:1px;height:1px;margin:0;padding:0;opacity:0;-ms-appearance:none;-moz-appearance:none;-webkit-appearance:none;appearance:none;border:none}.checkboxOutline{position:absolute;top:3px;left:0;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;width:1.83em;height:1.83em;margin:0;cursor:pointer;overflow:hidden;border:2px solid currentcolor;-webkit-border-radius:2px;border-radius:2px;z-index:2}.mdl-checkbox__input:checked+span+span+.checkboxOutline{border-color:#52B54B}.mdl-checkbox__input[disabled]+span+span+.checkboxOutline{border-color:rgba(0,0,0,.26);cursor:auto}.mdl-checkbox__focus-helper{position:absolute;top:-.915em;left:-.915em;width:3.66em;height:3.66em;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:3px 0 0;-webkit-border-radius:50%;border-radius:50%;background-color:transparent}.mdl-checkbox__input:focus+span+.mdl-checkbox__focus-helper{background-color:rgba(82,181,75,.26)}.mdl-checkbox__tick-outline{position:absolute;top:0;left:0;height:100%;width:100%;background:0 0;-webkit-transition-duration:.28s;-o-transition-duration:.28s;transition-duration:.28s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-property:background;-o-transition-property:background;transition-property:background}.mdl-checkbox__input:checked+span+span+.checkboxOutline .mdl-checkbox__tick-outline{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K) #52B54B}.mdl-checkbox__input:checked[disabled]+span+span+.checkboxOutline .mdl-checkbox__tick-outline{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K) rgba(0,0,0,.26)}.checkboxLabel{position:relative;cursor:pointer;margin:0}.mdl-checkbox__input[disabled]+.checkboxLabel{color:rgba(0,0,0,.26);cursor:auto}.checkboxList>.mdl-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;margin:.5em 0}.checkboxList-paperList{padding:1em!important;margin:.75em 0!important}.checkboxListLabel{opacity:.7;margin-bottom:0}@-webkit-keyframes repaintChrome{from,to{padding:0}} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js b/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js index ed6d495c70..e5929f35fe 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-connect/connecthelper.js @@ -1 +1 @@ -define(["globalize","loading","alert"],function(globalize,loading,alert){"use strict";function showNewUserInviteMessage(result){if(!result.IsNewUserInvitation&&!result.IsPending)return Promise.resolve();var message=result.IsNewUserInvitation?globalize.translate("MessageInvitationSentToNewUser",result.GuestDisplayName):globalize.translate("MessageInvitationSentToUser",result.GuestDisplayName);alert({text:message,title:globalize.translate("HeaderInvitationSent")})}function inviteGuest(options){var apiClient=options.apiClient;return loading.show(),apiClient.ajax({type:"POST",url:apiClient.getUrl("Connect/Invite"),dataType:"json",data:options.guestOptions||{}}).then(function(result){return loading.hide(),showNewUserInviteMessage(result)},function(response){loading.hide(),404===response.status?alert({text:globalize.translate("GuestUserNotFound")}):(response.status||0)>=500?alert({text:globalize.translate("ErrorReachingEmbyConnect")}):showGuestGeneralErrorMessage()})}function showGuestGeneralErrorMessage(){var html=globalize.translate("ErrorAddingGuestAccount1",'https://emby.media/connect');html+="

"+globalize.translate("ErrorAddingGuestAccount2","apps@emby.media");var text=globalize.translate("ErrorAddingGuestAccount1","https://emby.media/connect");text+="\n\n"+globalize.translate("ErrorAddingGuestAccount2","apps@emby.media"),alert({text:text,html:html})}function showLinkUserMessage(username){var html,text;return username?(html=globalize.translate("ErrorAddingEmbyConnectAccount1",'https://emby.media/connect'),html+="

"+globalize.translate("ErrorAddingEmbyConnectAccount2","apps@emby.media"),text=globalize.translate("ErrorAddingEmbyConnectAccount1","https://emby.media/connect"),text+="\n\n"+globalize.translate("ErrorAddingEmbyConnectAccount2","apps@emby.media")):html=text=globalize.translate("DefaultErrorMessage"),alert({text:text,html:html})}function updateUserLink(apiClient,user,newConnectUsername){var currentConnectUsername=user.ConnectUserName||"",enteredConnectUsername=newConnectUsername,linkUrl=apiClient.getUrl("Users/"+user.Id+"/Connect/Link");return currentConnectUsername&&!enteredConnectUsername?apiClient.ajax({type:"DELETE",url:linkUrl}).then(function(){return alert({text:globalize.translate("MessageEmbyAccontRemoved"),title:globalize.translate("HeaderEmbyAccountRemoved")}).catch(function(){return Promise.resolve()})},function(){return alert({text:globalize.translate("ErrorRemovingEmbyConnectAccount")}).then(function(){return Promise.reject()})}):currentConnectUsername!==enteredConnectUsername?apiClient.ajax({type:"POST",url:linkUrl,data:{ConnectUsername:enteredConnectUsername},dataType:"json"}).then(function(result){var msgKey=result.IsPending?"MessagePendingEmbyAccountAdded":"MessageEmbyAccountAdded";return alert({text:globalize.translate(msgKey),title:globalize.translate("HeaderEmbyAccountAdded")}).catch(function(){return Promise.resolve()})},function(){return showLinkUserMessage(".").then(function(){return Promise.reject()})}):Promise.reject()}return{inviteGuest:inviteGuest,updateUserLink:updateUserLink}}); \ No newline at end of file +define(["globalize","loading","alert","emby-linkbutton"],function(globalize,loading,alert){"use strict";function showNewUserInviteMessage(result){if(!result.IsNewUserInvitation&&!result.IsPending)return Promise.resolve();var message=result.IsNewUserInvitation?globalize.translate("MessageInvitationSentToNewUser",result.GuestDisplayName):globalize.translate("MessageInvitationSentToUser",result.GuestDisplayName);alert({text:message,title:globalize.translate("HeaderInvitationSent")})}function inviteGuest(options){var apiClient=options.apiClient;return loading.show(),apiClient.ajax({type:"POST",url:apiClient.getUrl("Connect/Invite"),dataType:"json",data:options.guestOptions||{}}).then(function(result){return loading.hide(),showNewUserInviteMessage(result)},function(response){loading.hide(),404===response.status?alert({text:globalize.translate("GuestUserNotFound")}):(response.status||0)>=500?alert({text:globalize.translate("ErrorReachingEmbyConnect")}):showGuestGeneralErrorMessage()})}function showGuestGeneralErrorMessage(){var html=globalize.translate("ErrorAddingGuestAccount1",'https://emby.media/connect');html+="

"+globalize.translate("ErrorAddingGuestAccount2","apps@emby.media");var text=globalize.translate("ErrorAddingGuestAccount1","https://emby.media/connect");text+="\n\n"+globalize.translate("ErrorAddingGuestAccount2","apps@emby.media"),alert({text:text,html:html})}function showLinkUserMessage(username){var html,text;return username?(html=globalize.translate("ErrorAddingEmbyConnectAccount1",'https://emby.media/connect'),html+="

"+globalize.translate("ErrorAddingEmbyConnectAccount2","apps@emby.media"),text=globalize.translate("ErrorAddingEmbyConnectAccount1","https://emby.media/connect"),text+="\n\n"+globalize.translate("ErrorAddingEmbyConnectAccount2","apps@emby.media")):html=text=globalize.translate("DefaultErrorMessage"),alert({text:text,html:html})}function updateUserLink(apiClient,user,newConnectUsername){var currentConnectUsername=user.ConnectUserName||"",enteredConnectUsername=newConnectUsername,linkUrl=apiClient.getUrl("Users/"+user.Id+"/Connect/Link");return currentConnectUsername&&!enteredConnectUsername?apiClient.ajax({type:"DELETE",url:linkUrl}).then(function(){return alert({text:globalize.translate("MessageEmbyAccontRemoved"),title:globalize.translate("HeaderEmbyAccountRemoved")}).catch(function(){return Promise.resolve()})},function(){return alert({text:globalize.translate("ErrorRemovingEmbyConnectAccount")}).then(function(){return Promise.reject()})}):currentConnectUsername!==enteredConnectUsername?apiClient.ajax({type:"POST",url:linkUrl,data:{ConnectUsername:enteredConnectUsername},dataType:"json"}).then(function(result){var msgKey=result.IsPending?"MessagePendingEmbyAccountAdded":"MessageEmbyAccountAdded";return alert({text:globalize.translate(msgKey),title:globalize.translate("HeaderEmbyAccountAdded")}).catch(function(){return Promise.resolve()})},function(){return showLinkUserMessage(".").then(function(){return Promise.reject()})}):Promise.reject()}return{inviteGuest:inviteGuest,updateUserLink:updateUserLink}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css b/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css index a3da722b0f..1b40e7ee50 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-tabs/emby-tabs.css @@ -1 +1 @@ -.emby-tab-button,.emby-tabs-slider{position:relative}.emby-tab-button{background:0 0;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;outline:0!important;width:auto;font-family:inherit;font-size:inherit;display:inline-block;vertical-align:middle;-webkit-flex-shrink:0;flex-shrink:0;margin:0;padding:1.1em .9em;height:auto;min-width:initial;line-height:initial;-webkit-border-radius:0!important;border-radius:0!important;overflow:hidden;color:#999;font-weight:500}.emby-tab-button.emby-button-tv{padding:.4em .9em;font-weight:400}.emby-tab-button-active{color:#52B54B}.emby-tab-button-active.emby-button-tv{color:#fff}.emby-tab-button.emby-button-tv:focus{color:#52B54B;-webkit-transform:scale(1.26);transform:scale(1.26)}.emby-tab-button-ripple-effect{background:#222!important}.tabContent:not(.is-active){display:none} \ No newline at end of file +.emby-tab-button,.emby-tabs-slider{position:relative}.emby-tab-button{background:0 0;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;outline:0!important;width:auto;font-family:inherit;font-size:inherit;display:inline-block;vertical-align:middle;-webkit-flex-shrink:0;flex-shrink:0;margin:0;padding:1em .9em;height:auto;min-width:initial;line-height:initial;-webkit-border-radius:0!important;border-radius:0!important;overflow:hidden;color:#999;font-weight:500}.emby-tab-button.emby-button-tv{padding:.4em .9em;font-weight:400}.emby-tab-button-active{color:#52B54B}.emby-tab-button-active.emby-button-tv{color:#fff}.emby-tab-button.emby-button-tv:focus{color:#52B54B;-webkit-transform:scale(1.26);transform:scale(1.26)}.emby-tab-button-ripple-effect{background:#222!important}.tabContent:not(.is-active){display:none} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css index 5788ac6780..a694108762 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css +++ b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css @@ -1 +1 @@ -.formDialog,.formDialogHeader{display:-webkit-box;display:-webkit-flex}.formDialog{display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;position:relative}.formDialogHeader{padding:1em .5em;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-shrink:0;flex-shrink:0}.formDialogFooter,.formDialogHeader{background-color:#222326}.formDialogFooter-clear,.formDialogHeader-clear{background-color:transparent}.formDialogHeaderTitle{margin-left:.25em;margin-top:0;margin-bottom:0}.formDialogContent{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.dialogContentInner{padding:.5em 1em 20em}.dialogContentInner-mini{padding-bottom:10em}.dialog-content-centered{margin:0 auto;max-width:53em}.dialogContentTitle{margin-top:1em}.formDialogFooter{bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;padding:1.25em 1em;z-index:1;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.formDialogFooter-flex{position:static;width:100%}.formDialogFooterItem{margin-left:.5em!important;margin-right:.5em!important;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;text-align:center;-webkit-flex-basis:0;flex-basis:0}.formDialogFooterItem-autosize{-webkit-flex-basis:initial;flex-basis:initial;-webkit-box-flex:initial;-webkit-flex-grow:initial;flex-grow:initial;padding-left:2em;padding-right:2em}@media all and (min-width:800px){.formDialogFooterItem{max-width:80%}.dialogContentInner{padding-left:1.5em;padding-right:1.5em}}@media all and (min-width:1280px){.formDialogFooterItem{max-width:70%}.dialogContentInner{padding-left:2em;padding-right:2em}} \ No newline at end of file +.formDialog,.formDialogHeader{display:-webkit-box;display:-webkit-flex}.formDialog{display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;position:relative}.formDialogHeader{padding:1em .5em;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-shrink:0;flex-shrink:0}.formDialogFooter,.formDialogHeader{background-color:#222326}.formDialogFooter-clear,.formDialogHeader-clear{background-color:transparent}.formDialogHeaderTitle{margin-left:.25em;margin-top:0;margin-bottom:0}.formDialogContent{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.dialogContentInner{padding:.5em 1em 20em}.dialogContentInner-mini{padding-bottom:10em}.dialog-content-centered{margin:0 auto;max-width:53em}.dialogContentTitle{margin-top:1em}.formDialogFooter{bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;padding:1.25em 1em;z-index:1;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.formDialogFooter-flex{position:static;width:100%}.formDialogFooterItem{margin-left:.5em!important;margin-right:.5em!important;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;text-align:center;-webkit-flex-basis:0;flex-basis:0}.formDialogFooterItem-autosize{-webkit-flex-basis:initial;flex-basis:initial;-webkit-box-flex:initial;-webkit-flex-grow:initial;flex-grow:initial;padding-left:2em;padding-right:2em}@media all and (min-width:50em){.formDialogFooterItem{max-width:80%}.dialogContentInner{padding-left:1.5em;padding-right:1.5em}}@media all and (min-width:80em){.formDialogFooterItem{max-width:70%}.dialogContentInner{padding-left:2em;padding-right:2em}} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.css b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.css index cefc324806..ee71911f4a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.css +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.css @@ -1 +1 @@ -.tvGuideHeader,.tvguide{display:-webkit-box;display:-webkit-flex}.channelPrograms,.programContainer,.timeslotHeaders,.tvGuideHeader,.tvProgram{white-space:nowrap}.channelPrograms,.programContainer,.timeslotHeadersInner,.tvProgram{position:relative}.channelHeaderCell,.channelTimeslotHeader,.guideChannelName,.guideChannelNumber,.guideProgramName{-o-text-overflow:ellipsis;text-overflow:ellipsis}.channelPrograms,.channelsContainer,.tvGuideHeader,.tvguide{-webkit-box-orient:vertical;-webkit-box-direction:normal}.tvguide{display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:initial;-webkit-align-items:initial;align-items:initial}.tvGuideHeader{width:100%;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;flex-shrink:0;display:flex;min-height:5.6em}.guideHeaderDateSelection{font-size:86%;padding:.4em 0}.guideHeaderTimeslots{display:-webkit-box;display:-webkit-flex;display:flex}.tvProgramSectionHeader{margin:0}.tvProgram{display:block;text-decoration:none}.guideProgramIndicator{text-transform:uppercase;-webkit-border-radius:2px;border-radius:2px;margin-right:.5em;font-size:74%;padding:.2em .25em;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center;color:#fff}.channelTimeslotHeader{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.programContainer{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.channelPrograms{-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:.2em solid #121212}.currentTimeIndicatorBar{position:absolute;bottom:.05em;left:0;width:100%;display:-webkit-box;display:-webkit-flex;display:flex;margin-left:.25em;background-color:#52B54B;height:2px;-webkit-transform-origin:left;transform-origin:left;-webkit-transition:-webkit-transform .5s ease-out;-o-transition:transform .5s ease-out;transition:transform .5s ease-out}.currentTimeIndicatorArrowContainer{position:absolute;bottom:-.4em;width:100%;color:#52B54B;margin-left:.25em;-webkit-transform-origin:left;transform-origin:left;-webkit-transition:-webkit-transform .5s ease-out;-o-transition:transform .5s ease-out;transition:transform .5s ease-out}.currentTimeIndicatorArrow{width:1em;height:1em;font-size:1.2em;color:#52B54B;margin-left:-.52em}.channelPrograms,.timeslotHeadersInner{width:1800vw}@media all and (min-width:600px){.channelPrograms,.timeslotHeadersInner{width:1400vw}}@media all and (min-width:800px){.channelPrograms,.timeslotHeadersInner{width:1200vw}}@media all and (min-width:1280px){.channelPrograms,.timeslotHeadersInner{width:660vw}}.timeslotHeader{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-indent:.35em}.channelHeaderCell,.channelTimeslotHeader{overflow:hidden;border-right:1px solid #121212;background:#262626;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-decoration:none;text-align:left;contain:strict;-webkit-flex-shrink:0;flex-shrink:0}.channelTimeslotHeader,.channelsContainer{width:24vw}.channelHeaderCell{width:100%;border-bottom:.2em solid #121212!important;-webkit-background-size:auto 70%;background-size:auto 70%;background-position:92% center;background-repeat:no-repeat}@media all and (min-width:500px){.channelTimeslotHeader,.channelsContainer{width:16vw}}@media all and (min-width:600px){.channelTimeslotHeader,.channelsContainer{width:16vw}}@media all and (min-width:800px){.channelTimeslotHeader,.channelsContainer{width:14vw}}@media all and (min-width:1280px){.channelTimeslotHeader,.channelsContainer{width:12vw}}.btnGuideViewSettings{margin:0;-webkit-flex-shrink:0;flex-shrink:0}.btnGuideViewSettingsIcon{font-size:1.5em!important}.selectDateIcon{-webkit-flex-shrink:0;flex-shrink:0}@media all and (max-width:800px){.guideHdIcon,.liveTvProgram,.newTvProgram,.premiereTvProgram{display:none}}.channelHeaderCell,.channelPrograms{height:4.4em;contain:strict}.channelPrograms{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column}.channelHeaderCell-tv,.channelPrograms-tv{height:3.4em}.channelTimeslotHeader{border-right-color:transparent}.channelTimeslotHeader,.timeslotHeader{background:0 0;height:2.2em}.programGrid{padding-bottom:4px;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.guideProgramName,.programCell{-webkit-box-align:center;overflow:hidden}.timeslotHeader{width:2.0833333333333333333333333333333%}.programCell{position:absolute;top:0;bottom:0;border-left:.2em solid #121212!important;background-color:#1e1e1e;display:-webkit-box;display:-webkit-flex;display:flex;text-decoration:none;-webkit-align-items:center;align-items:center;text-align:left;contain:strict;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;margin:0!important;padding:0!important;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.programAccent{position:absolute;bottom:0;left:0;right:0;height:2px}.sportsAccent{background-color:#3949AB}.movieAccent{background-color:#5E35B1}.childAccent{background-color:#039BE5}.newsAccent{background-color:#43A047}.specialsAccent{background-color:#FB8C00}.guideProgramName{padding:0 .5em;-webkit-align-items:center;align-items:center;display:block;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.guideProgramNameText{margin:0;font-weight:400}.guideProgramSecondaryInfo{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.programSecondaryTitle{opacity:.6}.programIcon{margin-right:.25em;height:1em;width:1em;font-size:1.6em;color:#ddd;-webkit-flex-shrink:0;flex-shrink:0;-webkit-box-flex:0;-webkit-flex-grow:0;flex-grow:0}.programIcon+.programIcon{margin-left:.25em}.programTextIcon{font-weight:700;color:#1e1e1e;font-size:.9em;background:#555;padding:.18em .32em;-webkit-border-radius:.25em;border-radius:.25em;margin-right:.35em;width:auto;height:auto}.programTextIcon-tv{font-size:.6em}.guideChannelNumber{padding-left:1em;max-width:30%;overflow:hidden;font-weight:400;margin:0}.guideChannelName{margin-left:auto;margin-right:1em;overflow:hidden;max-width:70%}@media all and (min-width:1000px){.guideChannelName{max-width:40%}}@media all and (max-width:1000px){.guideChannelNumber{display:none}}.channelsContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;-webkit-flex-direction:column;flex-direction:column}.channelsContainer,.programGrid{contain:layout style}.channelHeaderCell,.programCell{outline:0!important}.channelHeaderCell:focus,.programCell:focus{background-color:#555}.seriesTimerIcon,.timerIcon{color:#c33!important}.seriesTimerIcon-inactive{color:inherit!important;opacity:.7}.guideOptions{color:#eee;-webkit-flex-shrink:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}@media all and (max-width:800px),all and (max-height:600px){.tvGuideHeader{padding-left:0}}.guideRequiresUnlock{margin:1em auto;text-align:center;padding:1em;-webkit-flex-shrink:0;flex-shrink:0}.noRubberBanding{padding-bottom:100px}.guideDateTabsSlider{text-align:center}.guide-date-tab-button{font-weight:400!important;color:inherit!important;padding:.3em .7em!important;margin:0 .3em!important;opacity:.25}.guide-date-tab-button.emby-tab-button-active{color:#52B54B!important;border-color:transparent!important;opacity:1;font-weight:400!important}.guide-date-tab-button:focus{color:#52B54B!important;opacity:1}.guide-date-tab-button.emby-button-tv:focus{background-color:#52B54B!important;-webkit-border-radius:.15em!important;border-radius:.15em!important;color:#fff!important;-webkit-transform:none!important;transform:none!important} \ No newline at end of file +.tvGuideHeader,.tvguide{display:-webkit-box;display:-webkit-flex}.channelPrograms,.programContainer,.timeslotHeaders,.tvGuideHeader,.tvProgram{white-space:nowrap}.channelPrograms,.programContainer,.timeslotHeadersInner,.tvProgram{position:relative}.channelHeaderCell,.channelTimeslotHeader,.guideChannelName,.guideChannelNumber,.guideProgramName{-o-text-overflow:ellipsis;text-overflow:ellipsis}.channelPrograms,.channelsContainer,.tvGuideHeader,.tvguide{-webkit-box-orient:vertical;-webkit-box-direction:normal}.tvguide{display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:initial;-webkit-align-items:initial;align-items:initial}.tvGuideHeader{width:100%;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;flex-shrink:0;display:flex;min-height:5.6em}.guideHeaderDateSelection{font-size:86%;padding:.4em 0}.guideHeaderTimeslots{display:-webkit-box;display:-webkit-flex;display:flex}.tvProgramSectionHeader{margin:0}.tvProgram{display:block;text-decoration:none}.guideProgramIndicator{text-transform:uppercase;-webkit-border-radius:2px;border-radius:2px;margin-right:.5em;font-size:74%;padding:.2em .25em;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center;color:#fff}.channelTimeslotHeader{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.programContainer{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.channelPrograms{-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:.2em solid #121212}.currentTimeIndicatorBar{position:absolute;bottom:.05em;left:0;width:100%;display:-webkit-box;display:-webkit-flex;display:flex;margin-left:.25em;background-color:#52B54B;height:2px;-webkit-transform-origin:left;transform-origin:left;-webkit-transition:-webkit-transform .5s ease-out;-o-transition:transform .5s ease-out;transition:transform .5s ease-out}.currentTimeIndicatorArrowContainer{position:absolute;bottom:-.4em;width:100%;color:#52B54B;margin-left:.25em;-webkit-transform-origin:left;transform-origin:left;-webkit-transition:-webkit-transform .5s ease-out;-o-transition:transform .5s ease-out;transition:transform .5s ease-out}.currentTimeIndicatorArrow{width:1em;height:1em;font-size:1.2em;color:#52B54B;margin-left:-.52em}.channelPrograms,.timeslotHeadersInner{width:1800vw}@media all and (min-width:37.5em){.channelPrograms,.timeslotHeadersInner{width:1400vw}}@media all and (min-width:50em){.channelPrograms,.timeslotHeadersInner{width:1200vw}}@media all and (min-width:80em){.channelPrograms,.timeslotHeadersInner{width:660vw}}.timeslotHeader{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-indent:.35em}.channelHeaderCell,.channelTimeslotHeader{overflow:hidden;border-right:1px solid #121212;background:#262626;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-decoration:none;text-align:left;contain:strict;-webkit-flex-shrink:0;flex-shrink:0}.channelTimeslotHeader,.channelsContainer{width:24vw}.channelHeaderCell{width:100%;border-bottom:.2em solid #121212!important;-webkit-background-size:auto 70%;background-size:auto 70%;background-position:92% center;background-repeat:no-repeat}@media all and (min-width:31.25em){.channelTimeslotHeader,.channelsContainer{width:16vw}}@media all and (min-width:37.5em){.channelTimeslotHeader,.channelsContainer{width:16vw}}@media all and (min-width:50em){.channelTimeslotHeader,.channelsContainer{width:14vw}}@media all and (min-width:80em){.channelTimeslotHeader,.channelsContainer{width:12vw}}.btnGuideViewSettings{margin:0;-webkit-flex-shrink:0;flex-shrink:0}.btnGuideViewSettingsIcon{font-size:1.5em!important}.selectDateIcon{-webkit-flex-shrink:0;flex-shrink:0}@media all and (max-width:50em){.guideHdIcon,.liveTvProgram,.newTvProgram,.premiereTvProgram{display:none}}.channelHeaderCell,.channelPrograms{height:4.4em;contain:strict}.channelPrograms{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column}.channelHeaderCell-tv,.channelPrograms-tv{height:3.4em}.channelTimeslotHeader{border-right-color:transparent}.channelTimeslotHeader,.timeslotHeader{background:0 0;height:2.2em}.programGrid{padding-bottom:4px;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.guideProgramName,.programCell{-webkit-box-align:center;overflow:hidden}.timeslotHeader{width:2.0833333333333333333333333333333%}.programCell{position:absolute;top:0;bottom:0;border-left:.2em solid #121212!important;background-color:#1e1e1e;display:-webkit-box;display:-webkit-flex;display:flex;text-decoration:none;-webkit-align-items:center;align-items:center;text-align:left;contain:strict;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;margin:0!important;padding:0!important;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.programAccent{position:absolute;bottom:0;left:0;right:0;height:2px}.sportsAccent{background-color:#3949AB}.movieAccent{background-color:#5E35B1}.childAccent{background-color:#039BE5}.newsAccent{background-color:#43A047}.specialsAccent{background-color:#FB8C00}.guideProgramName{padding:0 .5em;-webkit-align-items:center;align-items:center;display:block;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.guideProgramNameText{margin:0;font-weight:400}.guideProgramSecondaryInfo{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.programSecondaryTitle{opacity:.6}.programIcon{margin-right:.25em;height:1em;width:1em;font-size:1.6em;color:#ddd;-webkit-flex-shrink:0;flex-shrink:0;-webkit-box-flex:0;-webkit-flex-grow:0;flex-grow:0}.programIcon+.programIcon{margin-left:.25em}.programTextIcon{font-weight:700;color:#1e1e1e;font-size:.9em;background:#555;padding:.18em .32em;-webkit-border-radius:.25em;border-radius:.25em;margin-right:.35em;width:auto;height:auto}.programTextIcon-tv{font-size:.6em}.guideChannelNumber{padding-left:1em;max-width:30%;overflow:hidden;font-weight:400;margin:0}.guideChannelName{margin-left:auto;margin-right:1em;overflow:hidden;max-width:70%}@media all and (min-width:62.5em){.guideChannelName{max-width:40%}}@media all and (max-width:62.5em){.guideChannelNumber{display:none}}.channelsContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;-webkit-flex-direction:column;flex-direction:column}.channelsContainer,.programGrid{contain:layout style}.channelHeaderCell,.programCell{outline:0!important}.channelHeaderCell:focus,.programCell:focus{background-color:#555}.seriesTimerIcon,.timerIcon{color:#c33!important}.seriesTimerIcon-inactive{color:inherit!important;opacity:.7}.guideOptions{color:#eee;-webkit-flex-shrink:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}@media all and (max-width:50em),all and (max-height:37.5em){.tvGuideHeader{padding-left:0}}.guideRequiresUnlock{margin:1em auto;text-align:center;padding:1em;-webkit-flex-shrink:0;flex-shrink:0}.noRubberBanding{padding-bottom:100px}.guideDateTabsSlider{text-align:center}.guide-date-tab-button{font-weight:400!important;color:inherit!important;padding:.3em .7em!important;margin:0 .3em!important;opacity:.25}.guide-date-tab-button.emby-tab-button-active{color:#52B54B!important;border-color:transparent!important;opacity:1;font-weight:400!important}.guide-date-tab-button:focus{color:#52B54B!important;opacity:1}.guide-date-tab-button.emby-button-tv:focus{background-color:#52B54B!important;-webkit-border-radius:.15em!important;border-radius:.15em!important;color:#fff!important;-webkit-transform:none!important;transform:none!important} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/headroom/headroom.js b/dashboard-ui/bower_components/emby-webcomponents/headroom/headroom.js index 70d43970bf..4ced2257f6 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/headroom/headroom.js +++ b/dashboard-ui/bower_components/emby-webcomponents/headroom/headroom.js @@ -1 +1 @@ -define(["dom","layoutManager","browser","css!./headroom"],function(dom,layoutManager,browser){"use strict";function Debouncer(callback){this.callback=callback,this.ticking=!1}function Headroom(elems,options){options=Object.assign(Headroom.options,options||{}),this.lastKnownScrollY=0,this.elems=elems,this.debouncer=new Debouncer(this.update.bind(this)),this.offset=options.offset,this.scroller=options.scroller,this.initialised=!1,this.initialClass=options.initialClass,this.unPinnedClass=options.unPinnedClass,this.upTolerance=options.upTolerance,this.downTolerance=options.downTolerance}var requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return Debouncer.prototype={constructor:Debouncer,update:function(){this.callback&&this.callback(),this.ticking=!1},handleEvent:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)}},Headroom.prototype={constructor:Headroom,init:function(){if(browser.supportsCssAnimation()){for(var i=0,length=this.elems.length;i=this[direction+"Tolerance"]},shouldUnpin:function(currentScrollY,toleranceExceeded){var scrollingDown=currentScrollY>this.lastKnownScrollY,pastOffset=currentScrollY>=this.offset;return scrollingDown&&pastOffset&&toleranceExceeded},shouldPin:function(currentScrollY,toleranceExceeded){var scrollingUp=currentScrollYthis.lastKnownScrollY?"down":"up",toleranceExceeded=this.toleranceExceeded(currentScrollY,scrollDirection);currentScrollY<0||(this.shouldUnpin(currentScrollY,toleranceExceeded)?this.unpin():this.shouldPin(currentScrollY,toleranceExceeded)?this.pin(currentScrollY):this.clear(),this.lastKnownScrollY=currentScrollY)}},Headroom.options={upTolerance:0,downTolerance:0,offset:0,scroller:window,initialClass:"headroom",unPinnedClass:"headroom--unpinned"},Headroom}); \ No newline at end of file +define(["dom","layoutManager","browser","css!./headroom"],function(dom,layoutManager,browser){"use strict";function Debouncer(callback){this.callback=callback,this.ticking=!1}function Headroom(elems,options){options=Object.assign(Headroom.options,options||{}),this.lastKnownScrollY=0,this.elems=elems,this.debouncer=new Debouncer(this.update.bind(this)),this.offset=options.offset,this.scroller=options.scroller,this.initialised=!1,this.initialClass=options.initialClass,this.unPinnedClass=options.unPinnedClass,this.upTolerance=options.upTolerance,this.downTolerance=options.downTolerance}var requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return Debouncer.prototype={constructor:Debouncer,update:function(){this.callback&&this.callback(),this.ticking=!1},handleEvent:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)}},Headroom.prototype={constructor:Headroom,init:function(){if(browser.supportsCssAnimation()){for(var i=0,length=this.elems.length;i=this[direction+"Tolerance"]},shouldUnpin:function(currentScrollY,toleranceExceeded){var scrollingDown=currentScrollY>this.lastKnownScrollY,pastOffset=currentScrollY>=this.offset;return scrollingDown&&pastOffset&&toleranceExceeded},shouldPin:function(currentScrollY,toleranceExceeded){var scrollingUp=currentScrollYthis.lastKnownScrollY?"down":"up",toleranceExceeded=this.toleranceExceeded(currentScrollY,scrollDirection);currentScrollY<0||(this.shouldUnpin(currentScrollY,toleranceExceeded)?this.unpin():this.shouldPin(currentScrollY,toleranceExceeded)?this.pin(currentScrollY):layoutManager.tv&&this.clear(),this.lastKnownScrollY=currentScrollY)}},Headroom.options={upTolerance:0,downTolerance:0,offset:0,scroller:window,initialClass:"headroom",unPinnedClass:"headroom--unpinned"},Headroom}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.css b/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.css deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js b/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js index 90d6ae4a89..c8ce495fcf 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js +++ b/dashboard-ui/bower_components/emby-webcomponents/homescreensettings/homescreensettings.js @@ -1 +1 @@ -define(["require","globalize","loading","connectionManager","homeSections","dom","events","listViewStyle","emby-select","emby-checkbox","css!./homescreensettings"],function(require,globalize,loading,connectionManager,homeSections,dom,events){"use strict";function renderLatestItems(context,user,result){var folderHtml="";folderHtml+='
';var excludeViewTypes=["playlists","livetv","boxsets","channels"],excludeItemTypes=["Channel"];folderHtml+=result.Items.map(function(i){if(excludeViewTypes.indexOf(i.CollectionType||[])!==-1)return"";if(excludeItemTypes.indexOf(i.Type)!==-1)return"";var currentHtml="",id="chkIncludeInLatest"+i.Id,isChecked=user.Configuration.LatestItemsExcludes.indexOf(i.Id)===-1,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",context.querySelector(".latestItemsList").innerHTML=folderHtml}function renderViews(page,user,result){var folderHtml="";folderHtml+='
',folderHtml+=result.map(function(i){var currentHtml="",id="chkGroupFolder"+i.Id,isChecked=user.Configuration.GroupedFolders.indexOf(i.Id)!==-1,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",page.querySelector(".folderGroupList").innerHTML=folderHtml}function getLandingScreenOptions(type){var list=[];return list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions",isDefault:!0}),"movies"===type?(list.push({name:globalize.translate("sharedcomponents#Movies"),value:"movies"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"}),list.push({name:globalize.translate("sharedcomponents#Collections"),value:"collections"})):"tvshows"===type&&(list.push({name:globalize.translate("sharedcomponents#Latest"),value:"latest"}),list.push({name:globalize.translate("sharedcomponents#Shows"),value:"shows"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"})),list.push({name:globalize.translate("sharedcomponents#Genres"),value:"genres"}),list}function getLandingScreenOptionsHtml(type,userValue){return getLandingScreenOptions(type).map(function(o){var selected=userValue===o.value||o.isDefault&&!userValue,selectedHtml=selected?" selected":"",optionValue=o.isDefault?"":o.value;return'"}).join("")}function renderLandingScreens(context,user,userSettings,result){for(var html="",i=0,length=result.Items.length;i',html+='",html+="
"}}context.querySelector(".landingScreens").innerHTML=html,html?context.querySelector(".landingScreensSection").classList.remove("hide"):context.querySelector(".landingScreensSection").classList.add("hide")}function renderViewOrder(context,user,result){var html="",index=0;html+=result.Items.map(function(view){var currentHtml="";return currentHtml+='
',currentHtml+='',currentHtml+='
',currentHtml+="
",currentHtml+=view.Name,currentHtml+="
",currentHtml+="
",currentHtml+='',currentHtml+='',currentHtml+="
",index++,currentHtml}).join(""),context.querySelector(".viewOrderList").innerHTML=html}function updateHomeSectionValues(context,userSettings){for(var i=1;i<=7;i++){var select=context.querySelector("#selectHomeSection"+i),defaultValue=homeSections.getDefaultSection(i-1),option=select.querySelector("option[value="+defaultValue+"]")||select.querySelector('option[value=""]'),userValue=userSettings.get("homesection"+(i-1));option.value="",userValue!==defaultValue&&userValue?select.value=userValue:select.value=""}}function loadForm(context,user,userSettings,apiClient){context.querySelector(".chkHidePlayedFromLatest").checked=user.Configuration.HidePlayedInLatest||!1,updateHomeSectionValues(context,userSettings);var promise1=apiClient.getUserViews({},user.Id),promise2=ApiClient.getJSON(ApiClient.getUrl("Users/"+user.Id+"/GroupingOptions"));Promise.all([promise1,promise2]).then(function(responses){renderViews(context,user,responses[1]),renderLatestItems(context,user,responses[0]),renderViewOrder(context,user,responses[0]),renderLandingScreens(context,user,userSettings,responses[0]),loading.hide()})}function onSectionOrderListClick(e){var target=dom.parentWithClass(e.target,"btnViewItemMove");if(target){var viewItem=dom.parentWithClass(target,"viewItem");if(viewItem){dom.parentWithClass(viewItem,"paperList");if(target.classList.contains("btnViewItemDown")){var next=viewItem.nextSibling;next&&(viewItem.parentNode.removeChild(viewItem),next.parentNode.insertBefore(viewItem,next.nextSibling))}else{var prev=viewItem.previousSibling;prev&&(viewItem.parentNode.removeChild(viewItem),prev.parentNode.insertBefore(viewItem,prev))}}}}function getCheckboxItems(selector,context,isChecked){for(var inputs=context.querySelectorAll(selector),list=[],i=0,length=inputs.length;i",currentHtml+=""+i.Name+"",currentHtml+=""}).join(""),folderHtml+="
",context.querySelector(".latestItemsList").innerHTML=folderHtml}function renderViews(page,user,result){var folderHtml="";folderHtml+='
',folderHtml+=result.map(function(i){var currentHtml="",id="chkGroupFolder"+i.Id,isChecked=user.Configuration.GroupedFolders.indexOf(i.Id)!==-1,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+=""}).join(""),folderHtml+="
",page.querySelector(".folderGroupList").innerHTML=folderHtml}function getLandingScreenOptions(type){var list=[];return"movies"===type?(list.push({name:globalize.translate("sharedcomponents#Movies"),value:"movies",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"}),list.push({name:globalize.translate("sharedcomponents#Collections"),value:"collections"})):"tvshows"===type&&(list.push({name:globalize.translate("sharedcomponents#Suggestions"),value:"suggestions",isDefault:!0}),list.push({name:globalize.translate("sharedcomponents#Latest"),value:"latest"}),list.push({name:globalize.translate("sharedcomponents#Shows"),value:"shows"}),list.push({name:globalize.translate("sharedcomponents#Favorites"),value:"favorites"})),list.push({name:globalize.translate("sharedcomponents#Genres"),value:"genres"}),list}function getLandingScreenOptionsHtml(type,userValue){return getLandingScreenOptions(type).map(function(o){var selected=userValue===o.value||o.isDefault&&!userValue,selectedHtml=selected?" selected":"",optionValue=o.isDefault?"":o.value;return'"}).join("")}function renderLandingScreens(context,user,userSettings,result){for(var html="",i=0,length=result.Items.length;i',html+='",html+="
"}}context.querySelector(".landingScreens").innerHTML=html,html?context.querySelector(".landingScreensSection").classList.remove("hide"):context.querySelector(".landingScreensSection").classList.add("hide")}function renderViewOrder(context,user,result){var html="",index=0;html+=result.Items.map(function(view){var currentHtml="";return currentHtml+='
',currentHtml+='',currentHtml+='
',currentHtml+="
",currentHtml+=view.Name,currentHtml+="
",currentHtml+="
",currentHtml+='',currentHtml+='',currentHtml+="
",index++,currentHtml}).join(""),context.querySelector(".viewOrderList").innerHTML=html}function updateHomeSectionValues(context,userSettings){for(var i=1;i<=7;i++){var select=context.querySelector("#selectHomeSection"+i),defaultValue=homeSections.getDefaultSection(i-1),option=select.querySelector("option[value="+defaultValue+"]")||select.querySelector('option[value=""]'),userValue=userSettings.get("homesection"+(i-1));option.value="",userValue!==defaultValue&&userValue?select.value=userValue:select.value=""}}function loadForm(context,user,userSettings,apiClient){context.querySelector(".chkHidePlayedFromLatest").checked=user.Configuration.HidePlayedInLatest||!1,updateHomeSectionValues(context,userSettings);var promise1=apiClient.getUserViews({},user.Id),promise2=ApiClient.getJSON(ApiClient.getUrl("Users/"+user.Id+"/GroupingOptions"));Promise.all([promise1,promise2]).then(function(responses){renderViews(context,user,responses[1]),renderLatestItems(context,user,responses[0]),renderViewOrder(context,user,responses[0]),renderLandingScreens(context,user,userSettings,responses[0]),loading.hide()})}function onSectionOrderListClick(e){var target=dom.parentWithClass(e.target,"btnViewItemMove");if(target){var viewItem=dom.parentWithClass(target,"viewItem");if(viewItem){dom.parentWithClass(viewItem,"paperList");if(target.classList.contains("btnViewItemDown")){var next=viewItem.nextSibling;next&&(viewItem.parentNode.removeChild(viewItem),next.parentNode.insertBefore(viewItem,next.nextSibling))}else{var prev=viewItem.previousSibling;prev&&(viewItem.parentNode.removeChild(viewItem),prev.parentNode.insertBefore(viewItem,prev))}}}}function getCheckboxItems(selector,context,isChecked){for(var inputs=context.querySelectorAll(selector),list=[],i=0,length=inputs.length;i
-
-

+
+

${HeaderLibraryFolders}

diff --git a/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js b/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js index 517af9a9de..b84750934e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js +++ b/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js @@ -1 +1 @@ -define(["events","browser","pluginManager","apphost","appSettings","itemHelper"],function(events,browser,pluginManager,appHost,appSettings,itemHelper){"use strict";return function(){function getSavedVolume(){return appSettings.get("volume")||1}function saveVolume(value){value&&appSettings.set("volume",value)}function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function playUwp(options,elem){return Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function(file){var playlist=new Windows.Media.Playback.MediaPlaybackList,source1=Windows.Media.Core.MediaSource.createFromStorageFile(file),startTime=(options.playerStartPositionTicks||0)/1e4,winJsPlaybackItem=new Windows.Media.Playback.MediaPlaybackItem(source1,startTime);return playlist.items.append(winJsPlaybackItem),elem.src=URL.createObjectURL(playlist,{oneTimeOnly:!0}),currentSrc=elem.src,currentPlayOptions=options,playWithPromise(elem)})}function playWithPromise(elem){try{var promise=elem.play();return promise&&promise.then?promise.catch(function(e){var errorName=(e.name||"").toLowerCase();return"notallowederror"===errorName||"aborterror"===errorName?Promise.resolve():Promise.reject()}):Promise.resolve()}catch(err){return console.log("error calling audio.play: "+err),Promise.reject()}}function getCrossOriginValue(mediaSource){return mediaSource.IsRemote?null:"anonymous"}function supportsFade(){return!browser.tv}function fade(elem,startingVolume){var newVolume=Math.max(0,startingVolume-.15);return console.log("fading volume to "+newVolume),elem.volume=newVolume,newVolume<=0?Promise.resolve():new Promise(function(resolve,reject){cancelFadeTimeout(),fadeTimeout=setTimeout(function(){fade(elem,newVolume).then(resolve,reject)},100)})}function cancelFadeTimeout(){var timeout=fadeTimeout;timeout&&(clearTimeout(timeout),fadeTimeout=null)}function onEnded(){var stopInfo={src:currentSrc};events.trigger(self,"stopped",[stopInfo]),_currentTime=null,currentSrc=null,currentPlayOptions=null}function onTimeUpdate(){var time=this.currentTime;_currentTime=time,events.trigger(self,"timeupdate")}function onVolumeChange(){fadeTimeout||(saveVolume(this.volume),events.trigger(self,"volumechange"))}function onPlaying(e){started?events.trigger(self,"unpause"):(started=!0,this.removeAttribute("controls"),seekOnPlaybackStart(e.target)),events.trigger(self,"playing")}function seekOnPlaybackStart(element){var seconds=(currentPlayOptions.playerStartPositionTicks||0)/1e7;if(seconds){var src=(self.currentSrc()||"").toLowerCase();if(!browser.chrome||src.indexOf(".m3u8")!==-1){var delay=browser.safari?2500:0;delay?setTimeout(function(){element.currentTime=seconds},delay):element.currentTime=seconds}}}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code:"";errorCode=(errorCode||"").toString(),console.log("Media element error code: "+errorCode);var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}onErrorInternal(type)}function onErrorInternal(type){events.trigger(self,"error",[{type:type}])}function createMediaElement(){var elem=document.querySelector(".mediaPlayerAudio");return elem||(elem=document.createElement("audio"),elem.classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem),elem.volume=getSavedVolume(),elem.addEventListener("timeupdate",onTimeUpdate),elem.addEventListener("ended",onEnded),elem.addEventListener("volumechange",onVolumeChange),elem.addEventListener("pause",onPause),elem.addEventListener("playing",onPlaying),elem.addEventListener("error",onError)),mediaElement=elem,elem}function onDocumentClick(){document.removeEventListener("click",onDocumentClick);var elem=document.createElement("audio");elem.classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem),elem.src=pluginManager.mapPath(self,"blank.mp3"),elem.play(),setTimeout(function(){elem.src="",elem.removeAttribute("src")},1e3)}var self=this;self.name="Html Audio Player",self.type="mediaplayer",self.id="htmlaudioplayer",self.priority=1;var mediaElement,currentSrc,currentPlayOptions,started,_currentTime;self.canPlayMediaType=function(mediaType){return"audio"===(mediaType||"").toLowerCase()},self.getDeviceProfile=function(item){return appHost.getDeviceProfile?appHost.getDeviceProfile(item):getDefaultProfile()},self.currentSrc=function(){return currentSrc},self.play=function(options){_currentTime=null,started=!1;var elem=createMediaElement(),val=options.url,seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds);var crossOrigin=getCrossOriginValue(options.mediaSource);if(crossOrigin&&(elem.crossOrigin=crossOrigin),elem.title=options.title,options.mimeType&&browser.operaTv)elem.currentSrc&&(elem.src="",elem.removeAttribute("src")),elem.innerHTML='';else{if(window.Windows&&options.mediaSource&&options.mediaSource.IsLocal)return playUwp(options,elem);elem.src=val}return currentSrc=val,currentPlayOptions=options,playWithPromise(elem)},self.currentTime=function(val){if(mediaElement)return null!=val?void(mediaElement.currentTime=val/1e3):_currentTime?1e3*_currentTime:1e3*(mediaElement.currentTime||0)},self.duration=function(val){if(mediaElement){var duration=mediaElement.duration;if(duration&&!isNaN(duration)&&duration!==Number.POSITIVE_INFINITY&&duration!==Number.NEGATIVE_INFINITY)return 1e3*duration}return null},self.stop=function(destroyPlayer){cancelFadeTimeout();var elem=mediaElement,src=currentSrc;if(elem&&src){if(!destroyPlayer||!supportsFade())return elem.paused||elem.pause(),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),onEnded(),Promise.resolve();var originalVolume=elem.volume;return fade(elem,elem.volume).then(function(){elem.paused||elem.pause(),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),elem.volume=originalVolume,onEnded()})}return Promise.resolve()},self.destroy=function(){};var fadeTimeout;self.pause=function(){mediaElement&&mediaElement.pause()},self.resume=function(){mediaElement&&mediaElement.play()},self.unpause=function(){mediaElement&&mediaElement.play()},self.paused=function(){return!!mediaElement&&mediaElement.paused},self.setVolume=function(val){mediaElement&&(mediaElement.volume=val/100)},self.getVolume=function(){if(mediaElement)return 100*mediaElement.volume},self.volumeUp=function(){self.setVolume(Math.min(self.getVolume()+2,100))},self.volumeDown=function(){self.setVolume(Math.max(self.getVolume()-2,0))},self.setMute=function(mute){mediaElement&&(mediaElement.muted=mute)},self.isMuted=function(){return!!mediaElement&&mediaElement.muted},appHost.supports("htmlaudioautoplay")||document.addEventListener("click",onDocumentClick)}}); \ No newline at end of file +define(["events","browser","pluginManager","apphost","appSettings"],function(events,browser,pluginManager,appHost,appSettings){"use strict";function getSavedVolume(){return appSettings.get("volume")||1}function saveVolume(value){value&&appSettings.set("volume",value)}function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function fade(elem,startingVolume){var newVolume=Math.max(0,startingVolume-.15);return console.log("fading volume to "+newVolume),elem.volume=newVolume,newVolume<=0?Promise.resolve():new Promise(function(resolve,reject){cancelFadeTimeout(),fadeTimeout=setTimeout(function(){fade(elem,newVolume).then(resolve,reject)},100)})}function cancelFadeTimeout(){var timeout=fadeTimeout;timeout&&(clearTimeout(timeout),fadeTimeout=null)}function HtmlAudioPlayer(){function playUwp(options,elem){return Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function(file){var playlist=new Windows.Media.Playback.MediaPlaybackList,source1=Windows.Media.Core.MediaSource.createFromStorageFile(file),startTime=(options.playerStartPositionTicks||0)/1e4,winJsPlaybackItem=new Windows.Media.Playback.MediaPlaybackItem(source1,startTime);return playlist.items.append(winJsPlaybackItem),elem.src=URL.createObjectURL(playlist,{oneTimeOnly:!0}),self._currentSrc=elem.src,currentPlayOptions=options,playWithPromise(elem)})}function createMediaElement(){var elem=document.querySelector(".mediaPlayerAudio");return elem||(elem=document.createElement("audio"),elem.classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem),elem.volume=getSavedVolume(),elem.addEventListener("timeupdate",onTimeUpdate),elem.addEventListener("ended",onEnded),elem.addEventListener("volumechange",onVolumeChange),elem.addEventListener("pause",onPause),elem.addEventListener("playing",onPlaying),elem.addEventListener("error",onError)),elem}function playWithPromise(elem){try{var promise=elem.play();return promise&&promise.then?promise.catch(function(e){var errorName=(e.name||"").toLowerCase();return"notallowederror"===errorName||"aborterror"===errorName?Promise.resolve():Promise.reject()}):Promise.resolve()}catch(err){return console.log("error calling audio.play: "+err),Promise.reject()}}function getCrossOriginValue(mediaSource){return mediaSource.IsRemote?null:"anonymous"}function supportsFade(){return!browser.tv}function onEnded(){var stopInfo={src:self._currentSrc};events.trigger(self,"stopped",[stopInfo]),self._currentTime=null,self._currentSrc=null,currentPlayOptions=null}function onTimeUpdate(){var time=this.currentTime;self._currentTime=time,events.trigger(self,"timeupdate")}function onVolumeChange(){fadeTimeout||(saveVolume(this.volume),events.trigger(self,"volumechange"))}function onPlaying(e){started?events.trigger(self,"unpause"):(started=!0,this.removeAttribute("controls"),seekOnPlaybackStart(e.target)),events.trigger(self,"playing")}function seekOnPlaybackStart(element){var seconds=(currentPlayOptions.playerStartPositionTicks||0)/1e7;if(seconds){var src=(self.currentSrc()||"").toLowerCase();if(!browser.chrome||src.indexOf(".m3u8")!==-1){var delay=browser.safari?2500:0;delay?setTimeout(function(){element.currentTime=seconds},delay):element.currentTime=seconds}}}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code:"";errorCode=(errorCode||"").toString(),console.log("Media element error code: "+errorCode);var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}onErrorInternal(type)}function onErrorInternal(type){events.trigger(self,"error",[{type:type}])}function onDocumentClick(){document.removeEventListener("click",onDocumentClick);var elem=document.createElement("audio");elem.classList.add("mediaPlayerAudio"),elem.classList.add("hide"),document.body.appendChild(elem),elem.src=pluginManager.mapPath(self,"blank.mp3"),elem.play(),setTimeout(function(){elem.src="",elem.removeAttribute("src")},1e3)}var self=this;self.name="Html Audio Player",self.type="mediaplayer",self.id="htmlaudioplayer",self.priority=1;var currentPlayOptions,started;self.play=function(options){self._currentTime=null,started=!1;var elem=createMediaElement();self.mediaElement=elem;var val=options.url,seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds);var crossOrigin=getCrossOriginValue(options.mediaSource);if(crossOrigin&&(elem.crossOrigin=crossOrigin),elem.title=options.title,options.mimeType&&browser.operaTv)elem.currentSrc&&(elem.src="",elem.removeAttribute("src")),elem.innerHTML='';else{if(window.Windows&&options.mediaSource&&options.mediaSource.IsLocal)return playUwp(options,elem);elem.src=val}return self._currentSrc=val,currentPlayOptions=options,playWithPromise(elem)},self.stop=function(destroyPlayer){cancelFadeTimeout();var elem=self.mediaElement,src=self._currentSrc;if(elem&&src){if(!destroyPlayer||!supportsFade())return elem.paused||elem.pause(),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),onEnded(),Promise.resolve();var originalVolume=elem.volume;return fade(elem,elem.volume).then(function(){elem.paused||elem.pause(),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),elem.volume=originalVolume,onEnded()})}return Promise.resolve()},appHost.supports("htmlaudioautoplay")||document.addEventListener("click",onDocumentClick)}var fadeTimeout;return HtmlAudioPlayer.prototype.currentSrc=function(){return this._currentSrc},HtmlAudioPlayer.prototype.canPlayMediaType=function(mediaType){return"audio"===(mediaType||"").toLowerCase()},HtmlAudioPlayer.prototype.getDeviceProfile=function(item){return appHost.getDeviceProfile?appHost.getDeviceProfile(item):getDefaultProfile()},HtmlAudioPlayer.prototype.currentTime=function(val){var mediaElement=this.mediaElement;if(mediaElement){if(null!=val)return void(mediaElement.currentTime=val/1e3);var currentTime=this._currentTime;return currentTime?1e3*currentTime:1e3*(mediaElement.currentTime||0)}},HtmlAudioPlayer.prototype.duration=function(val){var mediaElement=this.mediaElement;if(mediaElement){var duration=mediaElement.duration;if(duration&&!isNaN(duration)&&duration!==Number.POSITIVE_INFINITY&&duration!==Number.NEGATIVE_INFINITY)return 1e3*duration}return null},HtmlAudioPlayer.prototype.pause=function(){var mediaElement=this.mediaElement;mediaElement&&mediaElement.pause()},HtmlAudioPlayer.prototype.resume=function(){var mediaElement=this.mediaElement;mediaElement&&mediaElement.play()},HtmlAudioPlayer.prototype.unpause=function(){var mediaElement=this.mediaElement;mediaElement&&mediaElement.play()},HtmlAudioPlayer.prototype.paused=function(){var mediaElement=this.mediaElement;return!!mediaElement&&mediaElement.paused},HtmlAudioPlayer.prototype.setVolume=function(val){var mediaElement=this.mediaElement;mediaElement&&(mediaElement.volume=val/100)},HtmlAudioPlayer.prototype.getVolume=function(){var mediaElement=this.mediaElement;if(mediaElement)return 100*mediaElement.volume},HtmlAudioPlayer.prototype.volumeUp=function(){this.setVolume(Math.min(this.getVolume()+2,100))},HtmlAudioPlayer.prototype.volumeDown=function(){this.setVolume(Math.max(this.getVolume()-2,0))},HtmlAudioPlayer.prototype.setMute=function(mute){var mediaElement=this.mediaElement;mediaElement&&(mediaElement.muted=mute)},HtmlAudioPlayer.prototype.isMuted=function(){var mediaElement=this.mediaElement;return!!mediaElement&&mediaElement.muted},HtmlAudioPlayer.prototype.destroy=function(){},HtmlAudioPlayer}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js b/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js index 93c9559cdd..7724b7aad9 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js +++ b/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js @@ -1 +1 @@ -define(["browser","pluginManager","events","apphost","loading","playbackManager","embyRouter","appSettings","connectionManager","itemHelper"],function(browser,pluginManager,events,appHost,loading,playbackManager,embyRouter,appSettings,connectionManager,itemHelper){"use strict";return function(){function getSavedVolume(){return appSettings.get("volume")||1}function saveVolume(value){value&&appSettings.set("volume",value)}function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function updateVideoUrl(streamInfo){var isHls=streamInfo.url.toLowerCase().indexOf(".m3u8")!==-1,mediaSource=streamInfo.mediaSource,item=streamInfo.item;if(mediaSource&&item&&!mediaSource.RunTimeTicks&&isHls&&"Transcode"===streamInfo.playMethod&&(browser.iOS||browser.osx)){var hlsPlaylistUrl=streamInfo.url.replace("master.m3u8","live.m3u8");return loading.show(),console.log("prefetching hls playlist: "+hlsPlaylistUrl),connectionManager.getApiClient(item.ServerId).ajax({type:"GET",url:hlsPlaylistUrl}).then(function(){return console.log("completed prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),streamInfo.url=hlsPlaylistUrl,Promise.resolve()},function(){return console.log("error prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),Promise.resolve()})}return Promise.resolve()}function getSupportedFeatures(){var list=[],video=document.createElement("video");return browser.ipad&&navigator.userAgent.toLowerCase().indexOf("os 9")===-1&&video.webkitSupportsPresentationMode&&video.webkitSupportsPresentationMode&&"function"==typeof video.webkitSetPresentationMode&&list.push("PictureInPicture"),list.push("SetBrightness"),list}function getCrossOriginValue(mediaSource){return mediaSource.IsRemote?null:"anonymous"}function requireHlsPlayer(callback){require(["hlsjs"],function(hls){window.Hls=hls,callback()})}function bindEventsToHlsPlayer(hls,elem,resolve,reject){hls.on(Hls.Events.MANIFEST_PARSED,function(){playWithPromise(elem).then(resolve,function(){reject&&(reject(),reject=null)})}),hls.on(Hls.Events.ERROR,function(event,data){if(console.log("HLS Error: Type: "+data.type+" Details: "+(data.details||"")+" Fatal: "+(data.fatal||!1)),data.fatal)switch(data.type){case Hls.ErrorTypes.NETWORK_ERROR:data.response&&data.response.code&&data.response.code>=400&&data.response.code<500?(console.log("hls.js response error code: "+data.response.code),reject?(reject(),reject=null):onErrorInternal("network")):(console.log("fatal network error encountered, try to recover"),hls.startLoad());break;case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");var currentReject=reject;reject=null,handleMediaError(currentReject);break;default:hls.destroy(),reject?(reject(),reject=null):onErrorInternal("mediadecodeerror")}})}function setCurrentSrc(elem,options){elem.removeEventListener("error",onError);var val=options.url;console.log("playing url: "+val);var seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds),destroyHlsPlayer();for(var tracks=getMediaStreamTextTracks(options.mediaSource),currentTrackIndex=-1,i=0,length=tracks.length;i'+getTracksHtml(tracks,options.mediaSource,options.item.ServerId),elem.addEventListener("loadedmetadata",onLoadedMetadata),currentSrc=val,setCurrentTrackElement(currentTrackIndex),playWithPromise(elem)):applySrc(elem,val,options).then(function(){return setTracks(elem,tracks,options.mediaSource,options.item.ServerId),currentSrc=val,setCurrentTrackElement(currentTrackIndex),playWithPromise(elem)})}function handleMediaError(reject){if(hlsPlayer){var now=Date.now();window.performance&&window.performance.now&&(now=performance.now()),!recoverDecodingErrorDate||now-recoverDecodingErrorDate>3e3?(recoverDecodingErrorDate=now,console.log("try to recover media Error ..."),hlsPlayer.recoverMediaError()):!recoverSwapAudioCodecDate||now-recoverSwapAudioCodecDate>3e3?(recoverSwapAudioCodecDate=now,console.log("try to swap Audio Codec and recover media Error ..."),hlsPlayer.swapAudioCodec(),hlsPlayer.recoverMediaError()):(console.error("cannot recover, last media error recovery failed ..."),reject?reject():onErrorInternal("mediadecodeerror"))}}function applySrc(elem,src,options){return window.Windows&&options.mediaSource&&options.mediaSource.IsLocal?Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function(file){var playlist=new Windows.Media.Playback.MediaPlaybackList,source1=Windows.Media.Core.MediaSource.createFromStorageFile(file),startTime=(options.playerStartPositionTicks||0)/1e4;return playlist.items.append(new Windows.Media.Playback.MediaPlaybackItem(source1,startTime)),elem.src=URL.createObjectURL(playlist,{oneTimeOnly:!0}),Promise.resolve()}):(elem.src=src,Promise.resolve())}function onSuccessfulPlay(elem){elem.addEventListener("error",onError)}function playWithPromise(elem){try{var promise=elem.play();return promise&&promise.then?promise.catch(function(e){var errorName=(e.name||"").toLowerCase();return"notallowederror"===errorName||"aborterror"===errorName?(onSuccessfulPlay(elem),Promise.resolve()):Promise.reject()}):(onSuccessfulPlay(elem),Promise.resolve())}catch(err){return console.log("error calling video.play: "+err),Promise.reject()}}function destroyHlsPlayer(){var player=hlsPlayer;if(player){try{player.destroy()}catch(err){console.log(err)}hlsPlayer=null}}function onEnded(){destroyCustomTrack(this),onEndedInternal(!0,this)}function onEndedInternal(triggerEnded,elem){if(elem.removeEventListener("error",onError),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),destroyHlsPlayer(),self.originalDocumentTitle&&(document.title=self.originalDocumentTitle,self.originalDocumentTitle=null),triggerEnded){var stopInfo={src:currentSrc};events.trigger(self,"stopped",[stopInfo]),_currentTime=null}currentSrc=null}function onTimeUpdate(e){var time=this.currentTime;_currentTime=time;var timeMs=1e3*time;timeMs+=(currentPlayOptions.transcodingOffsetTicks||0)/1e4,updateSubtitleText(timeMs),events.trigger(self,"timeupdate")}function onVolumeChange(){saveVolume(this.volume),events.trigger(self,"volumechange")}function onNavigatedToOsd(){videoDialog.classList.remove("videoPlayerContainer-withBackdrop"),videoDialog.classList.remove("videoPlayerContainer-onTop")}function onPlaying(e){started?events.trigger(self,"unpause"):(started=!0,this.removeAttribute("controls"),currentPlayOptions.title?(self.originalDocumentTitle=document.title,document.title=currentPlayOptions.title):self.originalDocumentTitle=null,setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying),seekOnPlaybackStart(e.target),currentPlayOptions.fullscreen?embyRouter.showVideoOsd().then(onNavigatedToOsd):(embyRouter.setTransparency("backdrop"),videoDialog.classList.remove("videoPlayerContainer-withBackdrop"),videoDialog.classList.remove("videoPlayerContainer-onTop")),loading.hide(),ensureValidVideo(this)),events.trigger(self,"playing")}function ensureValidVideo(elem){setTimeout(function(){if(elem===mediaElement)return 0===elem.videoWidth&&0===elem.videoHeight?void onErrorInternal("mediadecodeerror"):void 0},100)}function seekOnPlaybackStart(element){var seconds=(currentPlayOptions.playerStartPositionTicks||0)/1e7;if(seconds){var src=(self.currentSrc()||"").toLowerCase();if(!browser.chrome||src.indexOf(".m3u8")!==-1){var delay=browser.safari?2500:0;delay?setTimeout(function(){element.currentTime=seconds},delay):element.currentTime=seconds}}}function onClick(){events.trigger(self,"click")}function onDblClick(){events.trigger(self,"dblclick")}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code||0:0;console.log("Media element error code: "+errorCode.toString());var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:if(hlsPlayer)return void handleMediaError();type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}onErrorInternal(type)}function onErrorInternal(type){destroyCustomTrack(mediaElement),events.trigger(self,"error",[{type:type}])}function onLoadedMetadata(e){var mediaElem=e.target;if(mediaElem.removeEventListener("loadedmetadata",onLoadedMetadata),!hlsPlayer)try{mediaElem.play()}catch(err){console.log("error calling mediaElement.play: "+err)}}function enableHlsPlayer(src,item,mediaSource){if(src&&src.indexOf(".m3u8")===-1)return!1;if(null==window.MediaSource)return!1;if(canPlayNativeHls()){if(browser.edge)return!0;if(mediaSource.RunTimeTicks)return!1}return!(browser.safari&&!browser.osx)}function canPlayNativeHls(){var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function setTracks(elem,tracks,mediaSource,serverId){elem.innerHTML=getTracksHtml(tracks,mediaSource,serverId)}function getTextTrackUrl(track,serverId){return playbackManager.getSubtitleUrl(track,serverId)}function getTracksHtml(tracks,mediaSource,serverId){return tracks.map(function(t){var defaultAttribute=mediaSource.DefaultSubtitleStreamIndex===t.Index?" default":"",language=t.Language||"und",label=t.Language||"und";return'"}).join("")}function enableNativeTrackSupport(track){if(browser.firefox&&(currentSrc||"").toLowerCase().indexOf(".m3u8")!==-1)return!1;if(browser.ps4)return!1;if(browser.edge)return!1;if(track){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return!1}return!0}function destroyCustomTrack(videoElement){if(window.removeEventListener("resize",onVideoResize),window.removeEventListener("orientationchange",onVideoResize),videoSubtitlesElem){var subtitlesContainer=videoSubtitlesElem.parentNode;subtitlesContainer.parentNode.removeChild(subtitlesContainer),videoSubtitlesElem=null}if(currentTrackEvents=null,videoElement)for(var allTracks=videoElement.textTracks||[],i=0;i
',videoSubtitlesElem=subtitlesContainer.querySelector(".videoSubtitlesInner"),videoElement.parentNode.appendChild(subtitlesContainer),currentTrackEvents=data.TrackEvents}})}function renderTracksEvents(videoElement,track,serverId){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return void renderWithLibjass(videoElement,track,serverId);if(requiresCustomSubtitlesElement())return void renderSubtitlesWithCustomElement(videoElement,track,serverId);for(var trackElement=null,expectedId="manualTrack"+track.Index,allTracks=videoElement.textTracks,i=0;i=ticks){selectedTrackEvent=currentTrackEvent;break}}selectedTrackEvent?(videoSubtitlesElem.innerHTML=normalizeTrackEventText(selectedTrackEvent.Text),videoSubtitlesElem.classList.remove("hide")):(videoSubtitlesElem.innerHTML="",videoSubtitlesElem.classList.add("hide"))}}}function getMediaStreamAudioTracks(mediaSource){return mediaSource.MediaStreams.filter(function(s){return"Audio"===s.Type})}function getMediaStreamTextTracks(mediaSource){return mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type&&"External"===s.DeliveryMethod})}function setCurrentTrackElement(streamIndex){console.log("Setting new text track index to: "+streamIndex);var mediaStreamTextTracks=getMediaStreamTextTracks(currentPlayOptions.mediaSource),track=streamIndex===-1?null:mediaStreamTextTracks.filter(function(t){return t.Index===streamIndex})[0];enableNativeTrackSupport(track)?setTrackForCustomDisplay(mediaElement,null):(setTrackForCustomDisplay(mediaElement,track),streamIndex=-1,track=null);for(var expectedId="textTrack"+streamIndex,trackIndex=streamIndex!==-1&&track?mediaStreamTextTracks.indexOf(track):-1,modes=["disabled","showing","hidden"],allTracks=mediaElement.textTracks,i=0;i':'",dlg.innerHTML=html;var videoElement=dlg.querySelector("video");videoElement.volume=getSavedVolume(),videoElement.addEventListener("timeupdate",onTimeUpdate),videoElement.addEventListener("ended",onEnded),videoElement.addEventListener("volumechange",onVolumeChange),videoElement.addEventListener("pause",onPause),videoElement.addEventListener("playing",onPlaying),videoElement.addEventListener("click",onClick),videoElement.addEventListener("dblclick",onDblClick),document.body.insertBefore(dlg,document.body.firstChild),videoDialog=dlg,mediaElement=videoElement,options.fullscreen&&browser.supportsCssAnimation()&&!browser.slow?zoomIn(dlg).then(function(){resolve(videoElement)}):resolve(videoElement)})})}var self=this;self.name="Html Video Player",self.type="mediaplayer",self.id="htmlvideoplayer",self.priority=1;var mediaElement,videoDialog,currentSrc,hlsPlayer,currentPlayOptions,subtitleTrackIndexToSetOnPlaying,currentClock,currentAssRenderer,currentAspectRatio,videoSubtitlesElem,currentTrackEvents,started=!1,lastCustomTrackMs=0,customTrackIndex=-1;self.canPlayMediaType=function(mediaType){return"video"===(mediaType||"").toLowerCase()},self.getDeviceProfile=function(item,options){return appHost.getDeviceProfile?appHost.getDeviceProfile(item,options):getDefaultProfile()},self.currentSrc=function(){return currentSrc},self.play=function(options){return browser.msie&&"Transcode"===options.playMethod&&!window.MediaSource?(alert("Playback of this content is not supported in Internet Explorer. For a better experience, try a modern browser such as Microsoft Edge, Google Chrome, Firefox or Opera."),Promise.reject()):(started=!1,_currentTime=null,createMediaElement(options).then(function(elem){return updateVideoUrl(options,options.mediaSource).then(function(){return setCurrentSrc(elem,options)})}))};var supportedFeatures;self.supports=function(feature){return supportedFeatures||(supportedFeatures=getSupportedFeatures()),supportedFeatures.indexOf(feature)!==-1},self.setAspectRatio=function(val){var video=mediaElement;video&&(currentAspectRatio=val)},self.getAspectRatio=function(){return currentAspectRatio},self.getSupportedAspectRatios=function(){return[]},self.togglePictureInPicture=function(){return self.setPictureInPictureEnabled(!self.isPictureInPictureEnabled())},self.setPictureInPictureEnabled=function(isEnabled){var video=mediaElement;video&&video.webkitSupportsPresentationMode&&"function"==typeof video.webkitSetPresentationMode&&video.webkitSetPresentationMode(isEnabled?"picture-in-picture":"inline")},self.isPictureInPictureEnabled=function(isEnabled){var video=mediaElement;return!!video&&"picture-in-picture"===video.webkitPresentationMode};var recoverDecodingErrorDate,recoverSwapAudioCodecDate;self.setSubtitleStreamIndex=function(index){setCurrentTrackElement(index)},self.canSetAudioStreamIndex=function(){return!(!browser.edge&&!browser.msie)},self.setAudioStreamIndex=function(index){var i,length,audioStreams=getMediaStreamAudioTracks(currentPlayOptions.mediaSource),audioTrackOffset=-1;for(i=0,length=audioStreams.length;i=100?"none":rawValue/100;elem.style["-webkit-filter"]="brightness("+cssValue+");",elem.style.filter="brightness("+cssValue+")",elem.brightnessValue=val,events.trigger(self,"brightnesschange")}},self.getBrightness=function(){if(mediaElement){var val=mediaElement.brightnessValue;return null==val?100:val}},self.setVolume=function(val){mediaElement&&(mediaElement.volume=val/100)},self.getVolume=function(){if(mediaElement)return 100*mediaElement.volume},self.volumeUp=function(){self.setVolume(Math.min(self.getVolume()+2,100))},self.volumeDown=function(){self.setVolume(Math.max(self.getVolume()-2,0))},self.setMute=function(mute){mediaElement&&(mediaElement.muted=mute)},self.isMuted=function(){return!!mediaElement&&mediaElement.muted}}}); \ No newline at end of file +define(["browser","require","events","apphost","loading","dom","playbackManager","embyRouter","appSettings","connectionManager"],function(browser,require,events,appHost,loading,dom,playbackManager,embyRouter,appSettings,connectionManager){"use strict";function tryRemoveElement(elem){var parentNode=elem.parentNode;if(parentNode)try{parentNode.removeChild(elem)}catch(err){console.log("Error removing dialog element: "+err)}}function getSavedVolume(){return appSettings.get("volume")||1}function saveVolume(value){value&&appSettings.set("volume",value)}function getDefaultProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){resolve(profileBuilder({}))})})}function HtmlVideoPlayer(){function updateVideoUrl(streamInfo){var isHls=streamInfo.url.toLowerCase().indexOf(".m3u8")!==-1,mediaSource=streamInfo.mediaSource,item=streamInfo.item;if(mediaSource&&item&&!mediaSource.RunTimeTicks&&isHls&&"Transcode"===streamInfo.playMethod&&(browser.iOS||browser.osx)){var hlsPlaylistUrl=streamInfo.url.replace("master.m3u8","live.m3u8");return loading.show(),console.log("prefetching hls playlist: "+hlsPlaylistUrl),connectionManager.getApiClient(item.ServerId).ajax({type:"GET",url:hlsPlaylistUrl}).then(function(){return console.log("completed prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),streamInfo.url=hlsPlaylistUrl,Promise.resolve()},function(){return console.log("error prefetching hls playlist: "+hlsPlaylistUrl),loading.hide(),Promise.resolve()})}return Promise.resolve()}function getSupportedFeatures(){var list=[],video=document.createElement("video");return browser.ipad&&navigator.userAgent.toLowerCase().indexOf("os 9")===-1&&video.webkitSupportsPresentationMode&&video.webkitSupportsPresentationMode&&"function"==typeof video.webkitSetPresentationMode&&list.push("PictureInPicture"),list.push("SetBrightness"),list}function getCrossOriginValue(mediaSource){return mediaSource.IsRemote?null:"anonymous"}function requireHlsPlayer(callback){require(["hlsjs"],function(hls){window.Hls=hls,callback()})}function bindEventsToHlsPlayer(hls,elem,resolve,reject){hls.on(Hls.Events.MANIFEST_PARSED,function(){playWithPromise(elem).then(resolve,function(){reject&&(reject(),reject=null)})}),hls.on(Hls.Events.ERROR,function(event,data){if(console.log("HLS Error: Type: "+data.type+" Details: "+(data.details||"")+" Fatal: "+(data.fatal||!1)),data.fatal)switch(data.type){case Hls.ErrorTypes.NETWORK_ERROR:data.response&&data.response.code&&data.response.code>=400&&data.response.code<500?(console.log("hls.js response error code: "+data.response.code),reject?(reject(),reject=null):onErrorInternal("network")):(console.log("fatal network error encountered, try to recover"),hls.startLoad());break;case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");var currentReject=reject;reject=null,handleMediaError(currentReject);break;default:hls.destroy(),reject?(reject(),reject=null):onErrorInternal("mediadecodeerror")}})}function setCurrentSrc(elem,options){elem.removeEventListener("error",onError);var val=options.url;console.log("playing url: "+val);var seconds=(options.playerStartPositionTicks||0)/1e7;seconds&&(val+="#t="+seconds),destroyHlsPlayer();for(var tracks=getMediaStreamTextTracks(options.mediaSource),currentTrackIndex=-1,i=0,length=tracks.length;i'+getTracksHtml(tracks,options.mediaSource,options.item.ServerId),elem.addEventListener("loadedmetadata",onLoadedMetadata),currentSrc=val,setCurrentTrackElement(currentTrackIndex),playWithPromise(elem)):applySrc(elem,val,options).then(function(){return setTracks(elem,tracks,options.mediaSource,options.item.ServerId),currentSrc=val,setCurrentTrackElement(currentTrackIndex),playWithPromise(elem)})}function handleMediaError(reject){if(hlsPlayer){var now=Date.now();window.performance&&window.performance.now&&(now=performance.now()),!recoverDecodingErrorDate||now-recoverDecodingErrorDate>3e3?(recoverDecodingErrorDate=now,console.log("try to recover media Error ..."),hlsPlayer.recoverMediaError()):!recoverSwapAudioCodecDate||now-recoverSwapAudioCodecDate>3e3?(recoverSwapAudioCodecDate=now,console.log("try to swap Audio Codec and recover media Error ..."),hlsPlayer.swapAudioCodec(),hlsPlayer.recoverMediaError()):(console.error("cannot recover, last media error recovery failed ..."),reject?reject():onErrorInternal("mediadecodeerror"))}}function applySrc(elem,src,options){return window.Windows&&options.mediaSource&&options.mediaSource.IsLocal?Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function(file){var playlist=new Windows.Media.Playback.MediaPlaybackList,source1=Windows.Media.Core.MediaSource.createFromStorageFile(file),startTime=(options.playerStartPositionTicks||0)/1e4;return playlist.items.append(new Windows.Media.Playback.MediaPlaybackItem(source1,startTime)),elem.src=URL.createObjectURL(playlist,{oneTimeOnly:!0}),Promise.resolve()}):(elem.src=src,Promise.resolve())}function onSuccessfulPlay(elem){elem.addEventListener("error",onError)}function playWithPromise(elem){try{var promise=elem.play();return promise&&promise.then?promise.catch(function(e){var errorName=(e.name||"").toLowerCase();return"notallowederror"===errorName||"aborterror"===errorName?(onSuccessfulPlay(elem),Promise.resolve()):Promise.reject()}):(onSuccessfulPlay(elem),Promise.resolve())}catch(err){return console.log("error calling video.play: "+err),Promise.reject()}}function destroyHlsPlayer(){var player=hlsPlayer;if(player){try{player.destroy()}catch(err){console.log(err)}hlsPlayer=null}}function onEnded(){destroyCustomTrack(this),onEndedInternal(!0,this)}function onEndedInternal(triggerEnded,elem){if(elem.removeEventListener("error",onError),elem.src="",elem.innerHTML="",elem.removeAttribute("src"),destroyHlsPlayer(),self.originalDocumentTitle&&(document.title=self.originalDocumentTitle,self.originalDocumentTitle=null),triggerEnded){var stopInfo={src:currentSrc};events.trigger(self,"stopped",[stopInfo]),_currentTime=null}currentSrc=null}function onTimeUpdate(e){var time=this.currentTime;_currentTime=time;var timeMs=1e3*time;timeMs+=(currentPlayOptions.transcodingOffsetTicks||0)/1e4,updateSubtitleText(timeMs),events.trigger(self,"timeupdate")}function onVolumeChange(){saveVolume(this.volume),events.trigger(self,"volumechange")}function onNavigatedToOsd(){videoDialog.classList.remove("videoPlayerContainer-withBackdrop"),videoDialog.classList.remove("videoPlayerContainer-onTop")}function onPlaying(e){started?events.trigger(self,"unpause"):(started=!0,this.removeAttribute("controls"),currentPlayOptions.title?(self.originalDocumentTitle=document.title,document.title=currentPlayOptions.title):self.originalDocumentTitle=null,setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying),seekOnPlaybackStart(e.target),currentPlayOptions.fullscreen?embyRouter.showVideoOsd().then(onNavigatedToOsd):(embyRouter.setTransparency("backdrop"),videoDialog.classList.remove("videoPlayerContainer-withBackdrop"),videoDialog.classList.remove("videoPlayerContainer-onTop")),loading.hide(),ensureValidVideo(this)),events.trigger(self,"playing")}function ensureValidVideo(elem){setTimeout(function(){if(elem===mediaElement)return 0===elem.videoWidth&&0===elem.videoHeight?void onErrorInternal("mediadecodeerror"):void 0},100)}function seekOnPlaybackStart(element){var seconds=(currentPlayOptions.playerStartPositionTicks||0)/1e7;if(seconds){var src=(self.currentSrc()||"").toLowerCase();if(!browser.chrome||src.indexOf(".m3u8")!==-1){var delay=browser.safari?2500:0;delay?setTimeout(function(){element.currentTime=seconds},delay):element.currentTime=seconds}}}function onClick(){events.trigger(self,"click")}function onDblClick(){events.trigger(self,"dblclick")}function onPause(){events.trigger(self,"pause")}function onError(){var errorCode=this.error?this.error.code||0:0;console.log("Media element error code: "+errorCode.toString());var type;switch(errorCode){case 1:return;case 2:type="network";break;case 3:if(hlsPlayer)return void handleMediaError();type="mediadecodeerror";break;case 4:type="medianotsupported";break;default:return}onErrorInternal(type)}function onErrorInternal(type){destroyCustomTrack(mediaElement),events.trigger(self,"error",[{type:type}])}function onLoadedMetadata(e){var mediaElem=e.target;if(mediaElem.removeEventListener("loadedmetadata",onLoadedMetadata),!hlsPlayer)try{mediaElem.play()}catch(err){console.log("error calling mediaElement.play: "+err)}}function enableHlsPlayer(src,item,mediaSource){if(src&&src.indexOf(".m3u8")===-1)return!1;if(null==window.MediaSource)return!1;if(canPlayNativeHls()){if(browser.edge)return!0;if(mediaSource.RunTimeTicks)return!1}return!(browser.safari&&!browser.osx)}function canPlayNativeHls(){var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function setTracks(elem,tracks,mediaSource,serverId){elem.innerHTML=getTracksHtml(tracks,mediaSource,serverId)}function getTextTrackUrl(track,serverId){return playbackManager.getSubtitleUrl(track,serverId)}function getTracksHtml(tracks,mediaSource,serverId){return tracks.map(function(t){var defaultAttribute=mediaSource.DefaultSubtitleStreamIndex===t.Index?" default":"",language=t.Language||"und",label=t.Language||"und";return'"}).join("")}function enableNativeTrackSupport(track){if(browser.firefox&&(currentSrc||"").toLowerCase().indexOf(".m3u8")!==-1)return!1;if(browser.ps4)return!1;if(browser.edge)return!1;if(track){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return!1}return!0}function destroyCustomTrack(videoElement){if(window.removeEventListener("resize",onVideoResize),window.removeEventListener("orientationchange",onVideoResize),videoSubtitlesElem){var subtitlesContainer=videoSubtitlesElem.parentNode;subtitlesContainer&&tryRemoveElement(subtitlesContainer),videoSubtitlesElem=null}if(currentTrackEvents=null,videoElement)for(var allTracks=videoElement.textTracks||[],i=0;i
',videoSubtitlesElem=subtitlesContainer.querySelector(".videoSubtitlesInner"),videoElement.parentNode.appendChild(subtitlesContainer),currentTrackEvents=data.TrackEvents}})}function renderTracksEvents(videoElement,track,serverId){var format=(track.Codec||"").toLowerCase();if("ssa"===format||"ass"===format)return void renderWithLibjass(videoElement,track,serverId);if(requiresCustomSubtitlesElement())return void renderSubtitlesWithCustomElement(videoElement,track,serverId);for(var trackElement=null,expectedId="manualTrack"+track.Index,allTracks=videoElement.textTracks,i=0;i=ticks){selectedTrackEvent=currentTrackEvent;break}}selectedTrackEvent?(videoSubtitlesElem.innerHTML=normalizeTrackEventText(selectedTrackEvent.Text),videoSubtitlesElem.classList.remove("hide")):(videoSubtitlesElem.innerHTML="",videoSubtitlesElem.classList.add("hide"))}}}function getMediaStreamAudioTracks(mediaSource){return mediaSource.MediaStreams.filter(function(s){return"Audio"===s.Type})}function getMediaStreamTextTracks(mediaSource){return mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type&&"External"===s.DeliveryMethod})}function setCurrentTrackElement(streamIndex){console.log("Setting new text track index to: "+streamIndex);var mediaStreamTextTracks=getMediaStreamTextTracks(currentPlayOptions.mediaSource),track=streamIndex===-1?null:mediaStreamTextTracks.filter(function(t){return t.Index===streamIndex})[0];enableNativeTrackSupport(track)?setTrackForCustomDisplay(mediaElement,null):(setTrackForCustomDisplay(mediaElement,track),streamIndex=-1,track=null);for(var expectedId="textTrack"+streamIndex,trackIndex=streamIndex!==-1&&track?mediaStreamTextTracks.indexOf(track):-1,modes=["disabled","showing","hidden"],allTracks=mediaElement.textTracks,i=0;i':'",dlg.innerHTML=html;var videoElement=dlg.querySelector("video");videoElement.volume=getSavedVolume(),videoElement.addEventListener("timeupdate",onTimeUpdate),videoElement.addEventListener("ended",onEnded),videoElement.addEventListener("volumechange",onVolumeChange),videoElement.addEventListener("pause",onPause),videoElement.addEventListener("playing",onPlaying),videoElement.addEventListener("click",onClick),videoElement.addEventListener("dblclick",onDblClick),document.body.insertBefore(dlg,document.body.firstChild),videoDialog=dlg,mediaElement=videoElement,options.fullscreen&&browser.supportsCssAnimation()&&!browser.slow?zoomIn(dlg).then(function(){resolve(videoElement)}):resolve(videoElement)})})}var self=this;self.name="Html Video Player",self.type="mediaplayer",self.id="htmlvideoplayer",self.priority=1;var mediaElement,videoDialog,currentSrc,hlsPlayer,currentPlayOptions,subtitleTrackIndexToSetOnPlaying,currentClock,currentAssRenderer,videoSubtitlesElem,currentTrackEvents,started=!1,lastCustomTrackMs=0,customTrackIndex=-1;self.currentSrc=function(){return currentSrc},self.play=function(options){return browser.msie&&"Transcode"===options.playMethod&&!window.MediaSource?(alert("Playback of this content is not supported in Internet Explorer. For a better experience, try a modern browser such as Microsoft Edge, Google Chrome, Firefox or Opera."),Promise.reject()):(started=!1,_currentTime=null,createMediaElement(options).then(function(elem){return updateVideoUrl(options,options.mediaSource).then(function(){return setCurrentSrc(elem,options)})}))};var supportedFeatures;self.supports=function(feature){return supportedFeatures||(supportedFeatures=getSupportedFeatures()),supportedFeatures.indexOf(feature)!==-1},self.setPictureInPictureEnabled=function(isEnabled){var video=mediaElement;video&&video.webkitSupportsPresentationMode&&"function"==typeof video.webkitSetPresentationMode&&video.webkitSetPresentationMode(isEnabled?"picture-in-picture":"inline")},self.isPictureInPictureEnabled=function(isEnabled){var video=mediaElement;return!!video&&"picture-in-picture"===video.webkitPresentationMode};var recoverDecodingErrorDate,recoverSwapAudioCodecDate;self.setSubtitleStreamIndex=function(index){setCurrentTrackElement(index)},self.canSetAudioStreamIndex=function(){return!(!browser.edge&&!browser.msie)},self.setAudioStreamIndex=function(index){var i,length,audioStreams=getMediaStreamAudioTracks(currentPlayOptions.mediaSource),audioTrackOffset=-1;for(i=0,length=audioStreams.length;i=100?"none":rawValue/100;elem.style["-webkit-filter"]="brightness("+cssValue+");",elem.style.filter="brightness("+cssValue+")",elem.brightnessValue=val,events.trigger(self,"brightnesschange")}},self.getBrightness=function(){if(mediaElement){var val=mediaElement.brightnessValue;return null==val?100:val}},self.setVolume=function(val){mediaElement&&(mediaElement.volume=val/100)},self.getVolume=function(){if(mediaElement)return 100*mediaElement.volume},self.volumeUp=function(){self.setVolume(Math.min(self.getVolume()+2,100))},self.volumeDown=function(){self.setVolume(Math.max(self.getVolume()-2,0))},self.setMute=function(mute){mediaElement&&(mediaElement.muted=mute)},self.isMuted=function(){return!!mediaElement&&mediaElement.muted}}return HtmlVideoPlayer.prototype.canPlayMediaType=function(mediaType){return"video"===(mediaType||"").toLowerCase()},HtmlVideoPlayer.prototype.getDeviceProfile=function(item,options){return appHost.getDeviceProfile?appHost.getDeviceProfile(item,options):getDefaultProfile()},HtmlVideoPlayer.prototype.setAspectRatio=function(val){},HtmlVideoPlayer.prototype.getAspectRatio=function(){return this._currentAspectRatio},HtmlVideoPlayer.prototype.getSupportedAspectRatios=function(){return[]},HtmlVideoPlayer.prototype.togglePictureInPicture=function(){return this.setPictureInPictureEnabled(!this.isPictureInPictureEnabled())},HtmlVideoPlayer}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/style.css b/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/style.css index 9e66bd9f8d..6cac90d03f 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/style.css +++ b/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/style.css @@ -1 +1 @@ -.videoPlayerContainer{position:fixed!important;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop){background:#000!important}.videoPlayerContainer-withBackdrop{background-repeat:no-repeat;background-position:center center;-webkit-background-size:cover;background-size:cover;background-attachment:fixed;background-color:#000}.videoPlayerContainer-onTop{z-index:1000}.htmlvideoplayer{margin:0!important;padding:0!important;width:100%;height:100%}.htmlvideoplayer::-webkit-media-text-track-display{margin-top:-2.5em}.htmlvideoplayer::cue{background-color:transparent;text-shadow:2px 2px 2px rgba(0,0,0,1);-webkit-font-smoothing:antialiased;font-family:inherit}.videoSubtitles{position:fixed;bottom:10%;text-align:center;left:0;right:0;color:#fff;font-size:150%}.videoSubtitlesInner{max-width:70%;background-color:rgba(0,0,0,.8);padding:.25em;margin:auto;display:inline-block}@-webkit-keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}}@keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}} \ No newline at end of file +.videoPlayerContainer{position:fixed!important;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop){background:#000!important}.videoPlayerContainer-withBackdrop{background-repeat:no-repeat;background-position:center center;-webkit-background-size:cover;background-size:cover;background-attachment:fixed;background-color:#000}.videoPlayerContainer-onTop{z-index:1000}.htmlvideoplayer{margin:0!important;padding:0!important;width:100%;height:100%}.htmlvideoplayer::-webkit-media-text-track-display{margin-top:-2.5em}.htmlvideoplayer::cue{background-color:transparent;text-shadow:2px 2px 2px rgba(0,0,0,1);-webkit-font-smoothing:antialiased;font-family:inherit}.videoSubtitles{position:fixed;bottom:10%;text-align:center;left:0;right:0;color:#fff;font-size:170%}.videoSubtitlesInner{max-width:70%;background-color:rgba(0,0,0,.8);padding:.25em;margin:auto;display:inline-block}@-webkit-keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}}@keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.css b/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.css index a14443ed61..d466e85064 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.css +++ b/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.css @@ -1 +1 @@ -.imageEditor-buttons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:1em 0}.first-imageEditor-buttons{margin-top:2em}@media all and (min-width:1200px){.imageEditorCard{width:20%}} \ No newline at end of file +.imageEditor-buttons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:1em 0}.first-imageEditor-buttons{margin-top:2em} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js b/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js index 23f751b425..8a9995adff 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/imageeditor/imageeditor.js @@ -1 +1 @@ -define(["dialogHelper","connectionManager","loading","dom","layoutManager","focusManager","globalize","scrollHelper","imageLoader","require","cardStyle","formDialogStyle","emby-button","paper-icon-button-light","css!./imageeditor"],function(dialogHelper,connectionManager,loading,dom,layoutManager,focusManager,globalize,scrollHelper,imageLoader,require){"use strict";function getBaseRemoteOptions(){var options={};return options.itemId=currentItem.Id,options}function reload(page,item,focusContext){loading.show();var apiClient;item?(apiClient=connectionManager.getApiClient(item.ServerId),reloadItem(page,item,apiClient,focusContext)):(apiClient=connectionManager.getApiClient(currentItem.ServerId),apiClient.getItem(apiClient.getCurrentUserId(),currentItem.Id).then(function(item){reloadItem(page,item,apiClient,focusContext)}))}function addListeners(container,className,eventName,fn){container.addEventListener(eventName,function(e){var elem=dom.parentWithClass(e.target,className);elem&&fn.call(elem,e)})}function reloadItem(page,item,apiClient,focusContext){currentItem=item,apiClient.getRemoteImageProviders(getBaseRemoteOptions()).then(function(providers){for(var btnBrowseAllImages=page.querySelectorAll(".btnBrowseAllImages"),i=0,length=btnBrowseAllImages.length;i',html+='
',html+='
',html+='
';var imageUrl=getImageUrl(currentItem,apiClient,image.ImageType,image.ImageIndex,{maxWidth:imageSize});return html+='
",html+="
",html+="
",html+='
',html+='

'+image.ImageType+"

",html+='
',html+=image.Width&&image.Height?image.Width+" X "+image.Height:" ",html+="
",enableFooterButtons&&(html+='
',"Backdrop"===image.ImageType||"Screenshot"===image.ImageType?(html+=index>0?'':'',html+=indexchevron_right':''):imageProviders.length&&(html+=''),html+='',html+="
"),html+="
",html+="

",html+="
",html+=""}function deleteImage(context,itemId,type,index,apiClient,enableConfirmation){var afterConfirm=function(){apiClient.deleteItemImage(itemId,type,index).then(function(){hasChanges=!0,reload(context)})};return enableConfirmation?void require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmDeleteImage"),confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(afterConfirm)}):void afterConfirm()}function moveImage(context,apiClient,itemId,type,index,newIndex,focusContext){apiClient.updateItemImageIndex(itemId,type,index,newIndex).then(function(){hasChanges=!0,reload(context,null,focusContext)},function(){require(["alert"],function(alert){alert(globalize.translate("sharedcomponents#DefaultErrorMessage"))})})}function renderImages(page,item,apiClient,images,imageProviders,elem){var html="",imageSize=300,windowSize=dom.getWindowSize();windowSize.innerWidth>=1280&&(imageSize=Math.round(windowSize.innerWidth/4));for(var tagName=layoutManager.tv?"button":"div",enableFooterButtons=!layoutManager.tv,i=0,length=images.length;i0&&commands.push({name:globalize.translate("sharedcomponents#MoveLeft"),id:"moveleft"}),index',html+='
',html+='
',html+='
';var imageUrl=getImageUrl(currentItem,apiClient,image.ImageType,image.ImageIndex,{maxWidth:imageSize});return html+='
",html+="
",html+="
",html+='
',html+='

'+image.ImageType+"

",html+='
',html+=image.Width&&image.Height?image.Width+" X "+image.Height:" ",html+="
",enableFooterButtons&&(html+='
',"Backdrop"===image.ImageType||"Screenshot"===image.ImageType?(html+=index>0?'':'',html+=indexchevron_right':''):imageProviders.length&&(html+=''),html+='',html+="
"),html+="
",html+="
",html+="
",html+=""}function deleteImage(context,itemId,type,index,apiClient,enableConfirmation){var afterConfirm=function(){apiClient.deleteItemImage(itemId,type,index).then(function(){hasChanges=!0,reload(context)})};return enableConfirmation?void require(["confirm"],function(confirm){confirm({text:globalize.translate("sharedcomponents#ConfirmDeleteImage"),confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(afterConfirm)}):void afterConfirm()}function moveImage(context,apiClient,itemId,type,index,newIndex,focusContext){apiClient.updateItemImageIndex(itemId,type,index,newIndex).then(function(){hasChanges=!0,reload(context,null,focusContext)},function(){require(["alert"],function(alert){alert(globalize.translate("sharedcomponents#DefaultErrorMessage"))})})}function renderImages(page,item,apiClient,images,imageProviders,elem){var html="",imageSize=300,windowSize=dom.getWindowSize();windowSize.innerWidth>=1280&&(imageSize=Math.round(windowSize.innerWidth/4));for(var tagName=layoutManager.tv?"button":"div",enableFooterButtons=!layoutManager.tv,i=0,length=images.length;i0&&commands.push({name:globalize.translate("sharedcomponents#MoveLeft"),id:"moveleft"}),index");if(identifyResult.ImageUrl){var displayUrl=getSearchImageDisplayUrl(identifyResult.ImageUrl,identifyResult.SearchProviderName);resultHtml='
'+resultHtml+"
"}page.querySelector(".selectedSearchResult").innerHTML=resultHtml,focusManager.focus(identifyOptionsForm.querySelector(".btnSubmit"))}function getSearchResultHtml(result,index){var padderClass,html="",cssClass="card scalableCard",cardBoxCssClass="cardBox visualCardBox";if("Episode"===currentItemType?(cssClass+=" backdropCard backdropCard-scalable",padderClass="cardPadder-backdrop"):"MusicAlbum"===currentItemType||"MusicArtist"===currentItemType?(cssClass+=" squareCard squareCard-scalable",padderClass="cardPadder-square"):(cssClass+=" portraitCard portraitCard-scalable",padderClass="cardPadder-portrait"),layoutManager.tv&&(cssClass+=" card-focusscale",cardBoxCssClass+=" cardBox-focustransform"),cardBoxCssClass+=" card-focuscontent",html+='"}function getSearchImageDisplayUrl(url,provider){var apiClient=getApiClient();return apiClient.getUrl("Items/RemoteSearch/Image",{imageUrl:url,ProviderName:provider})}function submitIdentficationResult(page){loading.show();var options={ReplaceAllImages:page.querySelector("#chkIdentifyReplaceImages").checked},apiClient=getApiClient();apiClient.ajax({type:"POST",url:apiClient.getUrl("Items/RemoteSearch/Apply/"+currentItem.Id,options),data:JSON.stringify(currentSearchResult),contentType:"application/json"}).then(function(){hasChanges=!0,loading.hide(),dialogHelper.close(page)},function(){loading.hide(),dialogHelper.close(page)})}function showIdentificationForm(page,item){var apiClient=getApiClient();apiClient.getJSON(apiClient.getUrl("Items/"+item.Id+"/ExternalIdInfos")).then(function(idList){for(var html="",providerIds=item.ProviderIds||{},i=0,length=idList.length;i';var idLabel=globalize.translate("sharedcomponents#LabelDynamicExternalId").replace("{0}",idInfo.Name);providerIds[idInfo.Key]||"";html+='',html+="
"}page.querySelector("#txtLookupName").value="","Person"===item.Type||"BoxSet"===item.Type?(page.querySelector(".fldLookupYear").classList.add("hide"),page.querySelector("#txtLookupYear").value=""):(page.querySelector(".fldLookupYear").classList.remove("hide"),page.querySelector("#txtLookupYear").value=""),page.querySelector(".identifyProviderIds").innerHTML=html,page.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Identify")})}function showEditor(itemId){loading.show(),require(["text!./itemidentifier.template.html"],function(template){var apiClient=getApiClient();apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){currentItem=item,currentItemType=currentItem.Type;var dialogOptions={size:"medium",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,dlg.addEventListener("close",onDialogClosed),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.querySelector(".identifyOptionsForm").addEventListener("submit",function(e){return e.preventDefault(),submitIdentficationResult(dlg),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.classList.add("identifyDialog"),showIdentificationForm(dlg,item),loading.hide()})})}function onDialogClosed(){loading.hide(),hasChanges?currentResolve():currentReject()}function showEditorFindNew(itemName,itemYear,itemType,resolveFunc){currentItem=null,currentItemType=itemType,require(["text!./itemidentifier.template.html"],function(template){var dialogOptions={size:"medium",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.addEventListener("close",function(){loading.hide();var foundItem=hasChanges?currentSearchResult:null;resolveFunc(foundItem)}),dlg.classList.add("identifyDialog"),showIdentificationFormFindNew(dlg,itemName,itemYear,itemType)})}function showIdentificationFormFindNew(dlg,itemName,itemYear,itemType){dlg.querySelector("#txtLookupName").value=itemName,"Person"===itemType||"BoxSet"===itemType?(dlg.querySelector(".fldLookupYear").classList.add("hide"),dlg.querySelector("#txtLookupYear").value=""):(dlg.querySelector(".fldLookupYear").classList.remove("hide"),dlg.querySelector("#txtLookupYear").value=itemYear),dlg.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Search")}var currentItem,currentItemType,currentServerId,currentResolve,currentReject,currentSearchResult,hasChanges=!1;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,currentServerId=serverId,hasChanges=!1,showEditor(itemId)})},showFindNew:function(itemName,itemYear,itemType,serverId){return new Promise(function(resolve,reject){currentServerId=serverId,hasChanges=!1,showEditorFindNew(itemName,itemYear,itemType,resolve)})}}}); \ No newline at end of file +define(["dialogHelper","loading","cardBuilder","connectionManager","require","globalize","scrollHelper","layoutManager","focusManager","browser","emby-input","emby-checkbox","paper-icon-button-light","css!./../formdialog","material-icons","cardStyle"],function(dialogHelper,loading,cardBuilder,connectionManager,require,globalize,scrollHelper,layoutManager,focusManager,browser){"use strict";function getApiClient(){return connectionManager.getApiClient(currentServerId)}function searchForIdentificationResults(page){var i,length,value,lookupInfo={ProviderIds:{}},identifyField=page.querySelectorAll(".identifyField");for(i=0,length=identifyField.length;i");if(identifyResult.ImageUrl){var displayUrl=getSearchImageDisplayUrl(identifyResult.ImageUrl,identifyResult.SearchProviderName);resultHtml='
'+resultHtml+"
"}page.querySelector(".selectedSearchResult").innerHTML=resultHtml,focusManager.focus(identifyOptionsForm.querySelector(".btnSubmit"))}function getSearchResultHtml(result,index){var padderClass,html="",cssClass="card scalableCard",cardBoxCssClass="cardBox visualCardBox";if("Episode"===currentItemType?(cssClass+=" backdropCard backdropCard-scalable",padderClass="cardPadder-backdrop"):"MusicAlbum"===currentItemType||"MusicArtist"===currentItemType?(cssClass+=" squareCard squareCard-scalable",padderClass="cardPadder-square"):(cssClass+=" portraitCard portraitCard-scalable",padderClass="cardPadder-portrait"),layoutManager.tv&&!browser.slow&&(cardBoxCssClass+=" cardBox-focustransform"),cardBoxCssClass+=" card-focuscontent",html+='"}function getSearchImageDisplayUrl(url,provider){var apiClient=getApiClient();return apiClient.getUrl("Items/RemoteSearch/Image",{imageUrl:url,ProviderName:provider})}function submitIdentficationResult(page){loading.show();var options={ReplaceAllImages:page.querySelector("#chkIdentifyReplaceImages").checked},apiClient=getApiClient();apiClient.ajax({type:"POST",url:apiClient.getUrl("Items/RemoteSearch/Apply/"+currentItem.Id,options),data:JSON.stringify(currentSearchResult),contentType:"application/json"}).then(function(){hasChanges=!0,loading.hide(),dialogHelper.close(page)},function(){loading.hide(),dialogHelper.close(page)})}function showIdentificationForm(page,item){var apiClient=getApiClient();apiClient.getJSON(apiClient.getUrl("Items/"+item.Id+"/ExternalIdInfos")).then(function(idList){for(var html="",providerIds=item.ProviderIds||{},i=0,length=idList.length;i';var idLabel=globalize.translate("sharedcomponents#LabelDynamicExternalId").replace("{0}",idInfo.Name);providerIds[idInfo.Key]||"";html+='',html+="
"}page.querySelector("#txtLookupName").value="","Person"===item.Type||"BoxSet"===item.Type?(page.querySelector(".fldLookupYear").classList.add("hide"),page.querySelector("#txtLookupYear").value=""):(page.querySelector(".fldLookupYear").classList.remove("hide"),page.querySelector("#txtLookupYear").value=""),page.querySelector(".identifyProviderIds").innerHTML=html,page.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Identify")})}function showEditor(itemId){loading.show(),require(["text!./itemidentifier.template.html"],function(template){var apiClient=getApiClient();apiClient.getItem(apiClient.getCurrentUserId(),itemId).then(function(item){currentItem=item,currentItemType=currentItem.Type;var dialogOptions={size:"medium",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,dlg.addEventListener("close",onDialogClosed),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.querySelector(".identifyOptionsForm").addEventListener("submit",function(e){return e.preventDefault(),submitIdentficationResult(dlg),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.classList.add("identifyDialog"),showIdentificationForm(dlg,item),loading.hide()})})}function onDialogClosed(){loading.hide(),hasChanges?currentResolve():currentReject()}function showEditorFindNew(itemName,itemYear,itemType,resolveFunc){currentItem=null,currentItemType=itemType,require(["text!./itemidentifier.template.html"],function(template){var dialogOptions={size:"medium",removeOnClose:!0,scrollY:!1};layoutManager.tv&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("recordingDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),dialogHelper.open(dlg),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector(".popupIdentifyForm").addEventListener("submit",function(e){return e.preventDefault(),searchForIdentificationResults(dlg),!1}),dlg.addEventListener("close",function(){loading.hide();var foundItem=hasChanges?currentSearchResult:null;resolveFunc(foundItem)}),dlg.classList.add("identifyDialog"),showIdentificationFormFindNew(dlg,itemName,itemYear,itemType)})}function showIdentificationFormFindNew(dlg,itemName,itemYear,itemType){dlg.querySelector("#txtLookupName").value=itemName,"Person"===itemType||"BoxSet"===itemType?(dlg.querySelector(".fldLookupYear").classList.add("hide"),dlg.querySelector("#txtLookupYear").value=""):(dlg.querySelector(".fldLookupYear").classList.remove("hide"),dlg.querySelector("#txtLookupYear").value=itemYear),dlg.querySelector(".formDialogHeaderTitle").innerHTML=globalize.translate("sharedcomponents#Search")}var currentItem,currentItemType,currentServerId,currentResolve,currentReject,currentSearchResult,hasChanges=!1;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,currentServerId=serverId,hasChanges=!1,showEditor(itemId)})},showFindNew:function(itemName,itemYear,itemType,serverId){return new Promise(function(resolve,reject){currentServerId=serverId,hasChanges=!1,showEditorFindNew(itemName,itemYear,itemType,resolve)})}}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js b/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js index dbc2e3e5fb..228dcfc2f1 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/layoutmanager.js @@ -1 +1 @@ -define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(self,layout,selectedLayout){layout===selectedLayout?(self[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(self[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){}return LayoutManager.prototype.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(this,"mobile",layout),setLayout(this,"tv",layout),setLayout(this,"desktop",layout),save!==!1&&appSettings.set("layout",layout)):(this.autoLayout(),save!==!1&&appSettings.set("layout","")),events.trigger(this,"modechange")},LayoutManager.prototype.getSavedLayout=function(layout){return appSettings.get("layout")},LayoutManager.prototype.autoLayout=function(){browser.mobile?this.setLayout("mobile",!1):browser.tv||browser.xboxOne?this.setLayout("tv",!1):this.setLayout(this.defaultLayout||"tv",!1)},LayoutManager.prototype.init=function(){var saved=this.getSavedLayout();saved?this.setLayout(saved,!1):this.autoLayout()},new LayoutManager}); \ No newline at end of file +define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(instance,layout,selectedLayout){layout===selectedLayout?(instance[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(instance[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){}return LayoutManager.prototype.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(this,"mobile",layout),setLayout(this,"tv",layout),setLayout(this,"desktop",layout),save!==!1&&appSettings.set("layout",layout)):(this.autoLayout(),save!==!1&&appSettings.set("layout","")),events.trigger(this,"modechange")},LayoutManager.prototype.getSavedLayout=function(layout){return appSettings.get("layout")},LayoutManager.prototype.autoLayout=function(){browser.mobile?this.setLayout("mobile",!1):browser.tv||browser.xboxOne?this.setLayout("tv",!1):this.setLayout(this.defaultLayout||"tv",!1)},LayoutManager.prototype.init=function(){var saved=this.getSavedLayout();saved?this.setLayout(saved,!1):this.autoLayout()},new LayoutManager}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css index 1995eff18a..0f555588f2 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css +++ b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css @@ -1 +1 @@ -.listItemBody,.listItemButton,.listItemIcon,.listItemImage{display:inline-block;vertical-align:middle}.listItem,.listItemBody,.listItemButton{vertical-align:middle}.listItemBody,.listItemBodyText{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.listItem{background:0 0;border:0;outline:0!important;color:inherit;font-family:inherit;font-size:inherit;margin:0;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-align:left;padding:.25em 1.15em;cursor:pointer;overflow:hidden}.listItem-button{width:100%}.listItem-largeImage{padding:.5em!important}.listItemAside,.listItemIcon,.listItemImage{-webkit-flex-shrink:0;flex-shrink:0}.listItemButton{margin:0;-webkit-flex-shrink:0;flex-shrink:0;contain:layout style}.listViewDragHandle{margin-left:-.25em!important;touch-action:none}.listItemBody{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;padding:.8em 1em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.listItemBody-noleftpadding{padding-left:0}.listItem-shaded:nth-child(even){background:#1c1c1c;background:rgba(30,30,30,.9)}.three-line{min-height:6.3em;padding-top:0;padding-bottom:0}.listItemBodyText{margin:0;padding:.25em 0}.listItemBodyText-nowrap{white-space:nowrap}.listItemImage{width:7.4vh;height:7.4vh;min-width:40px;min-height:40px;background-repeat:no-repeat;-webkit-background-size:contain;background-size:contain;-webkit-flex-shrink:0;flex-shrink:0;background-position:center center;position:relative}.listItemImage-large{width:45vh;height:30vh;background-position:center center;margin-right:2%;margin-left:1%}.listItemIcon{width:1em!important;height:1em!important;font-size:143%;-webkit-border-radius:500px;border-radius:500px;padding:.5em;color:#fff}.listItemIcon:not(.listItemIcon-transparent){background-color:#52B54B}.listItemProgressBar{position:absolute;bottom:0;left:0;right:0}.listItem .secondary{color:#888}.listItem:focus .secondary{color:inherit!important}.listItem-focusscale{-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.listItem-focusscale:focus{-webkit-transform:scale(1.025,1.025);transform:scale(1.025,1.025)}.paperList{padding:.5em 0;margin:1em auto;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.paperList-clear{-webkit-box-shadow:none!important;box-shadow:none!important;background-color:transparent!important}.listItemMediaInfo{-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin-right:1em}.listGroupHeader{margin:2em 0 1em}.listGroupHeader-first{margin-top:0}.listItemIndicators{right:.5vh;top:.5vh;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.listItem,.listItemBody,.listItemMediaInfo{display:-webkit-box;display:-webkit-flex;display:flex;contain:layout style}@media all and (max-width:800px){.listItem .criticRating,.listItem .endsAt{display:none!important}}.listItemCheckboxContainer{width:auto!important} \ No newline at end of file +.listItemBody,.listItemButton,.listItemIcon,.listItemImage{display:inline-block;vertical-align:middle}.listItem,.listItemBody,.listItemButton{vertical-align:middle}.listItemBody,.listItemBodyText{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.listItem{background:0 0;border:0;outline:0!important;color:inherit;font-family:inherit;font-size:inherit;margin:0;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-align:left;padding:.25em 1.15em;cursor:pointer;overflow:hidden}.listItem-button{width:100%}.listItem-largeImage{padding:.5em!important}.listItemAside,.listItemIcon,.listItemImage{-webkit-flex-shrink:0;flex-shrink:0}.listItemButton{margin:0;-webkit-flex-shrink:0;flex-shrink:0;contain:layout style}.listViewDragHandle{margin-left:-.25em!important;touch-action:none}.listItemBody{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;padding:.8em 1em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.listItemBody-noleftpadding{padding-left:0}.listItem-shaded:nth-child(even){background:#1c1c1c;background:rgba(30,30,30,.9)}.three-line{min-height:6.3em;padding-top:0;padding-bottom:0}.listItemBodyText{margin:0;padding:.25em 0}.listItemBodyText-nowrap{white-space:nowrap}.listItemImage{width:7.4vh;height:7.4vh;min-width:40px;min-height:40px;background-repeat:no-repeat;-webkit-background-size:contain;background-size:contain;-webkit-flex-shrink:0;flex-shrink:0;background-position:center center;position:relative}.listItemImage-large{width:45vh;height:30vh;background-position:center center;margin-right:2%;margin-left:1%}.listItemIcon{width:1em!important;height:1em!important;font-size:143%;-webkit-border-radius:500px;border-radius:500px;padding:.5em;color:#fff}.listItemIcon:not(.listItemIcon-transparent){background-color:#52B54B}.listItemProgressBar{position:absolute;bottom:0;left:0;right:0}.listItem .secondary{color:#888}.listItem:focus .secondary{color:inherit!important}.listItem-focusscale{-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.listItem-focusscale:focus{-webkit-transform:scale(1.025,1.025);transform:scale(1.025,1.025)}.paperList{padding:.5em 0;margin:1em auto;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.paperList-clear{-webkit-box-shadow:none!important;box-shadow:none!important;background-color:transparent!important}.listItemMediaInfo{-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin-right:1em}.listGroupHeader{margin:2em 0 1em}.listGroupHeader-first{margin-top:0}.listItemIndicators{right:.5vh;top:.5vh;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.listItem,.listItemBody,.listItemMediaInfo{display:-webkit-box;display:-webkit-flex;display:flex;contain:layout style}@media all and (max-width:50em){.listItem .criticRating,.listItem .endsAt{display:none!important}}.listItemCheckboxContainer{width:auto!important} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js index bc07d4d745..c23e381e7f 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js @@ -1 +1 @@ -define(["itemHelper","dom","layoutManager","dialogHelper","datetime","loading","focusManager","connectionManager","globalize","require","shell","emby-checkbox","emby-input","emby-select","listViewStyle","emby-textarea","emby-button","paper-icon-button-light","css!./../formdialog"],function(itemHelper,dom,layoutManager,dialogHelper,datetime,loading,focusManager,connectionManager,globalize,require,shell){"use strict";function isDialog(){return currentContext.classList.contains("dialog")}function closeDialog(isSubmitted){isDialog()&&dialogHelper.close(currentContext)}function submitUpdatedItem(form,item){function afterContentTypeUpdated(){require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemSaved"))}),loading.hide(),closeDialog(!0)}var apiClient=getApiClient();apiClient.updateItem(item).then(function(){var newContentType=form.querySelector("#selectContentType").value||"";(metadataEditorInfo.ContentType||"")!==newContentType?apiClient.ajax({url:apiClient.getUrl("Items/"+item.Id+"/ContentType",{ContentType:newContentType}),type:"POST"}).then(function(){afterContentTypeUpdated()}):afterContentTypeUpdated()})}function getSelectedAirDays(form){var checkedItems=form.querySelectorAll(".chkAirDay:checked")||[];return Array.prototype.map.call(checkedItems,function(c){return c.getAttribute("data-day")})}function getAlbumArtists(form){return form.querySelector("#txtAlbumArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getArtists(form){return form.querySelector("#txtArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getDateFromForm(form,element,property){var val=form.querySelector(element).value;if(!val)return null;if(currentItem[property]){var date=datetime.parseISO8601Date(currentItem[property],!0),parts=date.toISOString().split("T");if(0===parts[0].indexOf(val)){var iso=parts[1];val+="T"+iso}}return val}function onSubmit(e){loading.show();var form=this;try{var item={Id:currentItem.Id,Name:form.querySelector("#txtName").value,OriginalTitle:form.querySelector("#txtOriginalName").value,ForcedSortName:form.querySelector("#txtSortName").value,DisplayMediaType:form.querySelector("#txtDisplayMediaType").value,CommunityRating:form.querySelector("#txtCommunityRating").value,VoteCount:form.querySelector("#txtCommunityVoteCount").value,HomePageUrl:form.querySelector("#txtHomePageUrl").value,CriticRating:form.querySelector("#txtCriticRating").value,CriticRatingSummary:form.querySelector("#txtCriticRatingSummary").value,IndexNumber:form.querySelector("#txtIndexNumber").value||null,AbsoluteEpisodeNumber:form.querySelector("#txtAbsoluteEpisodeNumber").value,DvdEpisodeNumber:form.querySelector("#txtDvdEpisodeNumber").value,DvdSeasonNumber:form.querySelector("#txtDvdSeasonNumber").value,AirsBeforeSeasonNumber:form.querySelector("#txtAirsBeforeSeason").value,AirsAfterSeasonNumber:form.querySelector("#txtAirsAfterSeason").value,AirsBeforeEpisodeNumber:form.querySelector("#txtAirsBeforeEpisode").value,ParentIndexNumber:form.querySelector("#txtParentIndexNumber").value||null,DisplayOrder:form.querySelector("#selectDisplayOrder").value,Players:form.querySelector("#txtPlayers").value,Album:form.querySelector("#txtAlbum").value,AlbumArtists:getAlbumArtists(form),ArtistItems:getArtists(form),AwardSummary:form.querySelector("#txtAwardSummary").value,Overview:form.querySelector("#txtOverview").value,Status:form.querySelector("#selectStatus").value,AirDays:getSelectedAirDays(form),AirTime:form.querySelector("#txtAirTime").value,Genres:editableListViewValues(form.querySelector("#listGenres")),Tags:editableListViewValues(form.querySelector("#listTags")),Keywords:editableListViewValues(form.querySelector("#listKeywords")),Studios:editableListViewValues(form.querySelector("#listStudios")).map(function(element){return{Name:element}}),PremiereDate:getDateFromForm(form,"#txtPremiereDate","PremiereDate"),DateCreated:getDateFromForm(form,"#txtDateAdded","DateCreated"),EndDate:getDateFromForm(form,"#txtEndDate","EndDate"),ProductionYear:form.querySelector("#txtProductionYear").value,AspectRatio:form.querySelector("#txtOriginalAspectRatio").value,Video3DFormat:form.querySelector("#select3dFormat").value,OfficialRating:form.querySelector("#selectOfficialRating").value,CustomRating:form.querySelector("#selectCustomRating").value,People:currentItem.People,LockData:form.querySelector("#chkLockData").checked,LockedFields:Array.prototype.filter.call(form.querySelectorAll(".selectLockedField"),function(c){return!c.checked}).map(function(c){return c.getAttribute("data-value")})};item.ProviderIds=Object.assign({},currentItem.ProviderIds);var idElements=form.querySelectorAll(".txtExternalId");if(Array.prototype.map.call(idElements,function(idElem){var providerKey=idElem.getAttribute("data-providerkey");item.ProviderIds[providerKey]=idElem.value}),item.PreferredMetadataLanguage=form.querySelector("#selectLanguage").value,item.PreferredMetadataCountryCode=form.querySelector("#selectCountry").value,"Person"===currentItem.Type){var placeOfBirth=form.querySelector("#txtPlaceOfBirth").value;item.ProductionLocations=placeOfBirth?[placeOfBirth]:[]}if("Series"===currentItem.Type){var seriesRuntime=form.querySelector("#txtSeriesRuntime").value;item.RunTimeTicks=seriesRuntime?6e8*seriesRuntime:null}var tagline=form.querySelector("#txtTagline").value;item.Taglines=tagline?[tagline]:[],submitUpdatedItem(form,item)}catch(err){alert(err)}return e.preventDefault(),e.stopPropagation(),!1}function editableListViewValues(list){return Array.prototype.map.call(list.querySelectorAll(".textValue"),function(el){return el.textContent})}function addElementToEditableListview(source,sortCallback){require(["prompt"],function(prompt){prompt({label:"Value:"}).then(function(text){var list=dom.parentWithClass(source,"editableListviewContainer").querySelector(".paperList"),items=editableListViewValues(list);items.push(text),populateListView(list,items,sortCallback)})})}function removeElementFromListview(source){var el=dom.parentWithClass(source,"listItem");el.parentNode.removeChild(el)}function editPerson(context,person,index){require(["personEditor"],function(personEditor){personEditor.show(person).then(function(updatedPerson){var isNew=index===-1;isNew&¤tItem.People.push(updatedPerson),populatePeople(context,currentItem.People)})})}function showMoreMenu(context,button,user){require(["itemContextMenu"],function(itemContextMenu){var item=currentItem;itemContextMenu.show({item:item,positionTo:button,edit:!1,editImages:!0,editSubtitles:!0,sync:!1,share:!1,play:!1,queue:!1,user:user}).then(function(result){result.deleted?afterDeleted(context,item):result.updated&&reload(context,item.Id,item.ServerId)})})}function afterDeleted(context,item){var parentId=item.ParentId||item.SeasonId||item.SeriesId;parentId?reload(context,parentId,item.ServerId):require(["embyRouter"],function(embyRouter){embyRouter.goHome()})}function onWebSocketMessageReceived(e,data){var msg=data;"LibraryChanged"===msg.MessageType&&msg.Data.ItemsUpdated.indexOf(currentItem.Id)!==-1&&(console.log("Item updated - reloading metadata"),reload(currentContext,currentItem.Id,currentItem.ServerId))}function bindItemChanged(context,apiClient){Events.on(apiClient,"websocketmessage",onWebSocketMessageReceived)}function unbindItemChanged(context,apiClient){Events.off(apiClient,"websocketmessage",onWebSocketMessageReceived)}function onEditorClick(e){var btnRemoveFromEditorList=dom.parentWithClass(e.target,"btnRemoveFromEditorList");if(btnRemoveFromEditorList)return void removeElementFromListview(btnRemoveFromEditorList);var btnAddTextItem=dom.parentWithClass(e.target,"btnAddTextItem");btnAddTextItem&&addElementToEditableListview(btnAddTextItem)}function getApiClient(){return connectionManager.getApiClient(currentItem.ServerId)}function init(context,apiClient){context.querySelector(".externalIds").addEventListener("click",function(e){var btnOpenExternalId=dom.parentWithClass(e.target,"btnOpenExternalId");if(btnOpenExternalId){var field=context.querySelector("#"+btnOpenExternalId.getAttribute("data-fieldid")),formatString=field.getAttribute("data-formatstring");field.value&&shell.openUrl(formatString.replace("{0}",field.value))}}),context.querySelector(".btnCancel").addEventListener("click",function(){closeDialog(!1)}),context.querySelector(".btnMore").addEventListener("click",function(e){getApiClient().getCurrentUser().then(function(user){showMoreMenu(context,e.target,user)})}),context.querySelector(".btnHeaderSave").addEventListener("click",function(e){context.querySelector(".btnSave").click()}),context.querySelector("#chkLockData").addEventListener("click",function(e){e.target.checked?hideElement(".providerSettingsContainer"):showElement(".providerSettingsContainer")}),context.removeEventListener("click",onEditorClick),context.addEventListener("click",onEditorClick);var form=context.querySelector("form");form.removeEventListener("submit",onSubmit),form.addEventListener("submit",onSubmit),context.querySelector("#btnAddPerson").addEventListener("click",function(event,data){editPerson(context,{},-1)}),context.querySelector("#peopleList").addEventListener("click",function(e){var index,btnDeletePerson=dom.parentWithClass(e.target,"btnDeletePerson");btnDeletePerson&&(index=parseInt(btnDeletePerson.getAttribute("data-index")),currentItem.People.splice(index,1),populatePeople(context,currentItem.People));var btnEditPerson=dom.parentWithClass(e.target,"btnEditPerson");btnEditPerson&&(index=parseInt(btnEditPerson.getAttribute("data-index")),editPerson(context,currentItem.People[index],index))}),isDialog()&&bindItemChanged(context,apiClient)}function getItem(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId):apiClient.getRootFolder(apiClient.getCurrentUserId())}function getEditorConfig(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getJSON(apiClient.getUrl("Items/"+itemId+"/MetadataEditor")):Promise.resolve({})}function populateCountries(select,allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function renderContentTypeOptions(context,metadataInfo){metadataInfo.ContentTypeOptions.length?showElement("#fldContentType",context):hideElement("#fldContentType",context);var html=metadataInfo.ContentTypeOptions.map(function(i){return'"}).join(""),selectEl=context.querySelector("#selectContentType");selectEl.innerHTML=html,selectEl.value=metadataInfo.ContentType||""}function loadExternalIds(context,item,externalIds){for(var html="",providerIds=item.ProviderIds||{},i=0,length=externalIds.length;i',html+='
';var value=providerIds[idInfo.Key]||"";html+='
',html+='',html+="
",formatString&&(html+=''),html+="
",html+="
"}var elem=context.querySelector(".externalIds",context);elem.innerHTML=html}function hideElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.add("hide")})}else selector.classList.add("hide")}function showElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.remove("hide")})}else selector.classList.remove("hide")}function setFieldVisibilities(context,item){item.Path&&"Remote"!==item.LocationType?showElement("#fldPath",context):hideElement("#fldPath",context),"Series"===item.Type||"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldOriginalName",context):hideElement("#fldOriginalName",context),"Series"===item.Type?showElement("#fldSeriesRuntime",context):hideElement("#fldSeriesRuntime",context),"Series"===item.Type||"Person"===item.Type?showElement("#fldEndDate",context):hideElement("#fldEndDate",context),"MusicAlbum"===item.Type?showElement("#albumAssociationMessage",context):hideElement("#albumAssociationMessage",context),"Game"===item.MediaType?showElement("#fldPlayers",context):hideElement("#fldPlayers",context),"Movie"===item.Type||"Trailer"===item.Type?(showElement("#fldCriticRating",context),showElement("#fldCriticRatingSummary",context)):(hideElement("#fldCriticRating",context),hideElement("#fldCriticRatingSummary",context)),"Movie"===item.Type?showElement("#fldAwardSummary",context):hideElement("#fldAwardSummary",context),"Series"===item.Type?(showElement("#fldStatus",context),showElement("#fldAirDays",context),showElement("#fldAirTime",context)):(hideElement("#fldStatus",context),hideElement("#fldAirDays",context),hideElement("#fldAirTime",context)),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fld3dFormat",context):hideElement("#fld3dFormat",context),"Audio"===item.Type?showElement("#fldAlbumArtist",context):hideElement("#fldAlbumArtist",context),"Audio"===item.Type||"MusicVideo"===item.Type?(showElement("#fldArtist",context),showElement("#fldAlbum",context)):(hideElement("#fldArtist",context),hideElement("#fldAlbum",context)),"Episode"===item.Type?showElement("#collapsibleDvdEpisodeInfo",context):hideElement("#collapsibleDvdEpisodeInfo",context),"Episode"===item.Type&&0===item.ParentIndexNumber?showElement("#collapsibleSpecialEpisodeInfo",context):hideElement("#collapsibleSpecialEpisodeInfo",context),"Person"===item.Type||"Genre"===item.Type||"Studio"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"TvChannel"===item.Type?(hideElement("#fldCommunityRating",context),hideElement("#fldCommunityVoteCount",context),hideElement("#genresCollapsible",context),hideElement("#peopleCollapsible",context),hideElement("#studiosCollapsible",context),"TvChannel"===item.Type?showElement("#fldOfficialRating",context):hideElement("#fldOfficialRating",context),hideElement("#fldCustomRating",context)):(showElement("#fldCommunityRating",context),showElement("#fldCommunityVoteCount",context),showElement("#genresCollapsible",context),showElement("#peopleCollapsible",context),showElement("#studiosCollapsible",context),showElement("#fldOfficialRating",context),showElement("#fldCustomRating",context)),showElement("#tagsCollapsible",context),"TvChannel"===item.Type?(hideElement("#metadataSettingsCollapsible",context),hideElement("#fldPremiereDate",context),hideElement("#fldDateAdded",context),hideElement("#fldYear",context)):(showElement("#metadataSettingsCollapsible",context),showElement("#fldPremiereDate",context),showElement("#fldDateAdded",context),showElement("#fldYear",context)),"Movie"===item.Type||"Trailer"===item.Type||"BoxSet"===item.Type?showElement("#keywordsCollapsible",context):hideElement("#keywordsCollapsible",context),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fldSourceType",context):hideElement("#fldSourceType",context),"Person"===item.Type?(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelBirthYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelBirthDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelDeathDate")),showElement("#fldPlaceOfBirth")):(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelReleaseDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelEndDate")),hideElement("#fldPlaceOfBirth")),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fldOriginalAspectRatio"):hideElement("#fldOriginalAspectRatio"),"Audio"===item.Type||"Episode"===item.Type||"Season"===item.Type?(showElement("#fldIndexNumber"),"Episode"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelEpisodeNumber")):"Season"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelTrackNumber")):context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelNumber"))):hideElement("#fldIndexNumber"),"Audio"===item.Type||"Episode"===item.Type?(showElement("#fldParentIndexNumber"),"Episode"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelDiscNumber")):context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelParentNumber"))):hideElement("#fldParentIndexNumber",context),"BoxSet"===item.Type?(showElement("#fldDisplayOrder",context),context.querySelector("#selectDisplayOrder").innerHTML='"):(context.querySelector("#selectDisplayOrder").innerHTML="",hideElement("#fldDisplayOrder",context));var displaySettingFields=context.querySelectorAll(".fldDisplaySetting"),hiddenDisplaySettingFields=Array.prototype.filter.call(displaySettingFields,function(field){return"none"!==field.style.display});hiddenDisplaySettingFields.length?showElement("#collapsibleDisplaySettings",context):hideElement("#collapsibleDisplaySettings",context)}function fillItemInfo(context,item,parentalRatingOptions){var select=context.querySelector("#selectOfficialRating");populateRatings(parentalRatingOptions,select,item.OfficialRating),select.value=item.OfficialRating||"",select=context.querySelector("#selectCustomRating"),populateRatings(parentalRatingOptions,select,item.CustomRating),select.value=item.CustomRating||"";var selectStatus=context.querySelector("#selectStatus");populateStatus(selectStatus),selectStatus.value=item.Status||"",context.querySelector("#select3dFormat",context).value=item.Video3DFormat||"",Array.prototype.forEach.call(context.querySelectorAll(".chkAirDay",context),function(el){el.checked=(item.AirDays||[]).indexOf(el.getAttribute("data-day"))!==-1}),populateListView(context.querySelector("#listGenres"),item.Genres),populatePeople(context,item.People||[]),populateListView(context.querySelector("#listStudios"),(item.Studios||[]).map(function(element){return element.Name||""})),populateListView(context.querySelector("#listTags"),item.Tags),populateListView(context.querySelector("#listKeywords"),item.Keywords);var lockData=item.LockData||!1,chkLockData=context.querySelector("#chkLockData");chkLockData.checked=lockData,chkLockData.checked?hideElement(".providerSettingsContainer",context):showElement(".providerSettingsContainer",context),populateInternetProviderSettings(context,item,item.LockedFields),context.querySelector("#txtPath").value=item.Path||"",context.querySelector("#txtName").value=item.Name||"",context.querySelector("#txtOriginalName").value=item.OriginalTitle||"",context.querySelector("#txtOverview").value=item.Overview||"",context.querySelector("#txtTagline").value=item.Taglines&&item.Taglines.length?item.Taglines[0]:"",context.querySelector("#txtSortName").value=item.ForcedSortName||"",context.querySelector("#txtDisplayMediaType").value=item.DisplayMediaType||"",context.querySelector("#txtCommunityRating").value=item.CommunityRating||"",context.querySelector("#txtCommunityVoteCount").value=item.VoteCount||"",context.querySelector("#txtHomePageUrl").value=item.HomePageUrl||"",context.querySelector("#txtAwardSummary").value=item.AwardSummary||"",context.querySelector("#txtCriticRating").value=item.CriticRating||"",context.querySelector("#txtCriticRatingSummary").value=item.CriticRatingSummary||"",context.querySelector("#txtIndexNumber").value="IndexNumber"in item?item.IndexNumber:"",context.querySelector("#txtParentIndexNumber").value="ParentIndexNumber"in item?item.ParentIndexNumber:"",context.querySelector("#txtPlayers").value=item.Players||"",context.querySelector("#txtAbsoluteEpisodeNumber").value="AbsoluteEpisodeNumber"in item?item.AbsoluteEpisodeNumber:"",context.querySelector("#txtDvdEpisodeNumber").value="DvdEpisodeNumber"in item?item.DvdEpisodeNumber:"",context.querySelector("#txtDvdSeasonNumber").value="DvdSeasonNumber"in item?item.DvdSeasonNumber:"",context.querySelector("#txtAirsBeforeSeason").value="AirsBeforeSeasonNumber"in item?item.AirsBeforeSeasonNumber:"",context.querySelector("#txtAirsAfterSeason").value="AirsAfterSeasonNumber"in item?item.AirsAfterSeasonNumber:"",context.querySelector("#txtAirsBeforeEpisode").value="AirsBeforeEpisodeNumber"in item?item.AirsBeforeEpisodeNumber:"",context.querySelector("#txtAlbum").value=item.Album||"",context.querySelector("#txtAlbumArtist").value=(item.AlbumArtists||[]).map(function(a){return a.Name}).join(";"),context.querySelector("#selectDisplayOrder").value=item.DisplayOrder,context.querySelector("#txtArtist").value=(item.ArtistItems||[]).map(function(a){return a.Name}).join(";");var date;if(item.DateCreated)try{date=datetime.parseISO8601Date(item.DateCreated,!0),context.querySelector("#txtDateAdded").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtDateAdded").value=""}else context.querySelector("#txtDateAdded").value="";if(item.PremiereDate)try{date=datetime.parseISO8601Date(item.PremiereDate,!0),context.querySelector("#txtPremiereDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtPremiereDate").value=""}else context.querySelector("#txtPremiereDate").value="";if(item.EndDate)try{date=datetime.parseISO8601Date(item.EndDate,!0),context.querySelector("#txtEndDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtEndDate").value=""}else context.querySelector("#txtEndDate").value="";context.querySelector("#txtProductionYear").value=item.ProductionYear||"",context.querySelector("#txtAirTime").value=item.AirTime||"";var placeofBirth=item.ProductionLocations&&item.ProductionLocations.length?item.ProductionLocations[0]:"";if(context.querySelector("#txtPlaceOfBirth").value=placeofBirth,context.querySelector("#txtOriginalAspectRatio").value=item.AspectRatio||"",context.querySelector("#selectLanguage").value=item.PreferredMetadataLanguage||"",context.querySelector("#selectCountry").value=item.PreferredMetadataCountryCode||"",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;context.querySelector("#txtSeriesRuntime").value=Math.round(minutes)}else context.querySelector("#txtSeriesRuntime",context).value=""}function populateRatings(allParentalRatings,select,currentValue){var html="";html+="";var i,length,rating,ratings=[],currentValueFound=!1;for(i=0,length=allParentalRatings.length;i"+rating.Name+"";select.innerHTML=html}function populateStatus(select){var html="";html+="",html+="",html+="",select.innerHTML=html}function populateListView(list,items,sortCallback){items=items||[],"undefined"==typeof sortCallback?items.sort(function(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}):items=sortCallback(items);for(var html="",i=0;i',html+='live_tv',html+='
',html+='
',html+=items[i],html+="
",html+="
",html+='',html+="
";list.innerHTML=html}function populatePeople(context,people){for(var lastType="",html="",elem=context.querySelector("#peopleList"),i=0,length=people.length;i',html+='person',html+='",html+='',html+="
"}elem.innerHTML=html}function generateSliders(fields,currentFields){for(var html="",i=0;i",html+=""+name+"",html+=""}return html}function populateInternetProviderSettings(context,item,lockedFields){var container=context.querySelector(".providerSettingsContainer");lockedFields=lockedFields||[];var metadatafields=[{name:globalize.translate("sharedcomponents#Name"),value:"Name"},{name:globalize.translate("sharedcomponents#Overview"),value:"Overview"},{name:globalize.translate("sharedcomponents#Genres"),value:"Genres"},{name:globalize.translate("sharedcomponents#ParentalRating"),value:"OfficialRating"},{name:globalize.translate("sharedcomponents#People"),value:"Cast"}];"Person"===item.Type?metadatafields.push({name:globalize.translate("sharedcomponents#BirthLocation"),value:"ProductionLocations"}):metadatafields.push({name:globalize.translate("sharedcomponents#ProductionLocations"),value:"ProductionLocations"}),"Series"===item.Type&&metadatafields.push({name:globalize.translate("Runtime"),value:"Runtime"}),metadatafields.push({name:globalize.translate("sharedcomponents#Studios"),value:"Studios"}),metadatafields.push({name:globalize.translate("sharedcomponents#Tags"),value:"Tags"}),metadatafields.push({name:globalize.translate("sharedcomponents#Keywords"),value:"Keywords"}),metadatafields.push({name:globalize.translate("sharedcomponents#Images"),value:"Images"}),metadatafields.push({name:globalize.translate("sharedcomponents#Backdrops"),value:"Backdrops"}),"Game"===item.Type&&metadatafields.push({name:globalize.translate("sharedcomponents#Screenshots"),value:"Screenshots"});var html="";html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFields")+"

",html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFieldsHelp")+"

",html+=generateSliders(metadatafields,lockedFields),container.innerHTML=html}function reload(context,itemId,serverId){loading.show(),Promise.all([getItem(itemId,serverId),getEditorConfig(itemId,serverId)]).then(function(responses){var item=responses[0];metadataEditorInfo=responses[1],currentItem=item;var languages=metadataEditorInfo.Cultures,countries=metadataEditorInfo.Countries;renderContentTypeOptions(context,metadataEditorInfo),loadExternalIds(context,item,metadataEditorInfo.ExternalIdInfos),populateLanguages(context.querySelector("#selectLanguage"),languages),populateCountries(context.querySelector("#selectCountry"),countries),setFieldVisibilities(context,item),fillItemInfo(context,item,metadataEditorInfo.ParentalRatingOptions),"Video"===item.MediaType&&"Episode"!==item.Type?showElement("#fldTagline",context):hideElement("#fldTagline",context),loading.hide()})}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function show(itemId,serverId,resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="medium-tall";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg),dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),unbindItemChanged(dlg,connectionManager.getApiClient(serverId)),resolve()}),currentContext=dlg,init(dlg,connectionManager.getApiClient(serverId)),reload(dlg,itemId,serverId)})}var currentContext,metadataEditorInfo,currentItem;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){return show(itemId,serverId,resolve,reject)})},embed:function(elem,itemId,serverId){return new Promise(function(resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){elem.innerHTML=globalize.translateDocument(template,"sharedcomponents"),elem.querySelector(".formDialogFooter").classList.remove("formDialogFooter"),elem.querySelector(".btnHeaderSave").classList.remove("hide"),elem.querySelector(".btnCancel").classList.add("hide"),currentContext=elem,init(elem,connectionManager.getApiClient(serverId)),reload(elem,itemId,serverId),focusManager.autoFocus(elem)})})}}}); \ No newline at end of file +define(["itemHelper","dom","layoutManager","dialogHelper","datetime","loading","focusManager","connectionManager","globalize","require","shell","emby-checkbox","emby-input","emby-select","listViewStyle","emby-textarea","emby-button","paper-icon-button-light","css!./../formdialog"],function(itemHelper,dom,layoutManager,dialogHelper,datetime,loading,focusManager,connectionManager,globalize,require,shell){"use strict";function isDialog(){return currentContext.classList.contains("dialog")}function closeDialog(isSubmitted){isDialog()&&dialogHelper.close(currentContext)}function submitUpdatedItem(form,item){function afterContentTypeUpdated(){require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#MessageItemSaved"))}),loading.hide(),closeDialog(!0)}var apiClient=getApiClient();apiClient.updateItem(item).then(function(){var newContentType=form.querySelector("#selectContentType").value||"";(metadataEditorInfo.ContentType||"")!==newContentType?apiClient.ajax({url:apiClient.getUrl("Items/"+item.Id+"/ContentType",{ContentType:newContentType}),type:"POST"}).then(function(){afterContentTypeUpdated()}):afterContentTypeUpdated()})}function getSelectedAirDays(form){var checkedItems=form.querySelectorAll(".chkAirDay:checked")||[];return Array.prototype.map.call(checkedItems,function(c){return c.getAttribute("data-day")})}function getAlbumArtists(form){return form.querySelector("#txtAlbumArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getArtists(form){return form.querySelector("#txtArtist").value.trim().split(";").filter(function(s){return s.length>0}).map(function(a){return{Name:a}})}function getDateFromForm(form,element,property){var val=form.querySelector(element).value;if(!val)return null;if(currentItem[property]){var date=datetime.parseISO8601Date(currentItem[property],!0),parts=date.toISOString().split("T");if(0===parts[0].indexOf(val)){var iso=parts[1];val+="T"+iso}}return val}function onSubmit(e){loading.show();var form=this;try{var item={Id:currentItem.Id,Name:form.querySelector("#txtName").value,OriginalTitle:form.querySelector("#txtOriginalName").value,ForcedSortName:form.querySelector("#txtSortName").value,DisplayMediaType:form.querySelector("#txtDisplayMediaType").value,CommunityRating:form.querySelector("#txtCommunityRating").value,VoteCount:form.querySelector("#txtCommunityVoteCount").value,HomePageUrl:form.querySelector("#txtHomePageUrl").value,CriticRating:form.querySelector("#txtCriticRating").value,IndexNumber:form.querySelector("#txtIndexNumber").value||null,AbsoluteEpisodeNumber:form.querySelector("#txtAbsoluteEpisodeNumber").value,DvdEpisodeNumber:form.querySelector("#txtDvdEpisodeNumber").value,DvdSeasonNumber:form.querySelector("#txtDvdSeasonNumber").value,AirsBeforeSeasonNumber:form.querySelector("#txtAirsBeforeSeason").value,AirsAfterSeasonNumber:form.querySelector("#txtAirsAfterSeason").value,AirsBeforeEpisodeNumber:form.querySelector("#txtAirsBeforeEpisode").value,ParentIndexNumber:form.querySelector("#txtParentIndexNumber").value||null,DisplayOrder:form.querySelector("#selectDisplayOrder").value,Players:form.querySelector("#txtPlayers").value,Album:form.querySelector("#txtAlbum").value,AlbumArtists:getAlbumArtists(form),ArtistItems:getArtists(form),AwardSummary:form.querySelector("#txtAwardSummary").value,Overview:form.querySelector("#txtOverview").value,Status:form.querySelector("#selectStatus").value,AirDays:getSelectedAirDays(form),AirTime:form.querySelector("#txtAirTime").value,Genres:editableListViewValues(form.querySelector("#listGenres")),Tags:editableListViewValues(form.querySelector("#listTags")),Keywords:editableListViewValues(form.querySelector("#listKeywords")),Studios:editableListViewValues(form.querySelector("#listStudios")).map(function(element){return{Name:element}}),PremiereDate:getDateFromForm(form,"#txtPremiereDate","PremiereDate"),DateCreated:getDateFromForm(form,"#txtDateAdded","DateCreated"),EndDate:getDateFromForm(form,"#txtEndDate","EndDate"),ProductionYear:form.querySelector("#txtProductionYear").value,AspectRatio:form.querySelector("#txtOriginalAspectRatio").value,Video3DFormat:form.querySelector("#select3dFormat").value,OfficialRating:form.querySelector("#selectOfficialRating").value,CustomRating:form.querySelector("#selectCustomRating").value,People:currentItem.People,LockData:form.querySelector("#chkLockData").checked,LockedFields:Array.prototype.filter.call(form.querySelectorAll(".selectLockedField"),function(c){return!c.checked}).map(function(c){return c.getAttribute("data-value")})};item.ProviderIds=Object.assign({},currentItem.ProviderIds);var idElements=form.querySelectorAll(".txtExternalId");if(Array.prototype.map.call(idElements,function(idElem){var providerKey=idElem.getAttribute("data-providerkey");item.ProviderIds[providerKey]=idElem.value}),item.PreferredMetadataLanguage=form.querySelector("#selectLanguage").value,item.PreferredMetadataCountryCode=form.querySelector("#selectCountry").value,"Person"===currentItem.Type){var placeOfBirth=form.querySelector("#txtPlaceOfBirth").value;item.ProductionLocations=placeOfBirth?[placeOfBirth]:[]}if("Series"===currentItem.Type){var seriesRuntime=form.querySelector("#txtSeriesRuntime").value;item.RunTimeTicks=seriesRuntime?6e8*seriesRuntime:null}var tagline=form.querySelector("#txtTagline").value;item.Taglines=tagline?[tagline]:[],submitUpdatedItem(form,item)}catch(err){alert(err)}return e.preventDefault(),e.stopPropagation(),!1}function editableListViewValues(list){return Array.prototype.map.call(list.querySelectorAll(".textValue"),function(el){return el.textContent})}function addElementToEditableListview(source,sortCallback){require(["prompt"],function(prompt){prompt({label:"Value:"}).then(function(text){var list=dom.parentWithClass(source,"editableListviewContainer").querySelector(".paperList"),items=editableListViewValues(list);items.push(text),populateListView(list,items,sortCallback)})})}function removeElementFromListview(source){var el=dom.parentWithClass(source,"listItem");el.parentNode.removeChild(el)}function editPerson(context,person,index){require(["personEditor"],function(personEditor){personEditor.show(person).then(function(updatedPerson){var isNew=index===-1;isNew&¤tItem.People.push(updatedPerson),populatePeople(context,currentItem.People)})})}function showMoreMenu(context,button,user){require(["itemContextMenu"],function(itemContextMenu){var item=currentItem;itemContextMenu.show({item:item,positionTo:button,edit:!1,editImages:!0,editSubtitles:!0,sync:!1,share:!1,play:!1,queue:!1,user:user}).then(function(result){result.deleted?afterDeleted(context,item):result.updated&&reload(context,item.Id,item.ServerId)})})}function afterDeleted(context,item){var parentId=item.ParentId||item.SeasonId||item.SeriesId;parentId?reload(context,parentId,item.ServerId):require(["embyRouter"],function(embyRouter){embyRouter.goHome()})}function onWebSocketMessageReceived(e,data){var msg=data;"LibraryChanged"===msg.MessageType&&msg.Data.ItemsUpdated.indexOf(currentItem.Id)!==-1&&(console.log("Item updated - reloading metadata"),reload(currentContext,currentItem.Id,currentItem.ServerId))}function bindItemChanged(context,apiClient){Events.on(apiClient,"websocketmessage",onWebSocketMessageReceived)}function unbindItemChanged(context,apiClient){Events.off(apiClient,"websocketmessage",onWebSocketMessageReceived)}function onEditorClick(e){var btnRemoveFromEditorList=dom.parentWithClass(e.target,"btnRemoveFromEditorList");if(btnRemoveFromEditorList)return void removeElementFromListview(btnRemoveFromEditorList);var btnAddTextItem=dom.parentWithClass(e.target,"btnAddTextItem");btnAddTextItem&&addElementToEditableListview(btnAddTextItem)}function getApiClient(){return connectionManager.getApiClient(currentItem.ServerId)}function init(context,apiClient){context.querySelector(".externalIds").addEventListener("click",function(e){var btnOpenExternalId=dom.parentWithClass(e.target,"btnOpenExternalId");if(btnOpenExternalId){var field=context.querySelector("#"+btnOpenExternalId.getAttribute("data-fieldid")),formatString=field.getAttribute("data-formatstring");field.value&&shell.openUrl(formatString.replace("{0}",field.value))}}),context.querySelector(".btnCancel").addEventListener("click",function(){closeDialog(!1)}),context.querySelector(".btnMore").addEventListener("click",function(e){getApiClient().getCurrentUser().then(function(user){showMoreMenu(context,e.target,user)})}),context.querySelector(".btnHeaderSave").addEventListener("click",function(e){context.querySelector(".btnSave").click()}),context.querySelector("#chkLockData").addEventListener("click",function(e){e.target.checked?hideElement(".providerSettingsContainer"):showElement(".providerSettingsContainer")}),context.removeEventListener("click",onEditorClick),context.addEventListener("click",onEditorClick);var form=context.querySelector("form");form.removeEventListener("submit",onSubmit),form.addEventListener("submit",onSubmit),context.querySelector("#btnAddPerson").addEventListener("click",function(event,data){editPerson(context,{},-1)}),context.querySelector("#peopleList").addEventListener("click",function(e){var index,btnDeletePerson=dom.parentWithClass(e.target,"btnDeletePerson");btnDeletePerson&&(index=parseInt(btnDeletePerson.getAttribute("data-index")),currentItem.People.splice(index,1),populatePeople(context,currentItem.People));var btnEditPerson=dom.parentWithClass(e.target,"btnEditPerson");btnEditPerson&&(index=parseInt(btnEditPerson.getAttribute("data-index")),editPerson(context,currentItem.People[index],index))}),isDialog()&&bindItemChanged(context,apiClient)}function getItem(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getItem(apiClient.getCurrentUserId(),itemId):apiClient.getRootFolder(apiClient.getCurrentUserId())}function getEditorConfig(itemId,serverId){var apiClient=connectionManager.getApiClient(serverId);return itemId?apiClient.getJSON(apiClient.getUrl("Items/"+itemId+"/MetadataEditor")):Promise.resolve({})}function populateCountries(select,allCountries){var html="";html+="";for(var i=0,length=allCountries.length;i"+culture.DisplayName+""}select.innerHTML=html}function populateLanguages(select,languages){var html="";html+="";for(var i=0,length=languages.length;i"+culture.DisplayName+""}select.innerHTML=html}function renderContentTypeOptions(context,metadataInfo){metadataInfo.ContentTypeOptions.length?showElement("#fldContentType",context):hideElement("#fldContentType",context);var html=metadataInfo.ContentTypeOptions.map(function(i){return'"}).join(""),selectEl=context.querySelector("#selectContentType");selectEl.innerHTML=html,selectEl.value=metadataInfo.ContentType||""}function loadExternalIds(context,item,externalIds){for(var html="",providerIds=item.ProviderIds||{},i=0,length=externalIds.length;i',html+='
';var value=providerIds[idInfo.Key]||"";html+='
',html+='',html+="
",formatString&&(html+=''),html+="
",html+="
"}var elem=context.querySelector(".externalIds",context);elem.innerHTML=html}function hideElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.add("hide")})}else selector.classList.add("hide")}function showElement(selector,context,multiple){if(context=context||document,"string"==typeof selector){var elements=multiple?context.querySelectorAll(selector):[context.querySelector(selector)];Array.prototype.forEach.call(elements,function(el){el&&el.classList.remove("hide")})}else selector.classList.remove("hide")}function setFieldVisibilities(context,item){item.Path&&"Remote"!==item.LocationType?showElement("#fldPath",context):hideElement("#fldPath",context),"Series"===item.Type||"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldOriginalName",context):hideElement("#fldOriginalName",context),"Series"===item.Type?showElement("#fldSeriesRuntime",context):hideElement("#fldSeriesRuntime",context),"Series"===item.Type||"Person"===item.Type?showElement("#fldEndDate",context):hideElement("#fldEndDate",context),"MusicAlbum"===item.Type?showElement("#albumAssociationMessage",context):hideElement("#albumAssociationMessage",context),"Game"===item.MediaType?showElement("#fldPlayers",context):hideElement("#fldPlayers",context),"Movie"===item.Type||"Trailer"===item.Type?showElement("#fldCriticRating",context):hideElement("#fldCriticRating",context),"Movie"===item.Type?showElement("#fldAwardSummary",context):hideElement("#fldAwardSummary",context),"Series"===item.Type?(showElement("#fldStatus",context),showElement("#fldAirDays",context),showElement("#fldAirTime",context)):(hideElement("#fldStatus",context),hideElement("#fldAirDays",context),hideElement("#fldAirTime",context)),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fld3dFormat",context):hideElement("#fld3dFormat",context),"Audio"===item.Type?showElement("#fldAlbumArtist",context):hideElement("#fldAlbumArtist",context),"Audio"===item.Type||"MusicVideo"===item.Type?(showElement("#fldArtist",context),showElement("#fldAlbum",context)):(hideElement("#fldArtist",context),hideElement("#fldAlbum",context)),"Episode"===item.Type?showElement("#collapsibleDvdEpisodeInfo",context):hideElement("#collapsibleDvdEpisodeInfo",context),"Episode"===item.Type&&0===item.ParentIndexNumber?showElement("#collapsibleSpecialEpisodeInfo",context):hideElement("#collapsibleSpecialEpisodeInfo",context),"Person"===item.Type||"Genre"===item.Type||"Studio"===item.Type||"GameGenre"===item.Type||"MusicGenre"===item.Type||"TvChannel"===item.Type?(hideElement("#fldCommunityRating",context),hideElement("#fldCommunityVoteCount",context),hideElement("#genresCollapsible",context),hideElement("#peopleCollapsible",context),hideElement("#studiosCollapsible",context),"TvChannel"===item.Type?showElement("#fldOfficialRating",context):hideElement("#fldOfficialRating",context),hideElement("#fldCustomRating",context)):(showElement("#fldCommunityRating",context),showElement("#fldCommunityVoteCount",context),showElement("#genresCollapsible",context),showElement("#peopleCollapsible",context),showElement("#studiosCollapsible",context),showElement("#fldOfficialRating",context),showElement("#fldCustomRating",context)),showElement("#tagsCollapsible",context),"TvChannel"===item.Type?(hideElement("#metadataSettingsCollapsible",context),hideElement("#fldPremiereDate",context),hideElement("#fldDateAdded",context),hideElement("#fldYear",context)):(showElement("#metadataSettingsCollapsible",context),showElement("#fldPremiereDate",context),showElement("#fldDateAdded",context),showElement("#fldYear",context)),"Movie"===item.Type||"Trailer"===item.Type||"BoxSet"===item.Type?showElement("#keywordsCollapsible",context):hideElement("#keywordsCollapsible",context),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fldSourceType",context):hideElement("#fldSourceType",context),"Person"===item.Type?(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelBirthYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelBirthDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelDeathDate")),showElement("#fldPlaceOfBirth")):(context.querySelector("#txtProductionYear").label(globalize.translate("sharedcomponents#LabelYear")),context.querySelector("#txtPremiereDate").label(globalize.translate("sharedcomponents#LabelReleaseDate")),context.querySelector("#txtEndDate").label(globalize.translate("sharedcomponents#LabelEndDate")),hideElement("#fldPlaceOfBirth")),"Video"===item.MediaType&&"TvChannel"!==item.Type?showElement("#fldOriginalAspectRatio"):hideElement("#fldOriginalAspectRatio"),"Audio"===item.Type||"Episode"===item.Type||"Season"===item.Type?(showElement("#fldIndexNumber"),"Episode"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelEpisodeNumber")):"Season"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelTrackNumber")):context.querySelector("#txtIndexNumber").label(globalize.translate("sharedcomponents#LabelNumber"))):hideElement("#fldIndexNumber"),"Audio"===item.Type||"Episode"===item.Type?(showElement("#fldParentIndexNumber"),"Episode"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelSeasonNumber")):"Audio"===item.Type?context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelDiscNumber")):context.querySelector("#txtParentIndexNumber").label(globalize.translate("sharedcomponents#LabelParentNumber"))):hideElement("#fldParentIndexNumber",context),"BoxSet"===item.Type?(showElement("#fldDisplayOrder",context),context.querySelector("#selectDisplayOrder").innerHTML='"):(context.querySelector("#selectDisplayOrder").innerHTML="",hideElement("#fldDisplayOrder",context));var displaySettingFields=context.querySelectorAll(".fldDisplaySetting"),hiddenDisplaySettingFields=Array.prototype.filter.call(displaySettingFields,function(field){return"none"!==field.style.display});hiddenDisplaySettingFields.length?showElement("#collapsibleDisplaySettings",context):hideElement("#collapsibleDisplaySettings",context)}function fillItemInfo(context,item,parentalRatingOptions){var select=context.querySelector("#selectOfficialRating");populateRatings(parentalRatingOptions,select,item.OfficialRating),select.value=item.OfficialRating||"",select=context.querySelector("#selectCustomRating"),populateRatings(parentalRatingOptions,select,item.CustomRating),select.value=item.CustomRating||"";var selectStatus=context.querySelector("#selectStatus");populateStatus(selectStatus),selectStatus.value=item.Status||"",context.querySelector("#select3dFormat",context).value=item.Video3DFormat||"",Array.prototype.forEach.call(context.querySelectorAll(".chkAirDay",context),function(el){el.checked=(item.AirDays||[]).indexOf(el.getAttribute("data-day"))!==-1}),populateListView(context.querySelector("#listGenres"),item.Genres),populatePeople(context,item.People||[]),populateListView(context.querySelector("#listStudios"),(item.Studios||[]).map(function(element){return element.Name||""})),populateListView(context.querySelector("#listTags"),item.Tags),populateListView(context.querySelector("#listKeywords"),item.Keywords);var lockData=item.LockData||!1,chkLockData=context.querySelector("#chkLockData");chkLockData.checked=lockData,chkLockData.checked?hideElement(".providerSettingsContainer",context):showElement(".providerSettingsContainer",context),populateInternetProviderSettings(context,item,item.LockedFields),context.querySelector("#txtPath").value=item.Path||"",context.querySelector("#txtName").value=item.Name||"",context.querySelector("#txtOriginalName").value=item.OriginalTitle||"",context.querySelector("#txtOverview").value=item.Overview||"",context.querySelector("#txtTagline").value=item.Taglines&&item.Taglines.length?item.Taglines[0]:"",context.querySelector("#txtSortName").value=item.ForcedSortName||"",context.querySelector("#txtDisplayMediaType").value=item.DisplayMediaType||"",context.querySelector("#txtCommunityRating").value=item.CommunityRating||"",context.querySelector("#txtCommunityVoteCount").value=item.VoteCount||"",context.querySelector("#txtHomePageUrl").value=item.HomePageUrl||"",context.querySelector("#txtAwardSummary").value=item.AwardSummary||"",context.querySelector("#txtCriticRating").value=item.CriticRating||"",context.querySelector("#txtIndexNumber").value="IndexNumber"in item?item.IndexNumber:"",context.querySelector("#txtParentIndexNumber").value="ParentIndexNumber"in item?item.ParentIndexNumber:"",context.querySelector("#txtPlayers").value=item.Players||"",context.querySelector("#txtAbsoluteEpisodeNumber").value="AbsoluteEpisodeNumber"in item?item.AbsoluteEpisodeNumber:"",context.querySelector("#txtDvdEpisodeNumber").value="DvdEpisodeNumber"in item?item.DvdEpisodeNumber:"",context.querySelector("#txtDvdSeasonNumber").value="DvdSeasonNumber"in item?item.DvdSeasonNumber:"",context.querySelector("#txtAirsBeforeSeason").value="AirsBeforeSeasonNumber"in item?item.AirsBeforeSeasonNumber:"",context.querySelector("#txtAirsAfterSeason").value="AirsAfterSeasonNumber"in item?item.AirsAfterSeasonNumber:"",context.querySelector("#txtAirsBeforeEpisode").value="AirsBeforeEpisodeNumber"in item?item.AirsBeforeEpisodeNumber:"",context.querySelector("#txtAlbum").value=item.Album||"",context.querySelector("#txtAlbumArtist").value=(item.AlbumArtists||[]).map(function(a){return a.Name}).join(";"),context.querySelector("#selectDisplayOrder").value=item.DisplayOrder,context.querySelector("#txtArtist").value=(item.ArtistItems||[]).map(function(a){return a.Name}).join(";");var date;if(item.DateCreated)try{date=datetime.parseISO8601Date(item.DateCreated,!0),context.querySelector("#txtDateAdded").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtDateAdded").value=""}else context.querySelector("#txtDateAdded").value="";if(item.PremiereDate)try{date=datetime.parseISO8601Date(item.PremiereDate,!0),context.querySelector("#txtPremiereDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtPremiereDate").value=""}else context.querySelector("#txtPremiereDate").value="";if(item.EndDate)try{date=datetime.parseISO8601Date(item.EndDate,!0),context.querySelector("#txtEndDate").value=date.toISOString().slice(0,10)}catch(e){context.querySelector("#txtEndDate").value=""}else context.querySelector("#txtEndDate").value="";context.querySelector("#txtProductionYear").value=item.ProductionYear||"",context.querySelector("#txtAirTime").value=item.AirTime||"";var placeofBirth=item.ProductionLocations&&item.ProductionLocations.length?item.ProductionLocations[0]:"";if(context.querySelector("#txtPlaceOfBirth").value=placeofBirth,context.querySelector("#txtOriginalAspectRatio").value=item.AspectRatio||"",context.querySelector("#selectLanguage").value=item.PreferredMetadataLanguage||"",context.querySelector("#selectCountry").value=item.PreferredMetadataCountryCode||"",item.RunTimeTicks){var minutes=item.RunTimeTicks/6e8;context.querySelector("#txtSeriesRuntime").value=Math.round(minutes)}else context.querySelector("#txtSeriesRuntime",context).value=""}function populateRatings(allParentalRatings,select,currentValue){var html="";html+="";var i,length,rating,ratings=[],currentValueFound=!1;for(i=0,length=allParentalRatings.length;i"+rating.Name+"";select.innerHTML=html}function populateStatus(select){var html="";html+="",html+="",html+="",select.innerHTML=html}function populateListView(list,items,sortCallback){items=items||[],"undefined"==typeof sortCallback?items.sort(function(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}):items=sortCallback(items);for(var html="",i=0;i',html+='live_tv',html+='
',html+='
',html+=items[i],html+="
",html+="
",html+='',html+="
";list.innerHTML=html}function populatePeople(context,people){for(var lastType="",html="",elem=context.querySelector("#peopleList"),i=0,length=people.length;i',html+='person',html+='",html+='',html+="
"}elem.innerHTML=html}function generateSliders(fields,currentFields){for(var html="",i=0;i",html+=""+name+"",html+=""}return html}function populateInternetProviderSettings(context,item,lockedFields){var container=context.querySelector(".providerSettingsContainer");lockedFields=lockedFields||[];var metadatafields=[{name:globalize.translate("sharedcomponents#Name"),value:"Name"},{name:globalize.translate("sharedcomponents#Overview"),value:"Overview"},{name:globalize.translate("sharedcomponents#Genres"),value:"Genres"},{name:globalize.translate("sharedcomponents#ParentalRating"),value:"OfficialRating"},{name:globalize.translate("sharedcomponents#People"),value:"Cast"}];"Person"===item.Type?metadatafields.push({name:globalize.translate("sharedcomponents#BirthLocation"),value:"ProductionLocations"}):metadatafields.push({name:globalize.translate("sharedcomponents#ProductionLocations"),value:"ProductionLocations"}),"Series"===item.Type&&metadatafields.push({name:globalize.translate("Runtime"),value:"Runtime"}),metadatafields.push({name:globalize.translate("sharedcomponents#Studios"),value:"Studios"}),metadatafields.push({name:globalize.translate("sharedcomponents#Tags"),value:"Tags"}),metadatafields.push({name:globalize.translate("sharedcomponents#Keywords"),value:"Keywords"}),metadatafields.push({name:globalize.translate("sharedcomponents#Images"),value:"Images"}),metadatafields.push({name:globalize.translate("sharedcomponents#Backdrops"),value:"Backdrops"}),"Game"===item.Type&&metadatafields.push({name:globalize.translate("sharedcomponents#Screenshots"),value:"Screenshots"});var html="";html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFields")+"

",html+="

"+globalize.translate("sharedcomponents#HeaderEnabledFieldsHelp")+"

",html+=generateSliders(metadatafields,lockedFields),container.innerHTML=html}function reload(context,itemId,serverId){loading.show(),Promise.all([getItem(itemId,serverId),getEditorConfig(itemId,serverId)]).then(function(responses){var item=responses[0];metadataEditorInfo=responses[1],currentItem=item;var languages=metadataEditorInfo.Cultures,countries=metadataEditorInfo.Countries;renderContentTypeOptions(context,metadataEditorInfo),loadExternalIds(context,item,metadataEditorInfo.ExternalIdInfos),populateLanguages(context.querySelector("#selectLanguage"),languages),populateCountries(context.querySelector("#selectCountry"),countries),setFieldVisibilities(context,item),fillItemInfo(context,item,metadataEditorInfo.ParentalRatingOptions),"Video"===item.MediaType&&"Episode"!==item.Type?showElement("#fldTagline",context):hideElement("#fldTagline",context),loading.hide()})}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function show(itemId,serverId,resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="medium-tall";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg),dlg.addEventListener("close",function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),unbindItemChanged(dlg,connectionManager.getApiClient(serverId)),resolve()}),currentContext=dlg,init(dlg,connectionManager.getApiClient(serverId)),reload(dlg,itemId,serverId)})}var currentContext,metadataEditorInfo,currentItem;return{show:function(itemId,serverId){return new Promise(function(resolve,reject){return show(itemId,serverId,resolve,reject)})},embed:function(elem,itemId,serverId){return new Promise(function(resolve,reject){loading.show(),require(["text!./metadataeditor.template.html"],function(template){elem.innerHTML=globalize.translateDocument(template,"sharedcomponents"),elem.querySelector(".formDialogFooter").classList.remove("formDialogFooter"),elem.querySelector(".btnHeaderSave").classList.remove("hide"),elem.querySelector(".btnCancel").classList.add("hide"),currentContext=elem,init(elem,connectionManager.getApiClient(serverId)),reload(elem,itemId,serverId),focusManager.autoFocus(elem)})})}}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html index 6c383313d1..fe0982276e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html @@ -68,9 +68,6 @@
-
- -
diff --git a/dashboard-ui/bower_components/emby-webcomponents/multiselect/multiselect.js b/dashboard-ui/bower_components/emby-webcomponents/multiselect/multiselect.js index 1d7fc8404a..d019e7341c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/multiselect/multiselect.js +++ b/dashboard-ui/bower_components/emby-webcomponents/multiselect/multiselect.js @@ -1 +1 @@ -define(["browser","appStorage","apphost","loading","connectionManager","globalize","embyRouter","dom","css!./multiselect"],function(browser,appStorage,appHost,loading,connectionManager,globalize,embyRouter,dom){"use strict";function hideSelections(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(selectionCommandsPanel){selectionCommandsPanel.parentNode.removeChild(selectionCommandsPanel),currentSelectionCommandsPanel=null,selectedItems=[],selectedElements=[];for(var elems=document.querySelectorAll(".itemSelectionPanel"),i=0,length=elems.length;i";var chkItemSelect=itemSelectionPanel.querySelector(".chkItemSelect");chkItemSelect.addEventListener("change",onSelectionChange)}}function showSelectionCommands(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(!selectionCommandsPanel){selectionCommandsPanel=document.createElement("div"),selectionCommandsPanel.classList.add("selectionCommandsPanel"),document.body.appendChild(selectionCommandsPanel),currentSelectionCommandsPanel=selectionCommandsPanel;var html="";html+='',html+='

';var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='",selectionCommandsPanel.innerHTML=html,selectionCommandsPanel.querySelector(".btnCloseSelectionPanel").addEventListener("click",hideSelections);var btnSelectionPanelOptions=selectionCommandsPanel.querySelector(".btnSelectionPanelOptions");btnSelectionPanelOptions.addEventListener("click",showMenuForSelectedItems)}}function deleteItems(apiClient,itemIds){return new Promise(function(resolve,reject){var msg=globalize.translate("sharedcomponents#ConfirmDeleteItem"),title=globalize.translate("sharedcomponents#HeaderDeleteItem");itemIds.length>1&&(msg=globalize.translate("sharedcomponents#ConfirmDeleteItems"),title=globalize.translate("sharedcomponents#HeaderDeleteItems")),require(["confirm"],function(confirm){confirm(msg,title).then(function(){var promises=itemIds.map(function(itemId){apiClient.deleteItem(itemId)});Promise.all(promises).then(resolve)},reject)})})}function showMenuForSelectedItems(e){var apiClient=connectionManager.currentApiClient();apiClient.getCurrentUser().then(function(user){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#AddToCollection"),id:"addtocollection",ironIcon:"add"}),menuItems.push({name:globalize.translate("sharedcomponents#AddToPlaylist"),id:"playlist",ironIcon:"playlist-add"}),user.Policy.EnableContentDeletion&&menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete",ironIcon:"delete"}),user.Policy.EnableContentDownloading&&appHost.supports("filedownload"),menuItems.push({name:globalize.translate("sharedcomponents#GroupVersions"),id:"groupvideos",ironIcon:"call-merge"}),user.Policy.EnableSync&&appHost.supports("sync")&&menuItems.push({name:globalize.translate("sharedcomponents#MakeAvailableOffline"),id:"synclocal"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkPlayed"),id:"markplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkUnplayed"),id:"markunplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#Refresh"),id:"refresh"}),user.Policy.EnableSync&&menuItems.push({name:globalize.translate("sharedcomponents#SyncToOtherDevice"),id:"sync"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:e.target,callback:function(id){var items=selectedItems.slice(0),serverId=apiClient.serverInfo().Id;switch(id){case"addtocollection":require(["collectionEditor"],function(collectionEditor){(new collectionEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"playlist":require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"delete":deleteItems(apiClient,items).then(function(){embyRouter.goHome()}),hideSelections(),dispatchNeedsRefresh();break;case"groupvideos":combineVersions(apiClient,items);break;case"markplayed":items.forEach(function(itemId){apiClient.markPlayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"markunplayed":items.forEach(function(itemId){apiClient.markUnplayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"refresh":require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:items,serverId:serverId}).show()}),hideSelections(),dispatchNeedsRefresh();break;case"sync":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"synclocal":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),isLocalSync:!0,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh()}}})})})}function dispatchNeedsRefresh(){var elems=[];[].forEach.call(selectedElements,function(i){var container=dom.parentWithAttribute(i,"is","emby-itemscontainer");container&&elems.indexOf(container)===-1&&elems.push(container)});for(var i=0,length=elems.length;i=5||deltaY>=5)&&onMouseOut(e)}}function onTouchEnd(e){onMouseOut(e)}function onMouseDown(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=e.target,touchStartTimeout=setTimeout(onTouchStartTimerFired,550)}function onMouseOut(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=null}function onTouchStartTimerFired(){if(touchTarget){var card=dom.parentWithClass(touchTarget,"card");touchTarget=null,card&&showSelections(card)}}function initTapHold(element){browser.touch&&!browser.safari?element.addEventListener("contextmenu",onTapHold):(dom.addEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.addEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.addEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.addEventListener(element,"touchcancel",onTouchEnd,{passive:!0}),dom.addEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.addEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.addEventListener(element,"mouseup",onMouseOut,{passive:!0}))}var touchTarget,touchStartTimeout,touchStartX,touchStartY,self=this,container=options.container;initTapHold(container),options.bindOnClick!==!1&&container.addEventListener("click",onContainerClick),self.onContainerClick=onContainerClick,self.destroy=function(){container.removeEventListener("click",onContainerClick),container.removeEventListener("contextmenu",onTapHold);var element=container;dom.removeEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.removeEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.removeEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.removeEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.removeEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.removeEventListener(element,"mouseup",onMouseOut,{passive:!0})}}}); \ No newline at end of file +define(["browser","appStorage","apphost","loading","connectionManager","globalize","embyRouter","dom","css!./multiselect"],function(browser,appStorage,appHost,loading,connectionManager,globalize,embyRouter,dom){"use strict";function hideSelections(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(selectionCommandsPanel){selectionCommandsPanel.parentNode.removeChild(selectionCommandsPanel),currentSelectionCommandsPanel=null,selectedItems=[],selectedElements=[];for(var elems=document.querySelectorAll(".itemSelectionPanel"),i=0,length=elems.length;i";var chkItemSelect=itemSelectionPanel.querySelector(".chkItemSelect");chkItemSelect.addEventListener("change",onSelectionChange)}}function showSelectionCommands(){var selectionCommandsPanel=currentSelectionCommandsPanel;if(!selectionCommandsPanel){selectionCommandsPanel=document.createElement("div"),selectionCommandsPanel.classList.add("selectionCommandsPanel"),document.body.appendChild(selectionCommandsPanel),currentSelectionCommandsPanel=selectionCommandsPanel;var html="";html+='',html+='

';var moreIcon="dots-horiz"===appHost.moreIcon?"":"";html+='",selectionCommandsPanel.innerHTML=html,selectionCommandsPanel.querySelector(".btnCloseSelectionPanel").addEventListener("click",hideSelections);var btnSelectionPanelOptions=selectionCommandsPanel.querySelector(".btnSelectionPanelOptions");btnSelectionPanelOptions.addEventListener("click",showMenuForSelectedItems)}}function deleteItems(apiClient,itemIds){return new Promise(function(resolve,reject){var msg=globalize.translate("sharedcomponents#ConfirmDeleteItem"),title=globalize.translate("sharedcomponents#HeaderDeleteItem");itemIds.length>1&&(msg=globalize.translate("sharedcomponents#ConfirmDeleteItems"),title=globalize.translate("sharedcomponents#HeaderDeleteItems")),require(["confirm"],function(confirm){confirm(msg,title).then(function(){var promises=itemIds.map(function(itemId){apiClient.deleteItem(itemId)});Promise.all(promises).then(resolve)},reject)})})}function showMenuForSelectedItems(e){var apiClient=connectionManager.currentApiClient();apiClient.getCurrentUser().then(function(user){var menuItems=[];menuItems.push({name:globalize.translate("sharedcomponents#AddToCollection"),id:"addtocollection",ironIcon:"add"}),menuItems.push({name:globalize.translate("sharedcomponents#AddToPlaylist"),id:"playlist",ironIcon:"playlist-add"}),user.Policy.EnableContentDeletion&&menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete",ironIcon:"delete"}),user.Policy.EnableContentDownloading&&appHost.supports("filedownload"),user.Policy.EnableContentDownloading&&menuItems.push({name:globalize.translate("sharedcomponents#DownloadToOtherDevice"),id:"sync"}),menuItems.push({name:globalize.translate("sharedcomponents#GroupVersions"),id:"groupvideos",ironIcon:"call-merge"}),user.Policy.EnableContentDownloading&&appHost.supports("sync")&&menuItems.push({name:globalize.translate("sharedcomponents#MakeAvailableOffline"),id:"synclocal"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkPlayed"),id:"markplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#MarkUnplayed"),id:"markunplayed"}),menuItems.push({name:globalize.translate("sharedcomponents#Refresh"),id:"refresh"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:e.target,callback:function(id){var items=selectedItems.slice(0),serverId=apiClient.serverInfo().Id;switch(id){case"addtocollection":require(["collectionEditor"],function(collectionEditor){(new collectionEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"playlist":require(["playlistEditor"],function(playlistEditor){(new playlistEditor).show({items:items,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"delete":deleteItems(apiClient,items).then(function(){embyRouter.goHome()}),hideSelections(),dispatchNeedsRefresh();break;case"groupvideos":combineVersions(apiClient,items);break;case"markplayed":items.forEach(function(itemId){apiClient.markPlayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"markunplayed":items.forEach(function(itemId){apiClient.markUnplayed(apiClient.getCurrentUserId(),itemId)}),hideSelections(),dispatchNeedsRefresh();break;case"refresh":require(["refreshDialog"],function(refreshDialog){new refreshDialog({itemIds:items,serverId:serverId}).show()}),hideSelections(),dispatchNeedsRefresh();break;case"sync":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),serverId:serverId})}),hideSelections(),dispatchNeedsRefresh();break;case"synclocal":require(["syncDialog"],function(syncDialog){syncDialog.showMenu({items:items.map(function(i){return{Id:i}}),isLocalSync:!0,serverId:serverId})}),hideSelections(),dispatchNeedsRefresh()}}})})})}function dispatchNeedsRefresh(){var elems=[];[].forEach.call(selectedElements,function(i){var container=dom.parentWithAttribute(i,"is","emby-itemscontainer");container&&elems.indexOf(container)===-1&&elems.push(container)});for(var i=0,length=elems.length;i=5||deltaY>=5)&&onMouseOut(e)}}function onTouchEnd(e){onMouseOut(e)}function onMouseDown(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=e.target,touchStartTimeout=setTimeout(onTouchStartTimerFired,550)}function onMouseOut(e){touchStartTimeout&&(clearTimeout(touchStartTimeout),touchStartTimeout=null),touchTarget=null}function onTouchStartTimerFired(){if(touchTarget){var card=dom.parentWithClass(touchTarget,"card");touchTarget=null,card&&showSelections(card)}}function initTapHold(element){browser.touch&&!browser.safari?element.addEventListener("contextmenu",onTapHold):(dom.addEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.addEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.addEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.addEventListener(element,"touchcancel",onTouchEnd,{passive:!0}),dom.addEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.addEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.addEventListener(element,"mouseup",onMouseOut,{passive:!0}))}var touchTarget,touchStartTimeout,touchStartX,touchStartY,self=this,container=options.container;initTapHold(container),options.bindOnClick!==!1&&container.addEventListener("click",onContainerClick),self.onContainerClick=onContainerClick,self.destroy=function(){container.removeEventListener("click",onContainerClick),container.removeEventListener("contextmenu",onTapHold);var element=container;dom.removeEventListener(element,"touchstart",onTouchStart,{passive:!0}),dom.removeEventListener(element,"touchmove",onTouchMove,{passive:!0}),dom.removeEventListener(element,"touchend",onTouchEnd,{passive:!0}),dom.removeEventListener(element,"mousedown",onMouseDown,{passive:!0}),dom.removeEventListener(element,"mouseleave",onMouseOut,{passive:!0}),dom.removeEventListener(element,"mouseup",onMouseOut,{passive:!0})}}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js b/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js index fad542884c..18bc41b82a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/packagemanager.js @@ -1 +1 @@ -define(["appSettings","pluginManager"],function(appSettings,pluginManager){"use strict";function PackageManager(){function addPackage(pkg){packages=packages.filter(function(p){return p.name!==pkg.name}),packages.push(pkg)}function removeUrl(url){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");manifestUrls=manifestUrls.filter(function(i){return i!==url}),appSettings.set(settingsKey,JSON.stringify(manifestUrls))}function loadPackage(url,throwError){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest,originalUrl=url;url+=url.indexOf("?")===-1?"?":"&",url+="t="+(new Date).getTime(),xhr.open("GET",url,!0);var onError=function(){throwError===!0?reject():(removeUrl(originalUrl),resolve())};xhr.onload=function(e){if(this.status<400){var pkg=JSON.parse(this.response);pkg.url=originalUrl,addPackage(pkg);var plugins=pkg.plugins||[];pkg.plugin&&plugins.push(pkg.plugin);var promises=plugins.map(function(pluginUrl){return pluginManager.loadPlugin(self.mapPath(pkg,pluginUrl))});Promise.all(promises).then(resolve,resolve)}else onError()},xhr.onerror=onError,xhr.send()})}var self=this,settingsKey="installedpackages1",packages=[];self.packages=function(){return packages.slice(0)},self.install=function(url){return loadPackage(url,!0).then(function(pkg){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return manifestUrls.indexOf(url)===-1&&(manifestUrls.push(url),appSettings.set(settingsKey,JSON.stringify(manifestUrls))),pkg})},self.uninstall=function(name){var pkg=packages.filter(function(p){return p.name===name})[0];return pkg&&(packages=packages.filter(function(p){return p.name!==name}),removeUrl(pkg.url)),Promise.resolve()},self.init=function(){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return Promise.all(manifestUrls.map(loadPackage)).then(function(){return Promise.resolve()},function(){return Promise.resolve()})}}return PackageManager.prototype.mapPath=function(pkg,pluginUrl){var urlLower=pluginUrl.toLowerCase();if(0===urlLower.indexOf("http:")||0===urlLower.indexOf("https:")||0===urlLower.indexOf("file:"))return pluginUrl;var packageUrl=pkg.url;return packageUrl=packageUrl.substring(0,packageUrl.lastIndexOf("/")),packageUrl+="/",packageUrl+=pluginUrl},new PackageManager}); \ No newline at end of file +define(["appSettings","pluginManager"],function(appSettings,pluginManager){"use strict";function addPackage(packageManager,pkg){packageManager.packagesList=packageManager.packagesList.filter(function(p){return p.name!==pkg.name}),packageManager.packagesList.push(pkg)}function removeUrl(url){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");manifestUrls=manifestUrls.filter(function(i){return i!==url}),appSettings.set(settingsKey,JSON.stringify(manifestUrls))}function loadPackage(packageManager,url,throwError){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest,originalUrl=url;url+=url.indexOf("?")===-1?"?":"&",url+="t="+(new Date).getTime(),xhr.open("GET",url,!0);var onError=function(){throwError===!0?reject():(removeUrl(originalUrl),resolve())};xhr.onload=function(e){if(this.status<400){var pkg=JSON.parse(this.response);pkg.url=originalUrl,addPackage(packageManager,pkg);var plugins=pkg.plugins||[];pkg.plugin&&plugins.push(pkg.plugin);var promises=plugins.map(function(pluginUrl){return pluginManager.loadPlugin(packageManager.mapPath(pkg,pluginUrl))});Promise.all(promises).then(resolve,resolve)}else onError()},xhr.onerror=onError,xhr.send()})}function PackageManager(){this.packagesList=[]}var settingsKey="installedpackages1";return PackageManager.prototype.init=function(){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]"),instance=this;return Promise.all(manifestUrls.map(function(u){return loadPackage(instance,u)})).then(function(){return Promise.resolve()},function(){return Promise.resolve()})},PackageManager.prototype.packages=function(){return this.packagesList.slice(0)},PackageManager.prototype.install=function(url){return loadPackage(this,url,!0).then(function(pkg){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return manifestUrls.indexOf(url)===-1&&(manifestUrls.push(url),appSettings.set(settingsKey,JSON.stringify(manifestUrls))),pkg})},PackageManager.prototype.uninstall=function(name){var pkg=this.packagesList.filter(function(p){return p.name===name})[0];return pkg&&(this.packagesList=this.packagesList.filter(function(p){return p.name!==name}),removeUrl(pkg.url)),Promise.resolve()},PackageManager.prototype.mapPath=function(pkg,pluginUrl){var urlLower=pluginUrl.toLowerCase();if(0===urlLower.indexOf("http:")||0===urlLower.indexOf("https:")||0===urlLower.indexOf("file:"))return pluginUrl;var packageUrl=pkg.url;return packageUrl=packageUrl.substring(0,packageUrl.lastIndexOf("/")),packageUrl+="/",packageUrl+=pluginUrl},new PackageManager}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js b/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js index 97c6e55433..091ca1950c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js @@ -1,2 +1,2 @@ -define(["events","datetime","appSettings","pluginManager","userSettings","globalize","connectionManager","loading","serverNotifications","apphost","fullscreenManager","layoutManager"],function(events,datetime,appSettings,pluginManager,userSettings,globalize,connectionManager,loading,serverNotifications,apphost,fullscreenManager,layoutManager){"use strict";function enableLocalPlaylistManagement(player){return!!player.isLocalPlayer}function bindToFullscreenChange(player){events.on(fullscreenManager,"fullscreenchange",function(){events.trigger(player,"fullscreenchange")})}function PlaybackManager(){function triggerPlayerChange(newPlayer,newTarget,previousPlayer,previousTargetInfo){(newPlayer||previousPlayer)&&(newTarget&&previousTargetInfo&&newTarget.id===previousTargetInfo.id||events.trigger(self,"playerchange",[newPlayer,newTarget,previousPlayer]))}function displayPlayerInLocalGroup(player){return player.isLocalPlayer}function getSupportedCommands(player){if(player.isLocalPlayer){var list=["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","SetMaxStreamingBitrate","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode"];return apphost.supports("fullscreenchange")&&!layoutManager.tv&&list.push("ToggleFullscreen"),player.supports&&(player.supports("PictureInPicture")&&list.push("PictureInPicture"),player.supports("SetBrightness")&&list.push("SetBrightness"),player.supports("SetAspectRatio")&&list.push("SetAspectRatio")),list}throw new Error("player must define supported commands")}function createTarget(player){return{name:player.name,id:player.id,playerName:player.name,playableMediaTypes:["Audio","Video","Game"].map(player.canPlayMediaType),isLocalPlayer:player.isLocalPlayer,supportedCommands:getSupportedCommands(player)}}function getPlayerTargets(player){return player.getTargets?player.getTargets():Promise.resolve([createTarget(player)])}function getCurrentSubtitleStream(player){if(!player)throw new Error("player cannot be null");var index=getPlayerData(player).subtitleStreamIndex;return null==index||index===-1?null:getSubtitleStream(player,index)}function getSubtitleStream(player,index){return self.currentMediaSource(player).MediaStreams.filter(function(s){return"Subtitle"===s.Type&&s.Index===index})[0]}function setCurrentPlayerInternal(player,targetInfo){var previousPlayer=currentPlayer,previousTargetInfo=currentTargetInfo;if(player&&!targetInfo&&player.isLocalPlayer&&(targetInfo=createTarget(player)),player&&!targetInfo)throw new Error("targetInfo cannot be null");currentPairingId=null,currentPlayer=player,currentTargetInfo=targetInfo,targetInfo&&console.log("Active player: "+JSON.stringify(targetInfo)),player&&player.isLocalPlayer&&(lastLocalPlayer=player),previousPlayer&&self.endPlayerUpdates(previousPlayer),player&&self.beginPlayerUpdates(player),triggerPlayerChange(player,targetInfo,previousPlayer,previousTargetInfo)}function getAutomaticPlayers(){var player=currentPlayer;return player&&!enableLocalPlaylistManagement(player)?[player]:self.getPlayers().filter(enableLocalPlaylistManagement)}function canPlayerSeek(player){if(!player)throw new Error("player cannot be null");var playerData=getPlayerData(player),currentSrc=(playerData.streamInfo.url||"").toLowerCase();return currentSrc.indexOf(".m3u8")!==-1||"Transcode"!==playerData.streamInfo.playMethod&&player.duration()}function changeStream(player,ticks,params){if(canPlayerSeek(player)&&null==params)return void player.currentTime(parseInt(ticks/1e4));params=params||{};var liveStreamId=getPlayerData(player).streamInfo.liveStreamId,playSessionId=getPlayerData(player).streamInfo.playSessionId,playerData=getPlayerData(player),currentItem=playerData.streamInfo.item;player.getDeviceProfile(currentItem,{isRetry:params.EnableDirectPlay===!1}).then(function(deviceProfile){var audioStreamIndex=null==params.AudioStreamIndex?getPlayerData(player).audioStreamIndex:params.AudioStreamIndex,subtitleStreamIndex=null==params.SubtitleStreamIndex?getPlayerData(player).subtitleStreamIndex:params.SubtitleStreamIndex,currentMediaSource=playerData.streamInfo.mediaSource,apiClient=connectionManager.getApiClient(currentItem.ServerId);ticks&&(ticks=parseInt(ticks));var maxBitrate=params.MaxStreamingBitrate||self.getMaxStreamingBitrate(player);getPlaybackInfo(apiClient,currentItem.Id,deviceProfile,maxBitrate,ticks,currentMediaSource,audioStreamIndex,subtitleStreamIndex,liveStreamId,params.EnableDirectPlay,params.EnableDirectStream,params.AllowVideoStreamCopy,params.AllowAudioStreamCopy).then(function(result){validatePlaybackInfoResult(result)&&(currentMediaSource=result.MediaSources[0],createStreamInfo(apiClient,currentItem.MediaType,currentItem,currentMediaSource,ticks).then(function(streamInfo){return streamInfo.fullscreen=currentPlayOptions.fullscreen,streamInfo.url?(getPlayerData(player).subtitleStreamIndex=subtitleStreamIndex,getPlayerData(player).audioStreamIndex=audioStreamIndex,getPlayerData(player).maxStreamingBitrate=maxBitrate,void changeStreamToUrl(apiClient,player,playSessionId,streamInfo)):(showPlaybackInfoErrorMessage("NoCompatibleStream"),void self.nextTrack())}))})})}function changeStreamToUrl(apiClient,player,playSessionId,streamInfo,newPositionTicks){clearProgressInterval(player);var playerData=getPlayerData(player);playerData.isChangingStream=!0,"Video"===playerData.MediaType?apiClient.stopActiveEncodings(playSessionId).then(function(){setSrcIntoPlayer(apiClient,player,streamInfo)}):setSrcIntoPlayer(apiClient,player,streamInfo)}function setSrcIntoPlayer(apiClient,player,streamInfo){player.play(streamInfo).then(function(){var playerData=getPlayerData(player);playerData.isChangingStream=!1,playerData.streamInfo=streamInfo,startProgressInterval(player),sendProgressUpdate(player)},function(e){onPlaybackError.call(player,e,{type:"mediadecodeerror"})})}function getPlayerData(player){if(!player)throw new Error("player cannot be null");if(!player.name)throw new Error("player name cannot be null");var state=playerStates[player.name];return state||(playerStates[player.name]={},state=playerStates[player.name]),player}function getCurrentTicks(player){if(!player)throw new Error("player cannot be null");var playerTime=Math.floor(1e4*(player||currentPlayer).currentTime());return playerTime+=getPlayerData(player).streamInfo.transcodingOffsetTicks||0}function getNowPlayingItemForReporting(player,item,mediaSource){var nowPlayingItem=Object.assign({},item);return mediaSource&&(nowPlayingItem.RunTimeTicks=mediaSource.RunTimeTicks),nowPlayingItem.RunTimeTicks=nowPlayingItem.RunTimeTicks||1e4*player.duration(),nowPlayingItem}function translateItemsForPlayback(items,options){var promise,firstItem=items[0],serverId=firstItem.ServerId;return"Program"===firstItem.Type?promise=getItemsForPlayback(serverId,{Ids:firstItem.ChannelId}):"Playlist"===firstItem.Type?promise=getItemsForPlayback(serverId,{ParentId:firstItem.Id}):"MusicArtist"===firstItem.Type?promise=getItemsForPlayback(serverId,{ArtistIds:firstItem.Id,Filters:"IsNotFolder",Recursive:!0,SortBy:"SortName",MediaTypes:"Audio"}):"MusicGenre"===firstItem.Type?promise=getItemsForPlayback(serverId,{Genres:firstItem.Name,Filters:"IsNotFolder",Recursive:!0,SortBy:"SortName",MediaTypes:"Audio"}):firstItem.IsFolder?promise=getItemsForPlayback(serverId,{ParentId:firstItem.Id,Filters:"IsNotFolder",Recursive:!0,SortBy:"SortName",MediaTypes:"Audio,Video"}):"Episode"===firstItem.Type&&1===items.length&&getPlayer(firstItem,options).supportsProgress!==!1&&(promise=new Promise(function(resolve,reject){var apiClient=connectionManager.getApiClient(firstItem.ServerId);apiClient.getCurrentUser().then(function(user){return user.Configuration.EnableNextEpisodeAutoPlay&&firstItem.SeriesId?void apiClient.getEpisodes(firstItem.SeriesId,{IsVirtualUnaired:!1,IsMissing:!1,UserId:apiClient.getCurrentUserId(),Fields:"MediaSources,Chapters"}).then(function(episodesResult){var foundItem=!1;episodesResult.Items=episodesResult.Items.filter(function(e){return!!foundItem||e.Id===firstItem.Id&&(foundItem=!0,!0)}),episodesResult.TotalRecordCount=episodesResult.Items.length,resolve(episodesResult)},reject):void resolve(null)})})),promise?promise.then(function(result){return result?result.Items:items}):Promise.resolve(items)}function enableIntros(item){return"Video"===item.MediaType&&("TvChannel"!==item.Type&&("InProgress"!==item.Status&&isServerItem(item)))}function playWithIntros(items,options,user){var firstItem=items[0];"Video"===firstItem.MediaType;var afterPlayInternal=function(){for(var i=0,length=items.length;i=interceptors.length)return void resolve();var interceptor=interceptors[index];interceptor.intercept(options).then(function(){runNextPrePlay(interceptors,index+1,options,resolve,reject)},reject)}function playAfterBitrateDetect(connectionManager,maxBitrate,item,playOptions,onPlaybackStartedFn){var promise,startPosition=playOptions.startPositionTicks,player=getPlayer(item,playOptions),activePlayer=currentPlayer;return activePlayer?(playNextAfterEnded=!1,promise=onPlaybackChanging(activePlayer,player,item)):promise=Promise.resolve(),isServerItem(item)&&"Game"!==item.MediaType?Promise.all([promise,player.getDeviceProfile(item)]).then(function(responses){var deviceProfile=responses[1],apiClient=connectionManager.getApiClient(item.ServerId);return getPlaybackMediaSource(apiClient,deviceProfile,maxBitrate,item,startPosition).then(function(mediaSource){return createStreamInfo(apiClient,item.MediaType,item,mediaSource,startPosition).then(function(streamInfo){return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,getPlayerData(player).maxStreamingBitrate=maxBitrate,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource)},function(){onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource),setTimeout(function(err){onPlaybackError.call(player,err,{type:"mediadecodeerror"})},100)})})})}):promise.then(function(){var streamInfo=createStreamInfoFromUrlItem(item);return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo)},function(){self.stop(player)})})}function createStreamInfoFromUrlItem(item){return{url:item.Url||item.Path,playMethod:"DirectPlay",item:item,textTracks:[],mediaType:item.MediaType}}function backdropImageUrl(apiClient,item,options){return options=options||{},options.type=options.type||"Backdrop",options.maxWidth||options.width||options.maxHeight||options.height||(options.quality=100),item.BackdropImageTags&&item.BackdropImageTags.length?(options.tag=item.BackdropImageTags[0],apiClient.getScaledImageUrl(item.Id,options)):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(options.tag=item.ParentBackdropImageTags[0],apiClient.getScaledImageUrl(item.ParentBackdropItemId,options)):null}function getMimeType(type,container){if(container=(container||"").toLowerCase(),"audio"===type){if("opus"===container)return"audio/ogg";if("webma"===container)return"audio/webm";if("m4a"===container)return"audio/mp4"}else if("video"===type){if("mkv"===container)return"video/x-matroska";if("m4v"===container)return"video/mp4";if("mov"===container)return"video/quicktime";if("mpg"===container)return"video/mpeg";if("flv"===container)return"video/x-flv"}return type+"/"+container}function createStreamInfo(apiClient,type,item,mediaSource,startPosition,forceTranscoding){var mediaUrl,contentType,directOptions,transcodingOffsetTicks=0,playerStartPositionTicks=startPosition,liveStreamId=mediaSource.LiveStreamId,playMethod="Transcode",mediaSourceContainer=(mediaSource.Container||"").toLowerCase();if("Video"===type)contentType=getMimeType("video",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding?(mediaUrl=mediaSource.Path,playMethod="DirectPlay"):mediaSource.SupportsDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Videos/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(playerStartPositionTicks=null,contentType=getMimeType("video",mediaSource.TranscodingContainer),mediaUrl.toLowerCase().indexOf("copytimestamps=true")===-1&&(transcodingOffsetTicks=startPosition||0)));else if("Audio"===type)if(contentType=getMimeType("audio",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding)mediaUrl=mediaSource.Path,playMethod="DirectPlay";else{var isDirectStream=mediaSource.SupportsDirectStream;isDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Audio/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(transcodingOffsetTicks=startPosition||0,playerStartPositionTicks=null,contentType=getMimeType("audio",mediaSource.TranscodingContainer)))}else"Game"===type&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay");!mediaUrl&&mediaSource.SupportsDirectPlay&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay");var resultInfo={url:mediaUrl,mimeType:contentType,transcodingOffsetTicks:transcodingOffsetTicks,playMethod:playMethod,playerStartPositionTicks:playerStartPositionTicks,item:item,mediaSource:mediaSource,textTracks:getTextTracks(apiClient,mediaSource),tracks:getTextTracks(apiClient,mediaSource),mediaType:type,liveStreamId:liveStreamId,playSessionId:getParam("playSessionId",mediaUrl),title:item.Name},backdropUrl=backdropImageUrl(apiClient,item,{});return backdropUrl&&(resultInfo.backdropUrl=backdropUrl),Promise.resolve(resultInfo)}function getParam(name,url){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function getTextTracks(apiClient,mediaSource){for(var subtitleStreams=mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type}),textStreams=subtitleStreams.filter(function(s){return"External"===s.DeliveryMethod}),tracks=[],i=0,length=textStreams.length;i=playlistLength&&(newIndex=0);break;default:newIndex=self.getCurrentPlaylistIndex(player)+1}if(newIndex<0||newIndex>=playlistLength)return null;var item=playlist[newIndex];return item?{item:item,index:newIndex}:null}function queue(options,mode,player){if(player=player||currentPlayer,!player)return self.play(options);if(!enableLocalPlaylistManagement(player))return"next"===mode?player.queueNext(item):player.queue(item);if(options.items)return translateItemsForPlayback(options.items,options).then(function(items){queueAll(items,mode)});if(!options.serverId)throw new Error("serverId required!");return getItemsForPlayback(options.serverId,{Ids:options.ids.join(",")}).then(function(result){return translateItemsForPlayback(result.Items,options).then(function(items){queueAll(items,mode)})})}function queueAll(items,mode){for(var i=0,length=items.length;i1e4&&sendProgressUpdate(player)},500)}function sendProgressUpdate(player){if(!player)throw new Error("player cannot be null");player.lastProgressReport=(new Date).getTime(),self.getPlayerState(player).then(function(state){var currentItem=getPlayerData(player).streamInfo.item;reportPlayback(state,currentItem.ServerId,"reportPlaybackProgress")})}function reportPlayback(state,serverId,method){if(serverId){var info=Object.assign({},state.PlayState);info.ItemId=state.NowPlayingItem.Id;var apiClient=connectionManager.getApiClient(serverId);apiClient[method](info)}}function clearProgressInterval(player){if(!player)throw new Error("player cannot be null");var playerData=getPlayerData(player);playerData.currentProgressInterval&&(clearTimeout(playerData.currentProgressInterval),playerData.currentProgressInterval=null)}var currentPlayer,currentTargetInfo,lastLocalPlayer,currentPlaylistIndex,currentPlaylistItemId,currentPlayOptions,self=this,players=[],currentPairingId=null,repeatMode="RepeatNone",playlist=[],playNextAfterEnded=!0,playerStates={};self.currentItem=function(player){if(!player)throw new Error("player cannot be null");var data=getPlayerData(player);return data.streamInfo?data.streamInfo.item:null; -},self.currentMediaSource=function(player){if(!player)throw new Error("player cannot be null");var data=getPlayerData(player);return data.streamInfo?data.streamInfo.mediaSource:null},self.beginPlayerUpdates=function(player){player.beginPlayerUpdates&&player.beginPlayerUpdates()},self.endPlayerUpdates=function(player){player.endPlayerUpdates&&player.endPlayerUpdates()},self.getPlayerInfo=function(){var player=currentPlayer;if(!player)return null;var target=currentTargetInfo||{};return{name:player.name,isLocalPlayer:player.isLocalPlayer,id:target.id,deviceName:target.deviceName,playableMediaTypes:target.playableMediaTypes,supportedCommands:target.supportedCommands}},self.setActivePlayer=function(player,targetInfo){if("localplayer"===player||"localplayer"===player.name){if(currentPlayer&¤tPlayer.isLocalPlayer)return;return void setCurrentPlayerInternal(null,null)}if("string"==typeof player&&(player=players.filter(function(p){return p.name===player})[0]),!player)throw new Error("null player");setCurrentPlayerInternal(player,targetInfo)},self.trySetActivePlayer=function(player,targetInfo){if("localplayer"===player||"localplayer"===player.name)return void(currentPlayer&¤tPlayer.isLocalPlayer);if("string"==typeof player&&(player=players.filter(function(p){return p.name===player})[0]),!player)throw new Error("null player");if(currentPairingId!==targetInfo.id){currentPairingId=targetInfo.id;var promise=player.tryPair?player.tryPair(targetInfo):Promise.resolve();promise.then(function(){setCurrentPlayerInternal(player,targetInfo)},function(){currentPairingId===targetInfo.id&&(currentPairingId=null)})}},self.trySetActiveDeviceName=function(name){function normalizeName(t){return t.toLowerCase().replace(" ","")}name=normalizeName(name),self.getTargets().then(function(result){var target=result.filter(function(p){return normalizeName(p.name)===name})[0];target&&self.trySetActivePlayer(target.playerName,target)})},self.setDefaultPlayerActive=function(){self.setActivePlayer("localplayer")},self.removeActivePlayer=function(name){var playerInfo=self.getPlayerInfo();playerInfo&&playerInfo.name===name&&self.setDefaultPlayerActive()},self.removeActiveTarget=function(id){var playerInfo=self.getPlayerInfo();playerInfo&&playerInfo.id===id&&self.setDefaultPlayerActive()},self.disconnectFromPlayer=function(){var playerInfo=self.getPlayerInfo();playerInfo&&(playerInfo.supportedCommands.indexOf("EndSession")!==-1?require(["dialog"],function(dialog){var menuItems=[];menuItems.push({name:globalize.translate("ButtonYes"),id:"yes"}),menuItems.push({name:globalize.translate("ButtonNo"),id:"no"}),dialog({buttons:menuItems,text:globalize.translate("ConfirmEndPlayerSession")}).then(function(id){switch(id){case"yes":self.getCurrentPlayer().endSession(),self.setDefaultPlayerActive();break;case"no":self.setDefaultPlayerActive()}})}):self.setDefaultPlayerActive())},self.getTargets=function(){var promises=players.filter(function(p){return!displayPlayerInLocalGroup(p)}).map(getPlayerTargets);return Promise.all(promises).then(function(responses){var targets=[];targets.push({name:globalize.translate("sharedcomponents#HeaderMyDevice"),id:"localplayer",playerName:"localplayer",playableMediaTypes:["Audio","Video","Game"],isLocalPlayer:!0,supportedCommands:getSupportedCommands({isLocalPlayer:!0})});for(var i=0;idatetime.parseISO8601Date(item.EndDate).getTime()||(new Date).getTime()=supported.length&&(index=0),self.setAspectRatio(supported[index].id,player)}},self.setAspectRatio=function(val,player){player=player||currentPlayer,player&&player.setAspectRatio&&player.setAspectRatio(val)},self.getSupportedAspectRatios=function(player){return player=player||currentPlayer,player&&player.getSupportedAspectRatios?player.getSupportedAspectRatios():[]},self.getAspectRatio=function(player){if(player=player||currentPlayer,player&&player.getAspectRatio)return player.getAspectRatio()};var brightnessOsdLoaded;self.setBrightness=function(val,player){player=player||currentPlayer,player&&(brightnessOsdLoaded||(brightnessOsdLoaded=!0,require(["brightnessOsd"])),player.setBrightness(val))},self.getBrightness=function(player){if(player=player||currentPlayer)return player.getBrightness()},self.setVolume=function(val,player){player=player||currentPlayer,player&&player.setVolume(val)},self.getVolume=function(player){if(player=player||currentPlayer)return player.getVolume()},self.volumeUp=function(player){player=player||currentPlayer,player&&player.volumeUp()},self.volumeDown=function(player){player=player||currentPlayer,player&&player.volumeDown()},self.getAudioStreamIndex=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getAudioStreamIndex():getPlayerData(player).audioStreamIndex},self.setAudioStreamIndex=function(index,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.setAudioStreamIndex(index):void("Transcode"!==getPlayerData(player).streamInfo.playMethod&&player.canSetAudioStreamIndex()?(player.setAudioStreamIndex(index),getPlayerData(player).audioStreamIndex=index):(changeStream(player,getCurrentTicks(player),{AudioStreamIndex:index}),getPlayerData(player).audioStreamIndex=index))},self.getMaxStreamingBitrate=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getMaxStreamingBitrate():getPlayerData(player).maxStreamingBitrate||appSettings.maxStreamingBitrate()},self.enableAutomaticBitrateDetection=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.enableAutomaticBitrateDetection():appSettings.enableAutomaticBitrateDetection()},self.setMaxStreamingBitrate=function(options,player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setMaxStreamingBitrate(options);var promise;options.enableAutomaticBitrateDetection?(appSettings.enableAutomaticBitrateDetection(!0),promise=connectionManager.getApiClient(self.currentItem(player).ServerId).detectBitrate(!0)):(appSettings.enableAutomaticBitrateDetection(!1),promise=Promise.resolve(options.maxBitrate)),promise.then(function(bitrate){appSettings.maxStreamingBitrate(bitrate),changeStream(player,getCurrentTicks(player),{MaxStreamingBitrate:bitrate})})},self.isFullscreen=function(player){return player=player||currentPlayer,!player.isLocalPlayer||player.isFullscreen?player.isFullscreen():fullscreenManager.isFullScreen()},self.toggleFullscreen=function(player){return player=player||currentPlayer,!player.isLocalPlayer||player.toggleFulscreen?player.toggleFulscreen():void(fullscreenManager.isFullScreen()?fullscreenManager.exitFullscreen():fullscreenManager.requestFullscreen())},self.togglePictureInPicture=function(player){return player=player||currentPlayer,player.togglePictureInPicture()},self.getSubtitleStreamIndex=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.getSubtitleStreamIndex();if(!player)throw new Error("player cannot be null");return getPlayerData(player).subtitleStreamIndex},self.setSubtitleStreamIndex=function(index,player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setSubtitleStreamIndex(index);var currentStream=getCurrentSubtitleStream(player),newStream=getSubtitleStream(player,index);if(currentStream||newStream){var selectedTrackElementIndex=-1,currentPlayMethod=(getPlayerData(player).streamInfo||{}).playMethod;currentStream&&!newStream?("Encode"===currentStream.DeliveryMethod||"Embed"===currentStream.DeliveryMethod&&"Transcode"===currentPlayMethod)&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1}):!currentStream&&newStream?"External"===newStream.DeliveryMethod?selectedTrackElementIndex=index:"Embed"===newStream.DeliveryMethod&&"Transcode"!==currentPlayMethod?selectedTrackElementIndex=index:changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index}):currentStream&&newStream&&("External"===newStream.DeliveryMethod||"Embed"===newStream.DeliveryMethod&&"Transcode"!==currentPlayMethod?(selectedTrackElementIndex=index,"External"!==currentStream.DeliveryMethod&&"Embed"!==currentStream.DeliveryMethod&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1})):changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index})),player.setSubtitleStreamIndex(selectedTrackElementIndex),getPlayerData(player).subtitleStreamIndex=index}},self.toggleDisplayMirroring=function(){self.enableDisplayMirroring(!self.enableDisplayMirroring())},self.enableDisplayMirroring=function(enabled){if(null!=enabled){var val=enabled?"1":"0";return void appSettings.set("displaymirror",val)}return"0"!==(appSettings.get("displaymirror")||"")},self.stop=function(player){return player=player||currentPlayer,player?(playNextAfterEnded=!1,player.stop(!0,!0)):Promise.resolve()},self.playPause=function(player){if(player=player||currentPlayer)return player.playPause?player.playPause():player.paused()?self.unpause(player):self.pause(player)},self.paused=function(player){if(player=player||currentPlayer)return player.paused()},self.pause=function(player){player=player||currentPlayer,player&&player.pause()},self.unpause=function(player){player=player||currentPlayer,player&&player.unpause()},self.seek=function(ticks,player){return ticks=Math.max(0,ticks),player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.seek(ticks):void changeStream(player,ticks)},self.nextChapter=function(player){player=player||currentPlayer;var item=self.currentItem(player),ticks=getCurrentTicks(player),nextChapter=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks>ticks})[0];nextChapter?self.seek(nextChapter.StartPositionTicks,player):self.nextTrack(player)},self.previousChapter=function(player){player=player||currentPlayer;var item=self.currentItem(player),ticks=getCurrentTicks(player);ticks-=1e8,0===self.getCurrentPlaylistIndex(player)&&(ticks=Math.max(ticks,0));var previousChapters=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks<=ticks});previousChapters.length?self.seek(previousChapters[previousChapters.length-1].StartPositionTicks,player):self.previousTrack(player)},self.fastForward=function(player){if(player=player||currentPlayer,null!=player.fastForward)return void player.fastForward(userSettings.skipForwardLength());var ticks=getCurrentTicks(player);ticks+=1e4*userSettings.skipForwardLength();var runTimeTicks=self.duration(player)||0;ticks0||canPlayerSeek(player)),item&&(state.NowPlayingItem=getNowPlayingItemForReporting(player,item,mediaSource)),state.MediaSource=mediaSource,Promise.resolve(state)},self.currentTime=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.currentTime():getCurrentTicks(player)},self.duration=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.duration();if(!player)throw new Error("player cannot be null");var streamInfo=getPlayerData(player).streamInfo;if(streamInfo&&streamInfo.mediaSource&&streamInfo.mediaSource.RunTimeTicks)return streamInfo.mediaSource.RunTimeTicks;var playerDuration=player.duration();return playerDuration&&(playerDuration*=1e4),playerDuration};var currentId=0;self.getSubtitleUrl=function(textStream,serverId){var apiClient=connectionManager.getApiClient(serverId),textStreamUrl=textStream.IsExternalUrl?textStream.DeliveryUrl:apiClient.getUrl(textStream.DeliveryUrl);return textStreamUrl},self.setCurrentPlaylistItem=function(playlistItemId,player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setCurrentPlaylistItem(playlistItemId);for(var newItem,newItemIndex,i=0,length=playlist.length;i=playlist.length)throw new Error("newIndex out of bounds");moveInArray(playlist,oldIndex,newIndex),events.trigger(player,"playlistitemmove",[{playlistItemId:playlistItemId,newIndex:newIndex}])}},self.getCurrentPlaylistIndex=function(i,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getCurrentPlaylistIndex():findPlaylistIndex(currentPlaylistItemId,playlist)},self.getCurrentPlaylistItemId=function(i,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getCurrentPlaylistItemId():currentPlaylistItemId},self.setRepeatMode=function(value,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.setRepeatMode(value):(repeatMode=value,void events.trigger(player,"repeatmodechange"))},self.getRepeatMode=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getRepeatMode():repeatMode},self.nextTrack=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.nextTrack();var newItemInfo=getNextItemInfo(player);if(newItemInfo){console.log("playing next track");var playOptions=Object.assign({},currentPlayOptions,{startPositionTicks:0});playInternal(newItemInfo.item,playOptions,function(){setPlaylistState(newItemInfo.item.PlaylistItemId,newItemInfo.index)})}},self.previousTrack=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.previousTrack();var newIndex=self.getCurrentPlaylistIndex(player)-1;if(newIndex>=0){var newItem=playlist[newIndex];if(newItem){var playOptions=Object.assign({},currentPlayOptions,{startPositionTicks:0});playInternal(newItem,playOptions,function(){setPlaylistState(newItem.PlaylistItemId,newIndex)})}}},self.queue=function(options,player){queue(options,"",player)},self.queueNext=function(options,player){queue(options,"next",player)},events.on(pluginManager,"registered",function(e,plugin){"mediaplayer"===plugin.type&&initMediaPlayer(plugin)}),pluginManager.ofType("mediaplayer").map(initMediaPlayer),window.addEventListener("beforeunload",function(e){var player=currentPlayer;player&&getPlayerData(player).currentProgressInterval&&(playNextAfterEnded=!1,onPlaybackStopped.call(player))}),events.on(serverNotifications,"ServerShuttingDown",function(e,apiClient,data){self.setDefaultPlayerActive()}),events.on(serverNotifications,"ServerRestarting",function(e,apiClient,data){self.setDefaultPlayerActive()})}return new PlaybackManager}); \ No newline at end of file +define(["events","datetime","appSettings","pluginManager","userSettings","globalize","connectionManager","loading","serverNotifications","apphost","fullscreenManager","layoutManager"],function(events,datetime,appSettings,pluginManager,userSettings,globalize,connectionManager,loading,serverNotifications,apphost,fullscreenManager,layoutManager){"use strict";function enableLocalPlaylistManagement(player){return!!player.isLocalPlayer}function bindToFullscreenChange(player){events.on(fullscreenManager,"fullscreenchange",function(){events.trigger(player,"fullscreenchange")})}function triggerPlayerChange(playbackManagerInstance,newPlayer,newTarget,previousPlayer,previousTargetInfo){(newPlayer||previousPlayer)&&(newTarget&&previousTargetInfo&&newTarget.id===previousTargetInfo.id||events.trigger(playbackManagerInstance,"playerchange",[newPlayer,newTarget,previousPlayer]))}function reportPlayback(state,serverId,method,progressEventName){if(serverId){var info=Object.assign({},state.PlayState);info.ItemId=state.NowPlayingItem.Id,progressEventName&&(info.EventName=progressEventName);var apiClient=connectionManager.getApiClient(serverId);apiClient[method](info)}}function PlaybackManager(){function displayPlayerInLocalGroup(player){return player.isLocalPlayer}function getSupportedCommands(player){if(player.isLocalPlayer){var list=["GoHome","GoToSettings","VolumeUp","VolumeDown","Mute","Unmute","ToggleMute","SetVolume","SetAudioStreamIndex","SetSubtitleStreamIndex","SetMaxStreamingBitrate","DisplayContent","GoToSearch","DisplayMessage","SetRepeatMode"];return apphost.supports("fullscreenchange")&&!layoutManager.tv&&list.push("ToggleFullscreen"),player.supports&&(player.supports("PictureInPicture")&&list.push("PictureInPicture"),player.supports("SetBrightness")&&list.push("SetBrightness"),player.supports("SetAspectRatio")&&list.push("SetAspectRatio")),list}throw new Error("player must define supported commands")}function createTarget(player){return{name:player.name,id:player.id,playerName:player.name,playableMediaTypes:["Audio","Video","Game"].map(player.canPlayMediaType),isLocalPlayer:player.isLocalPlayer,supportedCommands:getSupportedCommands(player)}}function getPlayerTargets(player){return player.getTargets?player.getTargets():Promise.resolve([createTarget(player)])}function getCurrentSubtitleStream(player){if(!player)throw new Error("player cannot be null");var index=getPlayerData(player).subtitleStreamIndex;return null==index||index===-1?null:getSubtitleStream(player,index)}function getSubtitleStream(player,index){return self.currentMediaSource(player).MediaStreams.filter(function(s){return"Subtitle"===s.Type&&s.Index===index})[0]}function setCurrentPlayerInternal(player,targetInfo){var previousPlayer=currentPlayer,previousTargetInfo=currentTargetInfo;if(player&&!targetInfo&&player.isLocalPlayer&&(targetInfo=createTarget(player)),player&&!targetInfo)throw new Error("targetInfo cannot be null");currentPairingId=null,currentPlayer=player,currentTargetInfo=targetInfo,targetInfo&&console.log("Active player: "+JSON.stringify(targetInfo)),player&&player.isLocalPlayer&&(lastLocalPlayer=player),previousPlayer&&self.endPlayerUpdates(previousPlayer),player&&self.beginPlayerUpdates(player),triggerPlayerChange(self,player,targetInfo,previousPlayer,previousTargetInfo)}function getAutomaticPlayers(){var player=currentPlayer;return player&&!enableLocalPlaylistManagement(player)?[player]:self.getPlayers().filter(enableLocalPlaylistManagement)}function canPlayerSeek(player){if(!player)throw new Error("player cannot be null");var playerData=getPlayerData(player),currentSrc=(playerData.streamInfo.url||"").toLowerCase();return currentSrc.indexOf(".m3u8")!==-1||"Transcode"!==playerData.streamInfo.playMethod&&player.duration()}function changeStream(player,ticks,params){if(canPlayerSeek(player)&&null==params)return void player.currentTime(parseInt(ticks/1e4));params=params||{};var liveStreamId=getPlayerData(player).streamInfo.liveStreamId,playSessionId=getPlayerData(player).streamInfo.playSessionId,playerData=getPlayerData(player),currentItem=playerData.streamInfo.item;player.getDeviceProfile(currentItem,{isRetry:params.EnableDirectPlay===!1}).then(function(deviceProfile){var audioStreamIndex=null==params.AudioStreamIndex?getPlayerData(player).audioStreamIndex:params.AudioStreamIndex,subtitleStreamIndex=null==params.SubtitleStreamIndex?getPlayerData(player).subtitleStreamIndex:params.SubtitleStreamIndex,currentMediaSource=playerData.streamInfo.mediaSource,apiClient=connectionManager.getApiClient(currentItem.ServerId);ticks&&(ticks=parseInt(ticks));var maxBitrate=params.MaxStreamingBitrate||self.getMaxStreamingBitrate(player);getPlaybackInfo(apiClient,currentItem.Id,deviceProfile,maxBitrate,ticks,currentMediaSource,audioStreamIndex,subtitleStreamIndex,liveStreamId,params.EnableDirectPlay,params.EnableDirectStream,params.AllowVideoStreamCopy,params.AllowAudioStreamCopy).then(function(result){validatePlaybackInfoResult(result)&&(currentMediaSource=result.MediaSources[0],createStreamInfo(apiClient,currentItem.MediaType,currentItem,currentMediaSource,ticks).then(function(streamInfo){return streamInfo.fullscreen=currentPlayOptions.fullscreen,streamInfo.url?(getPlayerData(player).subtitleStreamIndex=subtitleStreamIndex,getPlayerData(player).audioStreamIndex=audioStreamIndex,getPlayerData(player).maxStreamingBitrate=maxBitrate,void changeStreamToUrl(apiClient,player,playSessionId,streamInfo)):(showPlaybackInfoErrorMessage("NoCompatibleStream"),void self.nextTrack())}))})})}function changeStreamToUrl(apiClient,player,playSessionId,streamInfo,newPositionTicks){var playerData=getPlayerData(player);playerData.isChangingStream=!0,"Video"===playerData.MediaType?apiClient.stopActiveEncodings(playSessionId).then(function(){setSrcIntoPlayer(apiClient,player,streamInfo)}):setSrcIntoPlayer(apiClient,player,streamInfo)}function setSrcIntoPlayer(apiClient,player,streamInfo){player.play(streamInfo).then(function(){var playerData=getPlayerData(player);playerData.isChangingStream=!1,playerData.streamInfo=streamInfo,sendProgressUpdate(player,"timeupdate")},function(e){onPlaybackError.call(player,e,{type:"mediadecodeerror"})})}function getPlayerData(player){if(!player)throw new Error("player cannot be null");if(!player.name)throw new Error("player name cannot be null");var state=playerStates[player.name];return state||(playerStates[player.name]={},state=playerStates[player.name]),player}function getCurrentTicks(player){if(!player)throw new Error("player cannot be null");var playerTime=Math.floor(1e4*(player||currentPlayer).currentTime());return playerTime+=getPlayerData(player).streamInfo.transcodingOffsetTicks||0}function getNowPlayingItemForReporting(player,item,mediaSource){var nowPlayingItem=Object.assign({},item);return mediaSource&&(nowPlayingItem.RunTimeTicks=mediaSource.RunTimeTicks),nowPlayingItem.RunTimeTicks=nowPlayingItem.RunTimeTicks||1e4*player.duration(),nowPlayingItem}function translateItemsForPlayback(items,options){var promise,firstItem=items[0],serverId=firstItem.ServerId;return"Program"===firstItem.Type?promise=getItemsForPlayback(serverId,{Ids:firstItem.ChannelId}):"Playlist"===firstItem.Type?promise=getItemsForPlayback(serverId,{ParentId:firstItem.Id}):"MusicArtist"===firstItem.Type?promise=getItemsForPlayback(serverId,{ArtistIds:firstItem.Id,Filters:"IsNotFolder",Recursive:!0,SortBy:"SortName",MediaTypes:"Audio"}):"MusicGenre"===firstItem.Type?promise=getItemsForPlayback(serverId,{Genres:firstItem.Name,Filters:"IsNotFolder",Recursive:!0,SortBy:"SortName",MediaTypes:"Audio"}):firstItem.IsFolder?promise=getItemsForPlayback(serverId,{ParentId:firstItem.Id,Filters:"IsNotFolder",Recursive:!0,SortBy:"SortName",MediaTypes:"Audio,Video"}):"Episode"===firstItem.Type&&1===items.length&&getPlayer(firstItem,options).supportsProgress!==!1&&(promise=new Promise(function(resolve,reject){var apiClient=connectionManager.getApiClient(firstItem.ServerId);apiClient.getCurrentUser().then(function(user){return user.Configuration.EnableNextEpisodeAutoPlay&&firstItem.SeriesId?void apiClient.getEpisodes(firstItem.SeriesId,{IsVirtualUnaired:!1,IsMissing:!1,UserId:apiClient.getCurrentUserId(),Fields:"MediaSources,Chapters"}).then(function(episodesResult){var foundItem=!1;episodesResult.Items=episodesResult.Items.filter(function(e){return!!foundItem||e.Id===firstItem.Id&&(foundItem=!0,!0)}),episodesResult.TotalRecordCount=episodesResult.Items.length,resolve(episodesResult)},reject):void resolve(null)})})),promise?promise.then(function(result){return result?result.Items:items}):Promise.resolve(items)}function enableIntros(item){return"Video"===item.MediaType&&("TvChannel"!==item.Type&&("InProgress"!==item.Status&&isServerItem(item)))}function playWithIntros(items,options,user){var firstItem=items[0];"Video"===firstItem.MediaType;var afterPlayInternal=function(){for(var i=0,length=items.length;i=interceptors.length)return void resolve();var interceptor=interceptors[index];interceptor.intercept(options).then(function(){runNextPrePlay(interceptors,index+1,options,resolve,reject)},reject)}function playAfterBitrateDetect(connectionManager,maxBitrate,item,playOptions,onPlaybackStartedFn){var promise,startPosition=playOptions.startPositionTicks,player=getPlayer(item,playOptions),activePlayer=currentPlayer;return activePlayer?(playNextAfterEnded=!1,promise=onPlaybackChanging(activePlayer,player,item)):promise=Promise.resolve(),isServerItem(item)&&"Game"!==item.MediaType?Promise.all([promise,player.getDeviceProfile(item)]).then(function(responses){var deviceProfile=responses[1],apiClient=connectionManager.getApiClient(item.ServerId);return getPlaybackMediaSource(apiClient,deviceProfile,maxBitrate,item,startPosition).then(function(mediaSource){return createStreamInfo(apiClient,item.MediaType,item,mediaSource,startPosition).then(function(streamInfo){return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,getPlayerData(player).maxStreamingBitrate=maxBitrate,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource)},function(){onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo,mediaSource),setTimeout(function(err){onPlaybackError.call(player,err,{type:"mediadecodeerror"})},100)})})})}):promise.then(function(){var streamInfo=createStreamInfoFromUrlItem(item);return streamInfo.fullscreen=playOptions.fullscreen,getPlayerData(player).isChangingStream=!1,player.play(streamInfo).then(function(){loading.hide(),onPlaybackStartedFn(),onPlaybackStarted(player,playOptions,streamInfo)},function(){self.stop(player)})})}function createStreamInfoFromUrlItem(item){return{url:item.Url||item.Path,playMethod:"DirectPlay",item:item,textTracks:[],mediaType:item.MediaType}}function backdropImageUrl(apiClient,item,options){return options=options||{},options.type=options.type||"Backdrop",options.maxWidth||options.width||options.maxHeight||options.height||(options.quality=100),item.BackdropImageTags&&item.BackdropImageTags.length?(options.tag=item.BackdropImageTags[0],apiClient.getScaledImageUrl(item.Id,options)):item.ParentBackdropImageTags&&item.ParentBackdropImageTags.length?(options.tag=item.ParentBackdropImageTags[0],apiClient.getScaledImageUrl(item.ParentBackdropItemId,options)):null}function getMimeType(type,container){if(container=(container||"").toLowerCase(),"audio"===type){if("opus"===container)return"audio/ogg";if("webma"===container)return"audio/webm";if("m4a"===container)return"audio/mp4"}else if("video"===type){if("mkv"===container)return"video/x-matroska";if("m4v"===container)return"video/mp4";if("mov"===container)return"video/quicktime";if("mpg"===container)return"video/mpeg";if("flv"===container)return"video/x-flv"}return type+"/"+container}function createStreamInfo(apiClient,type,item,mediaSource,startPosition,forceTranscoding){var mediaUrl,contentType,directOptions,transcodingOffsetTicks=0,playerStartPositionTicks=startPosition,liveStreamId=mediaSource.LiveStreamId,playMethod="Transcode",mediaSourceContainer=(mediaSource.Container||"").toLowerCase();if("Video"===type)contentType=getMimeType("video",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding?(mediaUrl=mediaSource.Path,playMethod="DirectPlay"):mediaSource.SupportsDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Videos/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(playerStartPositionTicks=null,contentType=getMimeType("video",mediaSource.TranscodingContainer),mediaUrl.toLowerCase().indexOf("copytimestamps=true")===-1&&(transcodingOffsetTicks=startPosition||0)));else if("Audio"===type)if(contentType=getMimeType("audio",mediaSourceContainer),mediaSource.enableDirectPlay&&!forceTranscoding)mediaUrl=mediaSource.Path,playMethod="DirectPlay";else{var isDirectStream=mediaSource.SupportsDirectStream;isDirectStream&&!forceTranscoding?(directOptions={Static:!0,mediaSourceId:mediaSource.Id,deviceId:apiClient.deviceId(),api_key:apiClient.accessToken()},mediaSource.ETag&&(directOptions.Tag=mediaSource.ETag),mediaSource.LiveStreamId&&(directOptions.LiveStreamId=mediaSource.LiveStreamId),mediaUrl=apiClient.getUrl("Audio/"+item.Id+"/stream."+mediaSourceContainer,directOptions),playMethod="DirectStream"):mediaSource.SupportsTranscoding&&(mediaUrl=apiClient.getUrl(mediaSource.TranscodingUrl),"hls"===mediaSource.TranscodingSubProtocol?contentType="application/x-mpegURL":(transcodingOffsetTicks=startPosition||0,playerStartPositionTicks=null,contentType=getMimeType("audio",mediaSource.TranscodingContainer)))}else"Game"===type&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay");!mediaUrl&&mediaSource.SupportsDirectPlay&&(mediaUrl=mediaSource.Path,playMethod="DirectPlay");var resultInfo={url:mediaUrl,mimeType:contentType,transcodingOffsetTicks:transcodingOffsetTicks,playMethod:playMethod,playerStartPositionTicks:playerStartPositionTicks,item:item,mediaSource:mediaSource,textTracks:getTextTracks(apiClient,mediaSource),tracks:getTextTracks(apiClient,mediaSource),mediaType:type,liveStreamId:liveStreamId,playSessionId:getParam("playSessionId",mediaUrl),title:item.Name},backdropUrl=backdropImageUrl(apiClient,item,{});return backdropUrl&&(resultInfo.backdropUrl=backdropUrl),Promise.resolve(resultInfo)}function getParam(name,url){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function getTextTracks(apiClient,mediaSource){for(var subtitleStreams=mediaSource.MediaStreams.filter(function(s){return"Subtitle"===s.Type}),textStreams=subtitleStreams.filter(function(s){return"External"===s.DeliveryMethod}),tracks=[],i=0,length=textStreams.length;i=playlistLength&&(newIndex=0);break;default:newIndex=self.getCurrentPlaylistIndex(player)+1}if(newIndex<0||newIndex>=playlistLength)return null;var item=playlist[newIndex];return item?{item:item,index:newIndex}:null}function queue(options,mode,player){if(player=player||currentPlayer,!player)return self.play(options);if(!enableLocalPlaylistManagement(player))return"next"===mode?player.queueNext(item):player.queue(item);if(options.items)return translateItemsForPlayback(options.items,options).then(function(items){queueAll(items,mode)});if(!options.serverId)throw new Error("serverId required!");return getItemsForPlayback(options.serverId,{Ids:options.ids.join(",")}).then(function(result){return translateItemsForPlayback(result.Items,options).then(function(items){queueAll(items,mode)})})}function queueAll(items,mode){for(var i=0,length=items.length;idatetime.parseISO8601Date(item.EndDate).getTime()||(new Date).getTime()=supported.length&&(index=0),self.setAspectRatio(supported[index].id,player)}},self.setAspectRatio=function(val,player){player=player||currentPlayer,player&&player.setAspectRatio&&player.setAspectRatio(val)},self.getSupportedAspectRatios=function(player){return player=player||currentPlayer,player&&player.getSupportedAspectRatios?player.getSupportedAspectRatios():[]},self.getAspectRatio=function(player){if(player=player||currentPlayer,player&&player.getAspectRatio)return player.getAspectRatio()};var brightnessOsdLoaded;self.setBrightness=function(val,player){player=player||currentPlayer,player&&(brightnessOsdLoaded||(brightnessOsdLoaded=!0,require(["brightnessOsd"])),player.setBrightness(val))},self.getBrightness=function(player){if(player=player||currentPlayer)return player.getBrightness()},self.setVolume=function(val,player){player=player||currentPlayer,player&&player.setVolume(val)},self.getVolume=function(player){if(player=player||currentPlayer)return player.getVolume()},self.volumeUp=function(player){player=player||currentPlayer,player&&player.volumeUp()},self.volumeDown=function(player){player=player||currentPlayer,player&&player.volumeDown()},self.changeAudioStreamIndex=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.changeAudioStreamIndex()},self.changeSubtitleStreamIndex=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.changeSubtitleStreamIndex()},self.getAudioStreamIndex=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getAudioStreamIndex():getPlayerData(player).audioStreamIndex},self.setAudioStreamIndex=function(index,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.setAudioStreamIndex(index):void("Transcode"!==getPlayerData(player).streamInfo.playMethod&&player.canSetAudioStreamIndex()?(player.setAudioStreamIndex(index),getPlayerData(player).audioStreamIndex=index):(changeStream(player,getCurrentTicks(player),{AudioStreamIndex:index}),getPlayerData(player).audioStreamIndex=index))},self.getMaxStreamingBitrate=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getMaxStreamingBitrate():getPlayerData(player).maxStreamingBitrate||appSettings.maxStreamingBitrate()},self.enableAutomaticBitrateDetection=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.enableAutomaticBitrateDetection():appSettings.enableAutomaticBitrateDetection()},self.setMaxStreamingBitrate=function(options,player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setMaxStreamingBitrate(options);var promise;options.enableAutomaticBitrateDetection?(appSettings.enableAutomaticBitrateDetection(!0),promise=connectionManager.getApiClient(self.currentItem(player).ServerId).detectBitrate(!0)):(appSettings.enableAutomaticBitrateDetection(!1),promise=Promise.resolve(options.maxBitrate)),promise.then(function(bitrate){appSettings.maxStreamingBitrate(bitrate),changeStream(player,getCurrentTicks(player),{MaxStreamingBitrate:bitrate})})},self.isFullscreen=function(player){return player=player||currentPlayer,!player.isLocalPlayer||player.isFullscreen?player.isFullscreen():fullscreenManager.isFullScreen()},self.toggleFullscreen=function(player){return player=player||currentPlayer,!player.isLocalPlayer||player.toggleFulscreen?player.toggleFulscreen():void(fullscreenManager.isFullScreen()?fullscreenManager.exitFullscreen():fullscreenManager.requestFullscreen())},self.togglePictureInPicture=function(player){return player=player||currentPlayer,player.togglePictureInPicture()},self.getSubtitleStreamIndex=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.getSubtitleStreamIndex();if(!player)throw new Error("player cannot be null");return getPlayerData(player).subtitleStreamIndex},self.setSubtitleStreamIndex=function(index,player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setSubtitleStreamIndex(index);var currentStream=getCurrentSubtitleStream(player),newStream=getSubtitleStream(player,index);if(currentStream||newStream){var selectedTrackElementIndex=-1,currentPlayMethod=(getPlayerData(player).streamInfo||{}).playMethod;currentStream&&!newStream?("Encode"===currentStream.DeliveryMethod||"Embed"===currentStream.DeliveryMethod&&"Transcode"===currentPlayMethod)&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1}):!currentStream&&newStream?"External"===newStream.DeliveryMethod?selectedTrackElementIndex=index:"Embed"===newStream.DeliveryMethod&&"Transcode"!==currentPlayMethod?selectedTrackElementIndex=index:changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index}):currentStream&&newStream&&("External"===newStream.DeliveryMethod||"Embed"===newStream.DeliveryMethod&&"Transcode"!==currentPlayMethod?(selectedTrackElementIndex=index,"External"!==currentStream.DeliveryMethod&&"Embed"!==currentStream.DeliveryMethod&&changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:-1})):changeStream(player,getCurrentTicks(player),{SubtitleStreamIndex:index})),player.setSubtitleStreamIndex(selectedTrackElementIndex),getPlayerData(player).subtitleStreamIndex=index}},self.toggleDisplayMirroring=function(){self.enableDisplayMirroring(!self.enableDisplayMirroring())},self.enableDisplayMirroring=function(enabled){if(null!=enabled){var val=enabled?"1":"0";return void appSettings.set("displaymirror",val)}return"0"!==(appSettings.get("displaymirror")||"")},self.stop=function(player){return player=player||currentPlayer,player?(playNextAfterEnded=!1,player.stop(!0,!0)):Promise.resolve()},self.playPause=function(player){if(player=player||currentPlayer)return player.playPause?player.playPause():player.paused()?self.unpause(player):self.pause(player)},self.paused=function(player){if(player=player||currentPlayer)return player.paused()},self.pause=function(player){player=player||currentPlayer,player&&player.pause()},self.unpause=function(player){player=player||currentPlayer,player&&player.unpause()},self.seek=function(ticks,player){return ticks=Math.max(0,ticks),player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.seek(ticks):void changeStream(player,ticks)},self.nextChapter=function(player){player=player||currentPlayer;var item=self.currentItem(player),ticks=getCurrentTicks(player),nextChapter=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks>ticks})[0];nextChapter?self.seek(nextChapter.StartPositionTicks,player):self.nextTrack(player)},self.previousChapter=function(player){player=player||currentPlayer;var item=self.currentItem(player),ticks=getCurrentTicks(player);ticks-=1e8,0===self.getCurrentPlaylistIndex(player)&&(ticks=Math.max(ticks,0));var previousChapters=(item.Chapters||[]).filter(function(i){return i.StartPositionTicks<=ticks});previousChapters.length?self.seek(previousChapters[previousChapters.length-1].StartPositionTicks,player):self.previousTrack(player)},self.fastForward=function(player){if(player=player||currentPlayer,null!=player.fastForward)return void player.fastForward(userSettings.skipForwardLength());var ticks=getCurrentTicks(player);ticks+=1e4*userSettings.skipForwardLength();var runTimeTicks=self.duration(player)||0;ticks0||canPlayerSeek(player)),item&&(state.NowPlayingItem=getNowPlayingItemForReporting(player,item,mediaSource)),state.MediaSource=mediaSource,Promise.resolve(state)},self.currentTime=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.currentTime():getCurrentTicks(player)},self.duration=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.duration();if(!player)throw new Error("player cannot be null");var streamInfo=getPlayerData(player).streamInfo;if(streamInfo&&streamInfo.mediaSource&&streamInfo.mediaSource.RunTimeTicks)return streamInfo.mediaSource.RunTimeTicks;var playerDuration=player.duration();return playerDuration&&(playerDuration*=1e4),playerDuration};var currentId=0;self.getSubtitleUrl=function(textStream,serverId){var apiClient=connectionManager.getApiClient(serverId),textStreamUrl=textStream.IsExternalUrl?textStream.DeliveryUrl:apiClient.getUrl(textStream.DeliveryUrl);return textStreamUrl},self.setCurrentPlaylistItem=function(playlistItemId,player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.setCurrentPlaylistItem(playlistItemId);for(var newItem,newItemIndex,i=0,length=playlist.length;i=playlist.length)throw new Error("newIndex out of bounds");moveInArray(playlist,oldIndex,newIndex),events.trigger(player,"playlistitemmove",[{playlistItemId:playlistItemId,newIndex:newIndex}])}},self.getCurrentPlaylistIndex=function(i,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getCurrentPlaylistIndex():findPlaylistIndex(currentPlaylistItemId,playlist)},self.getCurrentPlaylistItemId=function(i,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getCurrentPlaylistItemId():currentPlaylistItemId},self.setRepeatMode=function(value,player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.setRepeatMode(value):(repeatMode=value,void events.trigger(player,"repeatmodechange"))},self.getRepeatMode=function(player){return player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player)?player.getRepeatMode():repeatMode},self.nextTrack=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.nextTrack();var newItemInfo=getNextItemInfo(player);if(newItemInfo){console.log("playing next track");var playOptions=Object.assign({},currentPlayOptions,{startPositionTicks:0});playInternal(newItemInfo.item,playOptions,function(){setPlaylistState(newItemInfo.item.PlaylistItemId,newItemInfo.index)})}},self.previousTrack=function(player){if(player=player||currentPlayer,player&&!enableLocalPlaylistManagement(player))return player.previousTrack();var newIndex=self.getCurrentPlaylistIndex(player)-1;if(newIndex>=0){var newItem=playlist[newIndex];if(newItem){var playOptions=Object.assign({},currentPlayOptions,{startPositionTicks:0});playInternal(newItem,playOptions,function(){setPlaylistState(newItem.PlaylistItemId,newIndex)})}}},self.queue=function(options,player){queue(options,"",player)},self.queueNext=function(options,player){queue(options,"next",player)},events.on(pluginManager,"registered",function(e,plugin){"mediaplayer"===plugin.type&&initMediaPlayer(plugin)}),pluginManager.ofType("mediaplayer").map(initMediaPlayer),window.addEventListener("beforeunload",function(e){var player=currentPlayer;player&&self.isPlaying(player)&&(playNextAfterEnded=!1,onPlaybackStopped.call(player))}),events.on(serverNotifications,"ServerShuttingDown",function(e,apiClient,data){self.setDefaultPlayerActive()}),events.on(serverNotifications,"ServerRestarting",function(e,apiClient,data){self.setDefaultPlayerActive()})}return PlaybackManager.prototype.sendCommand=function(cmd,player){switch(console.log("MediaController received command: "+cmd.Name),cmd.Name){case"SetRepeatMode":this.setRepeatMode(cmd.Arguments.RepeatMode,player);break;case"VolumeUp":this.volumeUp(player);break;case"VolumeDown":this.volumeDown(player);break;case"Mute":this.setMute(!0,player);break;case"Unmute":this.setMute(!1,player);break;case"ToggleMute":this.toggleMute(player);break;case"SetVolume":this.setVolume(cmd.Arguments.Volume,player);break;case"SetAspectRatio":this.setAspectRatio(cmd.Arguments.AspectRatio,player);break;case"SetBrightness":this.setBrightness(cmd.Arguments.Brightness,player);break;case"SetAudioStreamIndex":this.setAudioStreamIndex(parseInt(cmd.Arguments.Index),player);break;case"SetSubtitleStreamIndex":this.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index),player);break;case"SetMaxStreamingBitrate":break;case"ToggleFullscreen":this.toggleFullscreen(player);break;default:player.sendCommand&&player.sendCommand(cmd)}},new PlaybackManager}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/playlisteditor/playlisteditor.js b/dashboard-ui/bower_components/emby-webcomponents/playlisteditor/playlisteditor.js index 70a35eae2c..6c611dd489 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/playlisteditor/playlisteditor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/playlisteditor/playlisteditor.js @@ -1 +1 @@ -define(["shell","dialogHelper","loading","layoutManager","playbackManager","connectionManager","userSettings","embyRouter","globalize","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,playbackManager,connectionManager,userSettings,embyRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onSubmit(e){var panel=parentWithClass(this,"dialog"),playlistId=panel.querySelector("#selectPlaylistToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return playlistId?(userSettings.set("playlisteditor-lastplaylistid",playlistId),addToPlaylist(apiClient,panel,playlistId)):createPlaylist(apiClient,panel),e.preventDefault(),!1}function createPlaylist(apiClient,dlg){loading.show();var url=apiClient.getUrl("Playlists",{Name:dlg.querySelector("#txtNewPlaylistName").value,Ids:dlg.querySelector(".fldSelectedItemIds").value||"",userId:apiClient.getCurrentUserId()});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dialogHelper.close(dlg),redirectToPlaylist(apiClient,id)})}function redirectToPlaylist(apiClient,id){apiClient.getItem(apiClient.getCurrentUserId(),id).then(function(item){embyRouter.showItem(item)})}function addToPlaylist(apiClient,dlg,id){var itemIds=dlg.querySelector(".fldSelectedItemIds").value||"";if("queue"===id)return playbackManager.queue({serverId:apiClient.serverId(),ids:itemIds.split(",")}),void dialogHelper.close(dlg);loading.show();var url=apiClient.getUrl("Playlists/"+id+"/Items",{Ids:itemIds,userId:apiClient.getCurrentUserId()});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dialogHelper.close(dlg)})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populatePlaylists(editorOptions,panel){var select=panel.querySelector("#selectPlaylistToAddTo");loading.hide(),panel.querySelector(".newPlaylistInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"Playlist",SortBy:"SortName"},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";editorOptions.enableAddToPlayQueue!==!1&&playbackManager.isPlaying()&&(html+='"),html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html;var defaultValue=editorOptions.defaultValue;defaultValue||(defaultValue=userSettings.get("playlisteditor-lastplaylistid")||""),select.value="new"===defaultValue?"":defaultValue,select.value||(select.value=""),triggerChange(select),loading.hide()})}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+='
',html+='',html+="
",html+='
',html+='
',html+='',html+="
",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,options,items){if(content.querySelector("#selectPlaylistToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newPlaylistInfo").classList.add("hide"),content.querySelector("#txtNewPlaylistName").removeAttribute("required")):(content.querySelector(".newPlaylistInfo").classList.remove("hide"),content.querySelector("#txtNewPlaylistName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectPlaylist").classList.remove("hide"),populatePlaylists(options,content);else{content.querySelector(".fldSelectPlaylist").classList.add("hide");var selectPlaylistToAddTo=content.querySelector("#selectPlaylistToAddTo");selectPlaylistToAddTo.innerHTML="",selectPlaylistToAddTo.value="",triggerChange(selectPlaylistToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function playlisteditor(){var self=this;self.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#HeaderAddToPlaylist");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,options,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),new Promise(function(resolve,reject){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})}}var currentServerId;return playlisteditor}); \ No newline at end of file +define(["shell","dialogHelper","loading","layoutManager","playbackManager","connectionManager","userSettings","embyRouter","globalize","emby-input","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,playbackManager,connectionManager,userSettings,embyRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onSubmit(e){var panel=parentWithClass(this,"dialog"),playlistId=panel.querySelector("#selectPlaylistToAddTo").value,apiClient=connectionManager.getApiClient(currentServerId);return playlistId?(userSettings.set("playlisteditor-lastplaylistid",playlistId),addToPlaylist(apiClient,panel,playlistId)):createPlaylist(apiClient,panel),e.preventDefault(),!1}function createPlaylist(apiClient,dlg){loading.show();var url=apiClient.getUrl("Playlists",{Name:dlg.querySelector("#txtNewPlaylistName").value,Ids:dlg.querySelector(".fldSelectedItemIds").value||"",userId:apiClient.getCurrentUserId()});apiClient.ajax({type:"POST",url:url,dataType:"json"}).then(function(result){loading.hide();var id=result.Id;dlg.submitted=!0,dialogHelper.close(dlg),redirectToPlaylist(apiClient,id)})}function redirectToPlaylist(apiClient,id){apiClient.getItem(apiClient.getCurrentUserId(),id).then(function(item){embyRouter.showItem(item)})}function addToPlaylist(apiClient,dlg,id){var itemIds=dlg.querySelector(".fldSelectedItemIds").value||"";if("queue"===id)return playbackManager.queue({serverId:apiClient.serverId(),ids:itemIds.split(",")}),dlg.submitted=!0,void dialogHelper.close(dlg);loading.show();var url=apiClient.getUrl("Playlists/"+id+"/Items",{Ids:itemIds,userId:apiClient.getCurrentUserId()});apiClient.ajax({type:"POST",url:url}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg)})}function triggerChange(select){select.dispatchEvent(new CustomEvent("change",{}))}function populatePlaylists(editorOptions,panel){var select=panel.querySelector("#selectPlaylistToAddTo");loading.hide(),panel.querySelector(".newPlaylistInfo").classList.add("hide");var options={Recursive:!0,IncludeItemTypes:"Playlist",SortBy:"SortName"},apiClient=connectionManager.getApiClient(currentServerId);apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html="";editorOptions.enableAddToPlayQueue!==!1&&playbackManager.isPlaying()&&(html+='"),html+='",html+=result.Items.map(function(i){return'"}),select.innerHTML=html;var defaultValue=editorOptions.defaultValue;defaultValue||(defaultValue=userSettings.get("playlisteditor-lastplaylistid")||""),select.value="new"===defaultValue?"":defaultValue,select.value||(select.value=""),triggerChange(select),loading.hide()})}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+='
',html+='',html+="
",html+='
',html+='
',html+='',html+="
",html+="
",html+='
',html+='",html+="
",html+='',html+="
",html+="
",html+="
"}function initEditor(content,options,items){if(content.querySelector("#selectPlaylistToAddTo").addEventListener("change",function(){this.value?(content.querySelector(".newPlaylistInfo").classList.add("hide"),content.querySelector("#txtNewPlaylistName").removeAttribute("required")):(content.querySelector(".newPlaylistInfo").classList.remove("hide"),content.querySelector("#txtNewPlaylistName").setAttribute("required","required"))}),content.querySelector("form").addEventListener("submit",onSubmit),content.querySelector(".fldSelectedItemIds",content).value=items.join(","),items.length)content.querySelector(".fldSelectPlaylist").classList.remove("hide"),populatePlaylists(options,content);else{content.querySelector(".fldSelectPlaylist").classList.add("hide");var selectPlaylistToAddTo=content.querySelector("#selectPlaylistToAddTo");selectPlaylistToAddTo.innerHTML="",selectPlaylistToAddTo.value="",triggerChange(selectPlaylistToAddTo)}}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function PlaylistEditor(){}var currentServerId;return PlaylistEditor.prototype.show=function(options){var items=options.items||{};currentServerId=options.serverId;var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#HeaderAddToPlaylist");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,options,items),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dialogHelper.open(dlg).then(function(){return layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.submitted?Promise.resolve():Promise.reject()})},PlaylistEditor}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js b/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js index b3790edf28..8160baeaa7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js @@ -1 +1 @@ -define(["events"],function(events){"use strict";function pluginManager(){function loadStrings(plugin,globalize){var strings=plugin.getTranslations?plugin.getTranslations():[];return globalize.loadStrings({name:plugin.id||plugin.packageName,strings:strings})}function definePluginRoute(route,plugin){route.contentPath=self.mapPath(plugin,route.path),route.path=self.mapRoute(plugin,route),Emby.App.defineRoute(route,plugin.id)}var self=this,plugins=[];self.register=function(obj){plugins.push(obj),events.trigger(self,"registered",[obj])},self.ofType=function(type){return plugins.filter(function(o){return o.type===type})},self.plugins=function(){return plugins},self.mapRoute=function(plugin,route){return"string"==typeof plugin&&(plugin=plugins.filter(function(p){return(p.id||p.packageName)===plugin})[0]),route=route.path||route,0===route.toLowerCase().indexOf("http")?route:"/plugins/"+plugin.id+"/"+route};var cacheParam=(new Date).getTime();self.mapPath=function(plugin,path,addCacheParam){"string"==typeof plugin&&(plugin=plugins.filter(function(p){return(p.id||p.packageName)===plugin})[0]);var url=plugin.baseUrl+"/"+path;return addCacheParam&&(url+=url.indexOf("?")===-1?"?":"&",url+="v="+cacheParam),url},self.loadPlugin=function(url){return console.log("Loading plugin: "+url),new Promise(function(resolve,reject){require([url,"globalize","embyRouter"],function(pluginFactory,globalize,embyRouter){var plugin=new pluginFactory,existing=plugins.filter(function(p){return p.id===plugin.id})[0];if(existing)return void resolve(url);plugin.installUrl=url;var urlLower=url.toLowerCase();urlLower.indexOf("http:")===-1&&urlLower.indexOf("https:")===-1&&urlLower.indexOf("file:")===-1&&0!==url.indexOf(embyRouter.baseUrl())&&(url=embyRouter.baseUrl()+"/"+url);var separatorIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));plugin.baseUrl=url.substring(0,separatorIndex);var paths={};paths[plugin.id]=plugin.baseUrl,requirejs.config({waitSeconds:0,paths:paths}),self.register(plugin),plugin.getRoutes&&plugin.getRoutes().forEach(function(route){definePluginRoute(route,plugin)}),"skin"===plugin.type?resolve(plugin):loadStrings(plugin,globalize).then(function(){resolve(plugin)},reject)})})}}var instance=new pluginManager;return window.Emby=window.Emby||{},window.Emby.PluginManager=instance,instance}); \ No newline at end of file +define(["events"],function(events){"use strict";function loadStrings(plugin,globalize){var strings=plugin.getTranslations?plugin.getTranslations():[];return globalize.loadStrings({name:plugin.id||plugin.packageName,strings:strings})}function definePluginRoute(pluginManager,route,plugin){route.contentPath=pluginManager.mapPath(plugin,route.path),route.path=pluginManager.mapRoute(plugin,route),Emby.App.defineRoute(route,plugin.id)}function PluginManager(){this.pluginsList=[]}var cacheParam=(new Date).getTime();PluginManager.prototype.loadPlugin=function(url){console.log("Loading plugin: "+url);var instance=this;return new Promise(function(resolve,reject){require([url,"globalize","embyRouter"],function(pluginFactory,globalize,embyRouter){var plugin=new pluginFactory,existing=instance.pluginsList.filter(function(p){return p.id===plugin.id})[0];if(existing)return void resolve(url);plugin.installUrl=url;var urlLower=url.toLowerCase();urlLower.indexOf("http:")===-1&&urlLower.indexOf("https:")===-1&&urlLower.indexOf("file:")===-1&&0!==url.indexOf(embyRouter.baseUrl())&&(url=embyRouter.baseUrl()+"/"+url);var separatorIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));plugin.baseUrl=url.substring(0,separatorIndex);var paths={};paths[plugin.id]=plugin.baseUrl,requirejs.config({waitSeconds:0,paths:paths}),instance.register(plugin),plugin.getRoutes&&plugin.getRoutes().forEach(function(route){definePluginRoute(instance,route,plugin)}),"skin"===plugin.type?resolve(plugin):loadStrings(plugin,globalize).then(function(){resolve(plugin)},reject)})})},PluginManager.prototype.register=function(obj){this.pluginsList.push(obj),events.trigger(this,"registered",[obj])},PluginManager.prototype.ofType=function(type){return this.pluginsList.filter(function(o){return o.type===type})},PluginManager.prototype.plugins=function(){return this.pluginsList},PluginManager.prototype.mapRoute=function(plugin,route){return"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]),route=route.path||route,0===route.toLowerCase().indexOf("http")?route:"/plugins/"+plugin.id+"/"+route},PluginManager.prototype.mapPath=function(plugin,path,addCacheParam){"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]);var url=plugin.baseUrl+"/"+path;return addCacheParam&&(url+=url.indexOf("?")===-1?"?":"&",url+="v="+cacheParam),url};var instance=new PluginManager;return window.Emby=window.Emby||{},window.Emby.PluginManager=instance,instance}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.css b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.css index 60df7cfa96..99ce13e870 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.css +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.css @@ -1 +1 @@ -.recordingButton{margin-left:0;min-width:10em}.recordingIcon{font-size:1.3em!important}.recordingIcon-active{color:#c33}.manageButtonText{text-transform:none}.recordSeriesContainer{margin-bottom:.8em}.recordingFields-buttons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}@media all and (max-width:440px){.manageButtonText{display:none!important}.recordingButton{width:auto;margin-right:1.5em!important}}@media all and (min-width:440px){.manageButtonIcon{font-size:90%!important}} \ No newline at end of file +.recordingButton{margin-left:0;min-width:10em}.recordingIcon{font-size:1.3em!important}.recordingIcon-active{color:#c33}.recordSeriesContainer{margin-bottom:.8em}.recordingFields-buttons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html index a4c616f17a..d82f61b23b 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html @@ -23,7 +23,6 @@
@@ -36,7 +35,6 @@ diff --git a/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js b/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js index bc1c4e45db..d33088e076 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js +++ b/dashboard-ui/bower_components/emby-webcomponents/refreshdialog/refreshdialog.js @@ -1 +1 @@ -define(["shell","dialogHelper","loading","layoutManager","connectionManager","embyRouter","globalize","emby-input","emby-checkbox","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,connectionManager,embyRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+='
',html+='",html+="
",html+='",html+='
',html+=globalize.translate("sharedcomponents#RefreshDialogHelp"),html+="
",html+='',html+="
",html+='
',html+='",html+="
",html+="
",html+="
",html+="
"}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}return function(options){function onSubmit(e){loading.show();var dlg=parentWithClass(this,"dialog"),apiClient=connectionManager.getApiClient(options.serverId),replaceAllImages=dlg.querySelector(".chkReplaceImages").checked,replaceAllMetadata="all"===dlg.querySelector("#selectMetadataRefreshMode").value;return options.itemIds.forEach(function(itemId){apiClient.refreshItem(itemId,{Recursive:!0,ImageRefreshMode:"FullRefresh",MetadataRefreshMode:"FullRefresh",ReplaceAllImages:replaceAllImages,ReplaceAllMetadata:replaceAllMetadata})}),dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#RefreshQueued"))}),loading.hide(),e.preventDefault(),!1}function initEditor(content,items){content.querySelector("form").addEventListener("submit",onSubmit)}var self=this;self.show=function(){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#RefreshMetadata");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),new Promise(function(resolve,reject){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})}}}); \ No newline at end of file +define(["shell","dialogHelper","loading","layoutManager","connectionManager","embyRouter","globalize","emby-input","emby-checkbox","paper-icon-button-light","emby-select","material-icons","css!./../formdialog","emby-button"],function(shell,dialogHelper,loading,layoutManager,connectionManager,embyRouter,globalize){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function getEditorHtml(){var html="";return html+='
',html+='
',html+='
',html+='
',html+='",html+="
",html+='",html+='
',html+=globalize.translate("sharedcomponents#RefreshDialogHelp"),html+="
",html+='',html+="
",html+='
',html+='",html+="
",html+="
",html+="
",html+="
"}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function onSubmit(e){loading.show();var instance=this,dlg=parentWithClass(e.target,"dialog"),options=instance.options,apiClient=connectionManager.getApiClient(options.serverId),replaceAllImages=dlg.querySelector(".chkReplaceImages").checked,replaceAllMetadata="all"===dlg.querySelector("#selectMetadataRefreshMode").value;return options.itemIds.forEach(function(itemId){apiClient.refreshItem(itemId,{Recursive:!0,ImageRefreshMode:"FullRefresh",MetadataRefreshMode:"FullRefresh",ReplaceAllImages:replaceAllImages,ReplaceAllMetadata:replaceAllMetadata})}),dialogHelper.close(dlg),require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#RefreshQueued"))}),loading.hide(),e.preventDefault(),!1}function RefreshDialog(options){this.options=options}return RefreshDialog.prototype.show=function(){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="",title=globalize.translate("sharedcomponents#RefreshMetadata");return html+='
',html+='',html+='

',html+=title,html+="

",html+="
",html+=getEditorHtml(),dlg.innerHTML=html,dlg.querySelector("form").addEventListener("submit",onSubmit.bind(this)),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),new Promise(function(resolve,reject){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1),dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})},RefreshDialog}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js b/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js index ece7421398..fce53e3c92 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js +++ b/dashboard-ui/bower_components/emby-webcomponents/registrationservices/registrationservices.js @@ -1 +1 @@ -define(["appSettings","loading","apphost","iapManager","events","shell","globalize","dialogHelper","connectionManager","layoutManager","emby-button"],function(appSettings,loading,appHost,iapManager,events,shell,globalize,dialogHelper,connectionManager,layoutManager){"use strict";function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,reject)})})}function showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions){return new Promise(function(resolve,reject){require(["listViewStyle","formDialogStyle"],function(){showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject),currentDisplayingResolve=resolve})})}function showPeriodicMessage(feature,settingsKey){return new Promise(function(resolve,reject){require(["listViewStyle","emby-button","formDialogStyle"],function(){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
',html+='',html+='

Emby Premiere',html+="

",html+="
",html+='
',html+='
',html+="

"+globalize.translate("sharedcomponents#HeaderDiscoverEmbyPremiere")+"

",html+="

"+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode")+"

",html+="

"+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode2")+"

",html+='

'+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

",html+='
',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
",html+="
",html+='
',html+='";var seconds=11;html+='
'+globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)+"
",html+='",html+="
",html+="
",html+="
",dlg.innerHTML=html;var i,length,isRejected=!0,timeTextInterval=setInterval(function(){seconds-=1,seconds<=0?(dlg.querySelector(".continueTimeText").classList.add("hide"),dlg.querySelector(".btnContinue").classList.remove("hide")):dlg.querySelector(".continueTimeText").innerHTML=globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)},1e3),btnPurchases=dlg.querySelectorAll(".buttonPremiereInfo");for(i=0,length=btnPurchases.length;iintervalMs?connectionManager.currentApiClient().getPluginSecurityInfo().then(function(regInfo){return regInfo.IsMBSupporter?(appSettings.set(settingsKey,(new Date).getTime()),Promise.resolve()):showPeriodicMessage(feature,settingsKey)},function(){return showPeriodicMessage(feature,settingsKey)}):Promise.resolve():(appSettings.set(settingsKey,(new Date).getTime()),Promise.resolve())}function validateFeature(feature,options){return options=options||{},console.log("validateFeature: "+feature),iapManager.isUnlockedByDefault(feature,options).then(function(){return showPeriodicMessageIfNeeded(feature)},function(){var unlockableFeatureCacheKey="featurepurchased-"+feature;if("1"===appSettings.get(unlockableFeatureCacheKey))return showPeriodicMessageIfNeeded(feature);var unlockableProduct=iapManager.getProductInfo(feature);if(unlockableProduct){var unlockableCacheKey="productpurchased-"+unlockableProduct.id;if(unlockableProduct.owned)return appSettings.set(unlockableFeatureCacheKey,"1"),appSettings.set(unlockableCacheKey,"1"),showPeriodicMessageIfNeeded(feature);if("1"===appSettings.get(unlockableCacheKey))return showPeriodicMessageIfNeeded(feature)}var unlockableProductInfo=unlockableProduct?{enableAppUnlock:!0,id:unlockableProduct.id,price:unlockableProduct.price,feature:feature}:null;return iapManager.getSubscriptionOptions().then(function(subscriptionOptions){return subscriptionOptions.filter(function(p){return p.owned}).length>0?Promise.resolve():connectionManager.getRegistrationInfo(iapManager.getAdminFeatureName(feature),connectionManager.currentApiClient()).catch(function(){var dialogOptions={title:globalize.translate("sharedcomponents#HeaderUnlockFeature"),feature:feature};return options.showDialog===!1?Promise.reject():showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions)})})})}function cancelInAppPurchase(){var elem=document.querySelector(".inAppPurchaseOverlay");elem&&dialogHelper.close(elem)}function clearCurrentDisplayingInfo(){currentDisplayingProductInfos=[],currentDisplayingResolve=null}function showExternalPremiereInfo(){shell.openUrl("https://emby.media/premiere")}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject){function onCloseButtonClick(){rejected=!0,dialogHelper.close(dlg)}cancelInAppPurchase(),currentDisplayingProductInfos=subscriptionOptions.slice(0),unlockableProductInfo&¤tDisplayingProductInfos.push(unlockableProductInfo);var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
',html+='',html+='

',html+=dialogOptions.title||"",html+="

",html+="
",html+='
',html+='
',html+='
',html+='

',html+=unlockableProductInfo?globalize.translate("sharedcomponents#MessageUnlockAppWithPurchaseOrSupporter"):globalize.translate("sharedcomponents#MessageUnlockAppWithSupporter"),html+="

",html+='

',html+=globalize.translate("sharedcomponents#MessageToValidateSupporter"),html+="

";var i,length,hasProduct=!1;for(i=0,length=subscriptionOptions.length;i",html+='",html+="

";if(unlockableProductInfo){hasProduct=!0;var unlockText=globalize.translate("sharedcomponents#ButtonUnlockWithPurchase");unlockableProductInfo.price&&(unlockText=globalize.translate("sharedcomponents#ButtonUnlockPrice",unlockableProductInfo.price)),html+="

",html+='",html+="

"}html+="

",html+='",html+="

",subscriptionOptions.length&&(html+='

'+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

",html+='
',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
"),"playback"===dialogOptions.feature&&(html+="

",html+='",html+="

"),html+="",html+="
",html+="
",dlg.innerHTML=html,document.body.appendChild(dlg);var btnPurchases=dlg.querySelectorAll(".btnPurchase");for(i=0,length=btnPurchases.length;i'):html+='
',html+=''+item.icon+"",html+='
',html+='

',html+=item.name,html+="

",html+='
',html+=item.text,html+="
",html+="
",html+=enableLink?"":"
"}function onPurchaseButtonClick(){var featureId=this.getAttribute("data-featureid");"true"===this.getAttribute("data-email")?getUserEmail().then(function(email){iapManager.beginPurchase(featureId,email)}):iapManager.beginPurchase(featureId)}function restorePurchase(unlockableProductInfo){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
',html+='',html+='

',html+=iapManager.getRestoreButtonText(),html+="

",html+="
",html+='
',html+='
',html+='

',html+=globalize.translate("sharedcomponents#HowDidYouPay"),html+="

",html+="

",html+='",html+="

",unlockableProductInfo&&(html+="

",html+='",html+="

"),html+="
",html+="
",dlg.innerHTML=html,document.body.appendChild(dlg),loading.hide(),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),dlg.querySelector(".btnRestoreSub").addEventListener("click",function(){dialogHelper.close(dlg),alertText({text:globalize.translate("sharedcomponents#MessageToValidateSupporter"),title:"Emby Premiere"})});var btnRestoreUnlock=dlg.querySelector(".btnRestoreUnlock");btnRestoreUnlock&&btnRestoreUnlock.addEventListener("click",function(){dialogHelper.close(dlg),iapManager.restorePurchase()}),dialogHelper.open(dlg).then(function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1)})}function getUserEmail(){if(connectionManager.isLoggedIntoConnect()){var connectUser=connectionManager.connectUser();if(connectUser&&connectUser.Email)return Promise.resolve(connectUser.Email)}return new Promise(function(resolve,reject){require(["prompt"],function(prompt){prompt({label:globalize.translate("sharedcomponents#LabelEmailAddress")}).then(resolve,reject)})})}function onProductUpdated(e,product){if(product.owned){var resolve=currentDisplayingResolve;resolve&¤tDisplayingProductInfos.filter(function(p){return product.id===p.id}).length&&(cancelInAppPurchase(),resolve())}}function showPremiereInfo(){return appHost.supports("externalpremium")?(showExternalPremiereInfo(),Promise.resolve()):iapManager.getSubscriptionOptions().then(function(subscriptionOptions){var dialogOptions={title:"Emby Premiere",feature:"sync"};return showInAppPurchaseInfo(subscriptionOptions,null,dialogOptions)})}var currentDisplayingProductInfos=[],currentDisplayingResolve=null;return events.on(iapManager,"productupdated",onProductUpdated),{validateFeature:validateFeature,showPremiereInfo:showPremiereInfo}}); \ No newline at end of file +define(["appSettings","loading","apphost","iapManager","events","shell","globalize","dialogHelper","connectionManager","layoutManager","emby-button","emby-linkbutton"],function(appSettings,loading,appHost,iapManager,events,shell,globalize,dialogHelper,connectionManager,layoutManager){"use strict";function alertText(options){return new Promise(function(resolve,reject){require(["alert"],function(alert){alert(options).then(resolve,reject)})})}function showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions){return new Promise(function(resolve,reject){require(["listViewStyle","formDialogStyle"],function(){showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject),currentDisplayingResolve=resolve})})}function showPeriodicMessage(feature,settingsKey){return new Promise(function(resolve,reject){require(["listViewStyle","emby-button","formDialogStyle"],function(){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
',html+='',html+='

Emby Premiere',html+="

",html+="
",html+='
',html+='
',html+="

"+globalize.translate("sharedcomponents#HeaderDiscoverEmbyPremiere")+"

",html+="

"+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode")+"

",html+="

"+globalize.translate("sharedcomponents#MessageDidYouKnowCinemaMode2")+"

",html+='

'+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

",html+='
',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
",html+="
",html+='
',html+='";var seconds=11;html+='
'+globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)+"
",html+='",html+="
",html+="
",html+="
",dlg.innerHTML=html;var i,length,isRejected=!0,timeTextInterval=setInterval(function(){seconds-=1,seconds<=0?(dlg.querySelector(".continueTimeText").classList.add("hide"),dlg.querySelector(".btnContinue").classList.remove("hide")):dlg.querySelector(".continueTimeText").innerHTML=globalize.translate("sharedcomponents#ContinueInSecondsValue",seconds)},1e3),btnPurchases=dlg.querySelectorAll(".buttonPremiereInfo");for(i=0,length=btnPurchases.length;iintervalMs?connectionManager.currentApiClient().getPluginSecurityInfo().then(function(regInfo){return regInfo.IsMBSupporter?(appSettings.set(settingsKey,(new Date).getTime()),Promise.resolve()):showPeriodicMessage(feature,settingsKey)},function(){return showPeriodicMessage(feature,settingsKey)}):Promise.resolve():(appSettings.set(settingsKey,(new Date).getTime()),Promise.resolve())}function validateFeature(feature,options){return options=options||{},console.log("validateFeature: "+feature),iapManager.isUnlockedByDefault(feature,options).then(function(){return showPeriodicMessageIfNeeded(feature)},function(){var unlockableFeatureCacheKey="featurepurchased-"+feature;if("1"===appSettings.get(unlockableFeatureCacheKey))return showPeriodicMessageIfNeeded(feature);var unlockableProduct=iapManager.getProductInfo(feature);if(unlockableProduct){var unlockableCacheKey="productpurchased-"+unlockableProduct.id;if(unlockableProduct.owned)return appSettings.set(unlockableFeatureCacheKey,"1"),appSettings.set(unlockableCacheKey,"1"),showPeriodicMessageIfNeeded(feature);if("1"===appSettings.get(unlockableCacheKey))return showPeriodicMessageIfNeeded(feature)}var unlockableProductInfo=unlockableProduct?{enableAppUnlock:!0,id:unlockableProduct.id,price:unlockableProduct.price,feature:feature}:null;return iapManager.getSubscriptionOptions().then(function(subscriptionOptions){return subscriptionOptions.filter(function(p){return p.owned}).length>0?Promise.resolve():connectionManager.getRegistrationInfo(iapManager.getAdminFeatureName(feature),connectionManager.currentApiClient()).catch(function(){var dialogOptions={title:globalize.translate("sharedcomponents#HeaderUnlockFeature"),feature:feature};return options.showDialog===!1?Promise.reject():showInAppPurchaseInfo(subscriptionOptions,unlockableProductInfo,dialogOptions)})})})}function cancelInAppPurchase(){var elem=document.querySelector(".inAppPurchaseOverlay");elem&&dialogHelper.close(elem)}function clearCurrentDisplayingInfo(){currentDisplayingProductInfos=[],currentDisplayingResolve=null}function showExternalPremiereInfo(){shell.openUrl("https://emby.media/premiere")}function centerFocus(elem,horiz,on){require(["scrollHelper"],function(scrollHelper){var fn=on?"on":"off";scrollHelper.centerFocus[fn](elem,horiz)})}function getPurchaseTermHtml(term){return"
  • "+term+"
  • "}function getTermsOfPurchaseHtml(){var html="",termsOfPurchase=iapManager.getTermsOfPurchase?iapManager.getTermsOfPurchase():[];return termsOfPurchase.length?(html+="

    "+globalize.translate("sharedcomponents#HeaderTermsOfPurchase")+"

    ",termsOfPurchase.push(''+globalize.translate("sharedcomponents#PrivacyPolicy")+""),termsOfPurchase.push(''+globalize.translate("sharedcomponents#TermsOfUse")+""),html+="
      ",html+=termsOfPurchase.map(getPurchaseTermHtml).join(""),html+="
    "):html}function showInAppPurchaseElement(subscriptionOptions,unlockableProductInfo,dialogOptions,resolve,reject){function onCloseButtonClick(){rejected=!0,dialogHelper.close(dlg)}cancelInAppPurchase(),currentDisplayingProductInfos=subscriptionOptions.slice(0),unlockableProductInfo&¤tDisplayingProductInfos.push(unlockableProductInfo);var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=dialogOptions.title||"",html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='

    ',html+=unlockableProductInfo?globalize.translate("sharedcomponents#MessageUnlockAppWithPurchaseOrSupporter"):globalize.translate("sharedcomponents#MessageUnlockAppWithSupporter"),html+="

    ",html+='

    ',html+=globalize.translate("sharedcomponents#MessageToValidateSupporter"),html+="

    ";var i,length,hasProduct=!1;for(i=0,length=subscriptionOptions.length;i",html+='",html+="

    ";if(unlockableProductInfo){hasProduct=!0;var unlockText=globalize.translate("sharedcomponents#ButtonUnlockWithPurchase");unlockableProductInfo.price&&(unlockText=globalize.translate("sharedcomponents#ButtonUnlockPrice",unlockableProductInfo.price)),html+="

    ",html+='",html+="

    "}html+="

    ",html+='",html+="

    ",subscriptionOptions.length&&(html+='

    '+globalize.translate("sharedcomponents#HeaderBenefitsEmbyPremiere")+"

    ",html+='
    ',html+=getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(""),html+="
    "),"playback"===dialogOptions.feature&&(html+="

    ",html+='",html+="

    "),html+=getTermsOfPurchaseHtml(),html+="",html+="
    ",html+="
    ",dlg.innerHTML=html,document.body.appendChild(dlg);var btnPurchases=dlg.querySelectorAll(".btnPurchase");for(i=0,length=btnPurchases.length;i'):html+='
    ',html+=''+item.icon+"",html+='
    ',html+='

    ',html+=item.name,html+="

    ",html+='
    ',html+=item.text,html+="
    ",html+="
    ",html+=enableLink?"":"
    "}function onPurchaseButtonClick(){var featureId=this.getAttribute("data-featureid");"true"===this.getAttribute("data-email")?getUserEmail().then(function(email){iapManager.beginPurchase(featureId,email)}):iapManager.beginPurchase(featureId)}function restorePurchase(unlockableProductInfo){var dlg=dialogHelper.createDialog({size:layoutManager.tv?"fullscreen":"fullscreen-border",removeOnClose:!0,scrollY:!1});dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=iapManager.getRestoreButtonText(),html+="

    ",html+="
    ",html+='
    ',html+='
    ',html+='

    ',html+=globalize.translate("sharedcomponents#HowDidYouPay"),html+="

    ",html+="

    ",html+='",html+="

    ",unlockableProductInfo&&(html+="

    ",html+='",html+="

    "),html+="
    ",html+="
    ",dlg.innerHTML=html,document.body.appendChild(dlg),loading.hide(),layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!0),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),dlg.querySelector(".btnRestoreSub").addEventListener("click",function(){dialogHelper.close(dlg),alertText({text:globalize.translate("sharedcomponents#MessageToValidateSupporter"),title:"Emby Premiere"})});var btnRestoreUnlock=dlg.querySelector(".btnRestoreUnlock");btnRestoreUnlock&&btnRestoreUnlock.addEventListener("click",function(){dialogHelper.close(dlg),iapManager.restorePurchase()}),dialogHelper.open(dlg).then(function(){layoutManager.tv&¢erFocus(dlg.querySelector(".formDialogContent"),!1,!1)})}function getUserEmail(){if(connectionManager.isLoggedIntoConnect()){var connectUser=connectionManager.connectUser();if(connectUser&&connectUser.Email)return Promise.resolve(connectUser.Email)}return new Promise(function(resolve,reject){require(["prompt"],function(prompt){prompt({label:globalize.translate("sharedcomponents#LabelEmailAddress")}).then(resolve,reject)})})}function onProductUpdated(e,product){if(product.owned){var resolve=currentDisplayingResolve;resolve&¤tDisplayingProductInfos.filter(function(p){return product.id===p.id}).length&&(cancelInAppPurchase(),resolve())}}function showPremiereInfo(){return appHost.supports("externalpremium")?(showExternalPremiereInfo(),Promise.resolve()):iapManager.getSubscriptionOptions().then(function(subscriptionOptions){var dialogOptions={title:"Emby Premiere",feature:"sync"};return showInAppPurchaseInfo(subscriptionOptions,null,dialogOptions)})}var currentDisplayingProductInfos=[],currentDisplayingResolve=null;return events.on(iapManager,"productupdated",onProductUpdated),{validateFeature:validateFeature,showPremiereInfo:showPremiereInfo}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/router.js b/dashboard-ui/bower_components/emby-webcomponents/router.js index bf971a1f11..08f4abea80 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/router.js +++ b/dashboard-ui/bower_components/emby-webcomponents/router.js @@ -1 +1 @@ -define(["loading","viewManager","skinManager","pluginManager","backdrop","browser","pageJs","appSettings","apphost","connectionManager"],function(loading,viewManager,skinManager,pluginManager,backdrop,browser,page,appSettings,appHost,connectionManager){"use strict";function beginConnectionWizard(){backdrop.clear(),loading.show(),connectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(result,loading)})}function handleConnectionResult(result,loading){switch(result.State){case MediaBrowser.ConnectionState.SignedIn:loading.hide(),skinManager.loadUserSkin();break;case MediaBrowser.ConnectionState.ServerSignIn:result.ApiClient.getPublicUsers().then(function(users){users.length?embyRouter.showLocalLogin(result.ApiClient,result.Servers[0].Id):embyRouter.showLocalLogin(result.ApiClient,result.Servers[0].Id,!0)});break;case MediaBrowser.ConnectionState.ServerSelection:embyRouter.showSelectServer();break;case MediaBrowser.ConnectionState.ConnectSignIn:embyRouter.showWelcome();break;case MediaBrowser.ConnectionState.ServerUpdateNeeded:require(["alert"],function(alert){alert({text:Globalize.translate("sharedcomponents#ServerUpdateNeeded","https://emby.media"),html:Globalize.translate("sharedcomponents#ServerUpdateNeeded",'https://emby.media')}).then(function(){embyRouter.showSelectServer()})})}}function loadContentUrl(ctx,next,route,request){var url=route.contentPath||route.path;url.indexOf("://")===-1&&(0!==url.indexOf("/")&&(url="/"+url),url=baseUrl()+url),ctx.querystring&&route.enableContentQueryString&&(url+="?"+ctx.querystring),require(["text!"+url],function(html){loadContent(ctx,route,html,request)})}function handleRoute(ctx,next,route){authenticate(ctx,route,function(){initRoute(ctx,next,route)})}function initRoute(ctx,next,route){var onInitComplete=function(controllerFactory){sendRouteToViewManager(ctx,next,route,controllerFactory)};require(route.dependencies||[],function(){route.controller?require([route.controller],onInitComplete):onInitComplete()})}function cancelCurrentLoadRequest(){var currentRequest=currentViewLoadRequest;currentRequest&&(currentRequest.cancel=!0)}function sendRouteToViewManager(ctx,next,route,controllerFactory){if(isDummyBackToHome&&"home"===route.type)return void(isDummyBackToHome=!1);cancelCurrentLoadRequest();var isBackNav=ctx.isBack,currentRequest={url:baseUrl()+ctx.path,transition:route.transition,isBack:isBackNav,state:ctx.state,type:route.type,fullscreen:route.fullscreen,controllerFactory:controllerFactory,options:{supportsThemeMedia:route.supportsThemeMedia||!1},autoFocus:route.autoFocus};currentViewLoadRequest=currentRequest;var onNewViewNeeded=function(){"string"==typeof route.path?loadContentUrl(ctx,next,route,currentRequest):next()};return isBackNav?void viewManager.tryRestoreView(currentRequest,function(){currentRouteInfo={route:route,path:ctx.path}}).catch(function(result){result&&result.cancelled||onNewViewNeeded()}):void onNewViewNeeded()}function start(options){loading.show(),connectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){firstConnectionResult=result,loading.hide(),options=options||{},page({click:options.click!==!1,hashbang:options.hashbang!==!1,enableHistory:enableHistory()})})}function enableHistory(){return!browser.xboxOne&&!browser.edgeUwp&&!browser.orsay}function enableNativeHistory(){return page.enableNativeHistory()}function authenticate(ctx,route,callback){var firstResult=firstConnectionResult;if(firstResult&&(firstConnectionResult=null,firstResult.State!==MediaBrowser.ConnectionState.SignedIn&&!route.anonymous))return void handleConnectionResult(firstResult,loading);var apiClient=connectionManager.currentApiClient(),pathname=ctx.pathname.toLowerCase();console.log("embyRouter - processing path request "+pathname);var isCurrentRouteStartup=!currentRouteInfo||currentRouteInfo.route.startup,shouldExitApp=ctx.isBack&&route.isDefaultRoute&&isCurrentRouteStartup;if(!(shouldExitApp||apiClient&&apiClient.isLoggedIn()||route.anonymous))return console.log("embyRouter - route does not allow anonymous access, redirecting to login"),void beginConnectionWizard();if(shouldExitApp){if(appHost.supports("exit"))return void appHost.exit()}else{if(apiClient&&apiClient.isLoggedIn()){if(console.log("embyRouter - user is authenticated"),ctx.isBack&&(route.isDefaultRoute||route.startup)&&!isCurrentRouteStartup)return void handleBackToDefault();if(route.isDefaultRoute)return console.log("embyRouter - loading skin home page"),void skinManager.loadUserSkin();if(route.roles)return void validateRoles(apiClient,route.roles).then(function(){apiClient.ensureWebSocket(),callback()},beginConnectionWizard)}console.log("embyRouter - proceeding to "+pathname),callback()}}function validateRoles(apiClient,roles){return Promise.all(roles.split(",").map(function(role){return validateRole(apiClient,role)}))}function validateRole(apiClient,role){return"admin"===role?apiClient.getCurrentUser().then(function(user){return user.Policy.IsAdministrator?Promise.resolve():Promise.reject()}):Promise.resolve()}function handleBackToDefault(){return!appHost.supports("exitmenu")&&appHost.supports("exit")?void appHost.exit():(isDummyBackToHome=!0,skinManager.loadUserSkin(),void(isHandlingBackToDefault||skinManager.getCurrentSkin().showBackMenu().then(function(){isHandlingBackToDefault=!1})))}function loadContent(ctx,route,html,request){html=Globalize.translateDocument(html,route.dictionary),request.view=html,viewManager.loadView(request),currentRouteInfo={route:route,path:ctx.path},ctx.handled=!0}function getRequestFile(){var path=window.location.pathname||"",index=path.lastIndexOf("/");return path=index!==-1?path.substring(index):"/"+path,path&&"/"!==path||(path="/index.html"),path}function baseUrl(){return baseRoute}function getHandler(route){return function(ctx,next){handleRoute(ctx,next,route)}}function getWindowLocationSearch(win){var currentPath=currentRouteInfo?currentRouteInfo.path||"":"",index=currentPath.indexOf("?"),search="";return index!==-1&&(search=currentPath.substring(index)),search||""}function param(name,url){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url||getWindowLocationSearch());return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function back(){page.back()}function canGoBack(){var curr=current();return!!curr&&("home"!==curr.type&&page.canGoBack())}function show(path,options){0!==path.indexOf("/")&&path.indexOf("://")===-1&&(path="/"+path);var baseRoute=baseUrl();return path=path.replace(baseRoute,""),currentRouteInfo&¤tRouteInfo.path===path&&"home"!==currentRouteInfo.route.type?(loading.hide(),Promise.resolve()):new Promise(function(resolve,reject){resolveOnNextShow=resolve,page.show(path,options)})}function current(){return currentRouteInfo?currentRouteInfo.route:null}function goHome(){var skin=skinManager.getCurrentSkin();if(skin.getHomeRoute){var homePath=skin.getHomeRoute();return show(pluginManager.mapRoute(skin,homePath))}var homeRoute=skin.getRoutes().filter(function(r){return"home"===r.type})[0];return show(pluginManager.mapRoute(skin,homeRoute))}function getRouteUrl(item,options){return skinManager.getCurrentSkin().getRouteUrl(item,options)}function showItem(item,serverId,options){if("string"==typeof item){var apiClient=serverId?connectionManager.getApiClient(serverId):connectionManager.currentApiClient();apiClient.getItem(apiClient.getCurrentUserId(),item).then(function(item){embyRouter.showItem(item,options)})}else 2===arguments.length&&(options=arguments[1]),skinManager.getCurrentSkin().showItem(item,options)}function setTitle(title){skinManager.getCurrentSkin().setTitle(title)}function showVideoOsd(){var skin=skinManager.getCurrentSkin(),homeRoute=skin.getRoutes().filter(function(r){return"video-osd"===r.type})[0];return show(pluginManager.mapRoute(skin,homeRoute))}function addRoute(path,newRoute){page(path,getHandler(newRoute)),allRoutes.push(newRoute)}function getRoutes(){return allRoutes}function setTransparency(level){backdropContainer||(backdropContainer=document.querySelector(".backdropContainer")),backgroundContainer||(backgroundContainer=document.querySelector(".backgroundContainer")),"full"===level||2===level?(backdrop.clear(!0),document.documentElement.classList.add("transparentDocument"),backgroundContainer.classList.add("backgroundContainer-transparent"),backdropContainer.classList.add("hide")):"backdrop"===level||1===level?(backdrop.externalBackdrop(!0),document.documentElement.classList.add("transparentDocument"),backgroundContainer.classList.add("backgroundContainer-transparent"),backdropContainer.classList.add("hide")):(backdrop.externalBackdrop(!1),document.documentElement.classList.remove("transparentDocument"),backgroundContainer.classList.remove("backgroundContainer-transparent"),backdropContainer.classList.remove("hide"))}function pushState(state,title,url){state.navigate=!1,page.pushState(state,title,url)}function setBaseRoute(){var baseRoute=window.location.pathname.replace(getRequestFile(),"");baseRoute.lastIndexOf("/")===baseRoute.length-1&&(baseRoute=baseRoute.substring(0,baseRoute.length-1)),console.log("Setting page base to "+baseRoute),page.base(baseRoute)}var currentViewLoadRequest,firstConnectionResult,isHandlingBackToDefault,isDummyBackToHome,embyRouter={showLocalLogin:function(apiClient,serverId,manualLogin){var pageName=manualLogin?"manuallogin":"login";show("/startup/"+pageName+".html?serverid="+serverId)},showSelectServer:function(){show("/startup/selectserver.html")},showWelcome:function(){show("/startup/welcome.html")},showSettings:function(){show("/settings/settings.html")},showSearch:function(){skinManager.getCurrentSkin().search()},showGenre:function(options){skinManager.getCurrentSkin().showGenre(options)},showGuide:function(){skinManager.getCurrentSkin().showGuide()},showLiveTV:function(){skinManager.getCurrentSkin().showLiveTV()},showRecordedTV:function(){skinManager.getCurrentSkin().showRecordedTV()},showFavorites:function(){skinManager.getCurrentSkin().showFavorites()}},baseRoute=window.location.href.split("?")[0].replace(getRequestFile(),"");baseRoute=baseRoute.split("#")[0],baseRoute.lastIndexOf("/")===baseRoute.length-1&&(baseRoute=baseRoute.substring(0,baseRoute.length-1));var resolveOnNextShow;document.addEventListener("viewshow",function(){var resolve=resolveOnNextShow;resolve&&(resolveOnNextShow=null,resolve())});var currentRouteInfo,backdropContainer,backgroundContainer,allRoutes=[];return setBaseRoute(),embyRouter.addRoute=addRoute,embyRouter.param=param,embyRouter.back=back,embyRouter.show=show,embyRouter.start=start,embyRouter.baseUrl=baseUrl,embyRouter.canGoBack=canGoBack,embyRouter.current=current,embyRouter.beginConnectionWizard=beginConnectionWizard,embyRouter.goHome=goHome,embyRouter.showItem=showItem,embyRouter.setTitle=setTitle,embyRouter.setTransparency=setTransparency,embyRouter.getRoutes=getRoutes,embyRouter.getRouteUrl=getRouteUrl,embyRouter.pushState=pushState,embyRouter.enableNativeHistory=enableNativeHistory,embyRouter.showVideoOsd=showVideoOsd,embyRouter.handleAnchorClick=page.handleAnchorClick,embyRouter.TransparencyLevel={None:0,Backdrop:1,Full:2},embyRouter}); \ No newline at end of file +define(["loading","viewManager","skinManager","pluginManager","backdrop","browser","pageJs","appSettings","apphost","connectionManager"],function(loading,viewManager,skinManager,pluginManager,backdrop,browser,page,appSettings,appHost,connectionManager){"use strict";function beginConnectionWizard(){backdrop.clear(),loading.show(),connectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){handleConnectionResult(result,loading)})}function handleConnectionResult(result,loading){switch(result.State){case MediaBrowser.ConnectionState.SignedIn:loading.hide(),skinManager.loadUserSkin();break;case MediaBrowser.ConnectionState.ServerSignIn:result.ApiClient.getPublicUsers().then(function(users){users.length?embyRouter.showLocalLogin(result.ApiClient,result.Servers[0].Id):embyRouter.showLocalLogin(result.ApiClient,result.Servers[0].Id,!0)});break;case MediaBrowser.ConnectionState.ServerSelection:embyRouter.showSelectServer();break;case MediaBrowser.ConnectionState.ConnectSignIn:embyRouter.showWelcome();break;case MediaBrowser.ConnectionState.ServerUpdateNeeded:require(["alert"],function(alert){alert({text:Globalize.translate("sharedcomponents#ServerUpdateNeeded","https://emby.media"),html:Globalize.translate("sharedcomponents#ServerUpdateNeeded",'https://emby.media')}).then(function(){embyRouter.showSelectServer()})})}}function loadContentUrl(ctx,next,route,request){var url=route.contentPath||route.path;url.indexOf("://")===-1&&(0!==url.indexOf("/")&&(url="/"+url),url=baseUrl()+url),ctx.querystring&&route.enableContentQueryString&&(url+="?"+ctx.querystring),require(["text!"+url],function(html){loadContent(ctx,route,html,request)})}function handleRoute(ctx,next,route){authenticate(ctx,route,function(){initRoute(ctx,next,route)})}function initRoute(ctx,next,route){var onInitComplete=function(controllerFactory){sendRouteToViewManager(ctx,next,route,controllerFactory)};require(route.dependencies||[],function(){route.controller?require([route.controller],onInitComplete):onInitComplete()})}function cancelCurrentLoadRequest(){var currentRequest=currentViewLoadRequest;currentRequest&&(currentRequest.cancel=!0)}function sendRouteToViewManager(ctx,next,route,controllerFactory){if(isDummyBackToHome&&"home"===route.type)return void(isDummyBackToHome=!1);cancelCurrentLoadRequest();var isBackNav=ctx.isBack,currentRequest={url:baseUrl()+ctx.path,transition:route.transition,isBack:isBackNav,state:ctx.state,type:route.type,fullscreen:route.fullscreen,controllerFactory:controllerFactory,options:{supportsThemeMedia:route.supportsThemeMedia||!1},autoFocus:route.autoFocus};currentViewLoadRequest=currentRequest;var onNewViewNeeded=function(){"string"==typeof route.path?loadContentUrl(ctx,next,route,currentRequest):next()};return isBackNav?void viewManager.tryRestoreView(currentRequest,function(){currentRouteInfo={route:route,path:ctx.path}}).catch(function(result){result&&result.cancelled||onNewViewNeeded()}):void onNewViewNeeded()}function start(options){loading.show(),connectionManager.connect({enableAutoLogin:appSettings.enableAutoLogin()}).then(function(result){firstConnectionResult=result,loading.hide(),options=options||{},page({click:options.click!==!1,hashbang:options.hashbang!==!1,enableHistory:enableHistory()})})}function enableHistory(){return!browser.xboxOne&&!browser.orsay}function enableNativeHistory(){return page.enableNativeHistory()}function authenticate(ctx,route,callback){var firstResult=firstConnectionResult;if(firstResult&&(firstConnectionResult=null,firstResult.State!==MediaBrowser.ConnectionState.SignedIn&&!route.anonymous))return void handleConnectionResult(firstResult,loading);var apiClient=connectionManager.currentApiClient(),pathname=ctx.pathname.toLowerCase();console.log("embyRouter - processing path request "+pathname);var isCurrentRouteStartup=!currentRouteInfo||currentRouteInfo.route.startup,shouldExitApp=ctx.isBack&&route.isDefaultRoute&&isCurrentRouteStartup;if(!(shouldExitApp||apiClient&&apiClient.isLoggedIn()||route.anonymous))return console.log("embyRouter - route does not allow anonymous access, redirecting to login"),void beginConnectionWizard();if(shouldExitApp){if(appHost.supports("exit"))return void appHost.exit()}else{if(apiClient&&apiClient.isLoggedIn()){if(console.log("embyRouter - user is authenticated"),ctx.isBack&&(route.isDefaultRoute||route.startup)&&!isCurrentRouteStartup)return void handleBackToDefault();if(route.isDefaultRoute)return console.log("embyRouter - loading skin home page"),void skinManager.loadUserSkin();if(route.roles)return void validateRoles(apiClient,route.roles).then(function(){apiClient.ensureWebSocket(),callback()},beginConnectionWizard)}console.log("embyRouter - proceeding to "+pathname),callback()}}function validateRoles(apiClient,roles){return Promise.all(roles.split(",").map(function(role){return validateRole(apiClient,role)}))}function validateRole(apiClient,role){return"admin"===role?apiClient.getCurrentUser().then(function(user){return user.Policy.IsAdministrator?Promise.resolve():Promise.reject()}):Promise.resolve()}function handleBackToDefault(){return!appHost.supports("exitmenu")&&appHost.supports("exit")?void appHost.exit():(isDummyBackToHome=!0,skinManager.loadUserSkin(),void(isHandlingBackToDefault||skinManager.getCurrentSkin().showBackMenu().then(function(){isHandlingBackToDefault=!1})))}function loadContent(ctx,route,html,request){html=Globalize.translateDocument(html,route.dictionary),request.view=html,viewManager.loadView(request),currentRouteInfo={route:route,path:ctx.path},ctx.handled=!0}function getRequestFile(){var path=window.location.pathname||"",index=path.lastIndexOf("/");return path=index!==-1?path.substring(index):"/"+path,path&&"/"!==path||(path="/index.html"),path}function baseUrl(){return baseRoute}function getHandler(route){return function(ctx,next){handleRoute(ctx,next,route)}}function getWindowLocationSearch(win){var currentPath=currentRouteInfo?currentRouteInfo.path||"":"",index=currentPath.indexOf("?"),search="";return index!==-1&&(search=currentPath.substring(index)),search||""}function param(name,url){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS,"i"),results=regex.exec(url||getWindowLocationSearch());return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}function back(){page.back()}function canGoBack(){var curr=current();return!!curr&&("home"!==curr.type&&page.canGoBack())}function show(path,options){0!==path.indexOf("/")&&path.indexOf("://")===-1&&(path="/"+path);var baseRoute=baseUrl();return path=path.replace(baseRoute,""),currentRouteInfo&¤tRouteInfo.path===path&&"home"!==currentRouteInfo.route.type?(loading.hide(),Promise.resolve()):new Promise(function(resolve,reject){resolveOnNextShow=resolve,page.show(path,options)})}function current(){return currentRouteInfo?currentRouteInfo.route:null}function goHome(){var skin=skinManager.getCurrentSkin();if(skin.getHomeRoute){var homePath=skin.getHomeRoute();return show(pluginManager.mapRoute(skin,homePath))}var homeRoute=skin.getRoutes().filter(function(r){return"home"===r.type})[0];return show(pluginManager.mapRoute(skin,homeRoute))}function getRouteUrl(item,options){return skinManager.getCurrentSkin().getRouteUrl(item,options)}function showItem(item,serverId,options){if("string"==typeof item){var apiClient=serverId?connectionManager.getApiClient(serverId):connectionManager.currentApiClient();apiClient.getItem(apiClient.getCurrentUserId(),item).then(function(item){embyRouter.showItem(item,options)})}else 2===arguments.length&&(options=arguments[1]),skinManager.getCurrentSkin().showItem(item,options)}function setTitle(title){skinManager.getCurrentSkin().setTitle(title)}function showVideoOsd(){var skin=skinManager.getCurrentSkin(),homeRoute=skin.getRoutes().filter(function(r){return"video-osd"===r.type})[0];return show(pluginManager.mapRoute(skin,homeRoute))}function addRoute(path,newRoute){page(path,getHandler(newRoute)),allRoutes.push(newRoute)}function getRoutes(){return allRoutes}function setTransparency(level){backdropContainer||(backdropContainer=document.querySelector(".backdropContainer")),backgroundContainer||(backgroundContainer=document.querySelector(".backgroundContainer")),"full"===level||2===level?(backdrop.clear(!0),document.documentElement.classList.add("transparentDocument"),backgroundContainer.classList.add("backgroundContainer-transparent"),backdropContainer.classList.add("hide")):"backdrop"===level||1===level?(backdrop.externalBackdrop(!0),document.documentElement.classList.add("transparentDocument"),backgroundContainer.classList.add("backgroundContainer-transparent"),backdropContainer.classList.add("hide")):(backdrop.externalBackdrop(!1),document.documentElement.classList.remove("transparentDocument"),backgroundContainer.classList.remove("backgroundContainer-transparent"),backdropContainer.classList.remove("hide"))}function pushState(state,title,url){state.navigate=!1,page.pushState(state,title,url)}function setBaseRoute(){var baseRoute=window.location.pathname.replace(getRequestFile(),"");baseRoute.lastIndexOf("/")===baseRoute.length-1&&(baseRoute=baseRoute.substring(0,baseRoute.length-1)),console.log("Setting page base to "+baseRoute),page.base(baseRoute)}var currentViewLoadRequest,firstConnectionResult,isHandlingBackToDefault,isDummyBackToHome,embyRouter={showLocalLogin:function(apiClient,serverId,manualLogin){var pageName=manualLogin?"manuallogin":"login";show("/startup/"+pageName+".html?serverid="+serverId)},showSelectServer:function(){show("/startup/selectserver.html")},showWelcome:function(){show("/startup/welcome.html")},showSettings:function(){show("/settings/settings.html")},showSearch:function(){skinManager.getCurrentSkin().search()},showGenre:function(options){skinManager.getCurrentSkin().showGenre(options)},showGuide:function(){skinManager.getCurrentSkin().showGuide()},showLiveTV:function(){skinManager.getCurrentSkin().showLiveTV()},showRecordedTV:function(){skinManager.getCurrentSkin().showRecordedTV()},showFavorites:function(){skinManager.getCurrentSkin().showFavorites()}},baseRoute=window.location.href.split("?")[0].replace(getRequestFile(),"");baseRoute=baseRoute.split("#")[0],baseRoute.lastIndexOf("/")===baseRoute.length-1&&(baseRoute=baseRoute.substring(0,baseRoute.length-1));var resolveOnNextShow;document.addEventListener("viewshow",function(){var resolve=resolveOnNextShow;resolve&&(resolveOnNextShow=null,resolve())});var currentRouteInfo,backdropContainer,backgroundContainer,allRoutes=[];return setBaseRoute(),embyRouter.addRoute=addRoute,embyRouter.param=param,embyRouter.back=back,embyRouter.show=show,embyRouter.start=start,embyRouter.baseUrl=baseUrl,embyRouter.canGoBack=canGoBack,embyRouter.current=current,embyRouter.beginConnectionWizard=beginConnectionWizard,embyRouter.goHome=goHome,embyRouter.showItem=showItem,embyRouter.setTitle=setTitle,embyRouter.setTransparency=setTransparency,embyRouter.getRoutes=getRoutes,embyRouter.getRouteUrl=getRouteUrl,embyRouter.pushState=pushState,embyRouter.enableNativeHistory=enableNativeHistory,embyRouter.showVideoOsd=showVideoOsd,embyRouter.handleAnchorClick=page.handleAnchorClick,embyRouter.TransparencyLevel={None:0,Backdrop:1,Full:2},embyRouter}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js b/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js index a43cc7143a..915f77317f 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js +++ b/dashboard-ui/bower_components/emby-webcomponents/scroller/smoothscroller.js @@ -1 +1 @@ -define(["browser","layoutManager","dom","focusManager","scrollStyles"],function(browser,layoutManager,dom,focusManager){"use strict";function type(value){return null==value?String(value):"object"==typeof value||"function"==typeof value?Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof value}function disableOneEvent(event){event.preventDefault(),event.stopPropagation(),this.removeEventListener(event.type,disableOneEvent)}function within(number,min,max){return numbermax?max:number}var dragMouseEvents=["mousemove","mouseup"],dragTouchEvents=["touchmove","touchend"],wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel",interactiveElements=["INPUT","SELECT","TEXTAREA"],abs=Math.abs,sqrt=Math.sqrt,pow=Math.pow,round=Math.round,max=Math.max,scrollerFactory=(Math.min,function(frame,options){function sibling(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched}function ensureSizeInfo(){if(requiresReflow){requiresReflow=!1,frameSize=o.horizontal?frame.offsetWidth:frame.offsetHeight;var slideeSize=o.scrollWidth||Math.max(slideeElement[o.horizontal?"offsetWidth":"offsetHeight"],slideeElement[o.horizontal?"scrollWidth":"scrollHeight"]);pos.end=max(slideeSize-frameSize,0)}}function load(isInit){requiresReflow=!0,isInit||(ensureSizeInfo(),slideTo(within(pos.dest,pos.start,pos.end)))}function initFrameResizeObserver(){var observerOptions={};self.frameResizeObserver=new ResizeObserver(function(entries){for(var j=0,length2=entries.length;jabs(dragging.pathY):abs(dragging.pathX)dragging.pathToLock&&(dragging.locked=1,dragging.source.addEventListener("click",disableOneEvent)),dragging.released&&dragEnd(),slideTo(round(dragging.initPos-dragging.delta))}}function dragEnd(){dragging.released=!0,dragTouchEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),dragMouseEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),setTimeout(function(){dragging.source.removeEventListener("click",disableOneEvent)}),dragging.init=0}function isInteractive(element){for(;element;){if(interactiveElements.indexOf(element.tagName)!==-1)return!0;element=element.parentNode}return!1}function normalizeWheelDelta(event){return scrolling.curDelta=(o.horizontal?event.deltaY||event.deltaX:event.deltaY)||-event.wheelDelta,transform&&(scrolling.curDelta/=1===event.deltaMode?3:100),scrolling.curDelta}function scrollHandler(event){if(ensureSizeInfo(),o.scrollBy&&pos.start!==pos.end){var delta=normalizeWheelDelta(event);transform?(delta>0&&pos.destpos.start,self.slideBy(o.scrollBy*delta)):(isSmoothScrollSupported&&(delta*=12),o.horizontal?nativeScrollElement.scrollLeft+=delta:nativeScrollElement.scrollTop+=delta)}}function onResize(){load(!1)}function resetScroll(){o.horizontal?this.scrollLeft=0:this.scrollTop=0}function onFrameClick(e){if(1===e.which){var focusableParent=focusManager.focusableParent(e.target);focusableParent&&focusableParent!==document.activeElement&&focusableParent.focus()}}var o=Object.assign({},{slidee:null,horizontal:!1,mouseWheel:!0,scrollBy:0,dragSource:null,mouseDragging:1,touchDragging:1,swingSpeed:.2,dragThreshold:3,intervactive:null,speed:0},options),isSmoothScrollSupported="scrollBehavior"in document.documentElement.style,browserSupportsAnimation=!!browser.animate;isSmoothScrollSupported&&browser.firefox?options.enableNativeScroll=!0:options.requireAnimation&&browserSupportsAnimation?options.enableNativeScroll=!1:layoutManager.tv&&browserSupportsAnimation||(options.enableNativeScroll=!0);var self=this;self.options=o;var slideeElement=o.slidee?o.slidee:sibling(frame.firstChild)[0],pos={start:0,center:0,end:0,cur:0,dest:0},transform=!options.enableNativeScroll,scrollSource=frame,dragSourceElement=o.dragSource?o.dragSource:frame,animation={},dragging={released:1},scrolling={last:0,delta:0,resetTime:200};self.initialized=0,self.slidee=slideeElement,self.options=o,self.dragging=dragging;var nativeScrollElement=frame,requiresReflow=!0,frameSize=0;self.reload=function(){load()};self.getPos=function(item){var scrollElement=transform?slideeElement:nativeScrollElement,slideeOffset=getBoundingClientRect(scrollElement),itemOffset=getBoundingClientRect(item),offset=(o.horizontal?slideeOffset.left:slideeOffset.top,o.horizontal?slideeOffset.right:slideeOffset.bottom,o.horizontal?itemOffset.left-slideeOffset.left:itemOffset.top-slideeOffset.top),size=o.horizontal?itemOffset.width:itemOffset.height;size||0===size||(size=item[o.horizontal?"offsetWidth":"offsetHeight"]);var centerOffset=o.centerOffset||0;transform||(centerOffset=0,offset+=o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop),ensureSizeInfo();var currentStart=pos.cur,currentEnd=currentStart+frameSize,isVisible=offset>=currentStart&&offset+size<=currentEnd;return{start:offset,center:offset+centerOffset-frameSize/2+size/2,end:offset-frameSize+size,size:size,isVisible:isVisible}},self.getCenterPosition=function(item){ensureSizeInfo();var pos=self.getPos(item);return within(pos.center,pos.start,pos.end)},self.slideBy=function(delta,immediate){delta&&slideTo(pos.dest+delta,immediate)},self.slideTo=function(pos,immediate){slideTo(pos,immediate)},self.toStart=function(item,immediate){to("start",item,immediate)},self.toEnd=function(item,immediate){to("end",item,immediate)},self.toCenter=function(item,immediate){to("center",item,immediate)},self.destroy=function(){return dom.removeEventListener(window,"resize",onResize,{passive:!0}),self.frameResizeObserver&&(self.frameResizeObserver.disconnect(),self.frameResizeObserver=null),dom.removeEventListener(frame,"scroll",resetScroll,{passive:!0}),dom.removeEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.removeEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),dom.removeEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),dom.removeEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),self.initialized=0,self},self.getScrollPosition=function(){return transform?pos.cur:o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop},self.init=function(){if(!self.initialized)return transform?(frame.style.overflow="hidden",slideeElement.style["will-change"]="transform",slideeElement.style.transition="transform "+o.speed+"ms ease-out",o.horizontal?slideeElement.classList.add("animatedScrollX"):slideeElement.classList.add("animatedScrollY")):o.horizontal?layoutManager.desktop?nativeScrollElement.classList.add("smoothScrollX"):nativeScrollElement.classList.add("hiddenScrollX"):layoutManager.desktop?nativeScrollElement.classList.add("smoothScrollY"):nativeScrollElement.classList.add("hiddenScrollY"),(transform||layoutManager.tv)&&dom.addEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),transform?(dom.addEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),window.ResizeObserver?initFrameResizeObserver():o.scrollWidth||dom.addEventListener(window,"resize",onResize,{passive:!0}),o.horizontal||dom.addEventListener(frame,"scroll",resetScroll,{passive:!0}),o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0})):o.horizontal&&o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.addEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),self.initialized=1,load(!0),self}});return scrollerFactory.create=function(frame,options){var instance=new scrollerFactory(frame,options);return Promise.resolve(instance)},scrollerFactory}); \ No newline at end of file +define(["browser","layoutManager","dom","focusManager","scrollStyles"],function(browser,layoutManager,dom,focusManager){"use strict";function type(value){return null==value?String(value):"object"==typeof value||"function"==typeof value?Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof value}function disableOneEvent(event){event.preventDefault(),event.stopPropagation(),this.removeEventListener(event.type,disableOneEvent)}function within(number,min,max){return numbermax?max:number}var dragMouseEvents=["mousemove","mouseup"],dragTouchEvents=["touchmove","touchend"],wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel",interactiveElements=["INPUT","SELECT","TEXTAREA"],abs=Math.abs,sqrt=Math.sqrt,pow=Math.pow,round=Math.round,max=Math.max,scrollerFactory=(Math.min,function(frame,options){function sibling(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched}function ensureSizeInfo(){if(requiresReflow){requiresReflow=!1,frameSize=o.horizontal?frame.offsetWidth:frame.offsetHeight;var slideeSize=o.scrollWidth||Math.max(slideeElement[o.horizontal?"offsetWidth":"offsetHeight"],slideeElement[o.horizontal?"scrollWidth":"scrollHeight"]);self._pos.end=max(slideeSize-frameSize,0)}}function load(isInit){if(requiresReflow=!0,!isInit){ensureSizeInfo();var pos=self._pos;self.slideTo(within(pos.dest,pos.start,pos.end))}}function initFrameResizeObserver(){var observerOptions={};self.frameResizeObserver=new ResizeObserver(onResize,observerOptions),self.frameResizeObserver.observe(frame)}function nativeScrollTo(container,pos,immediate){!immediate&&container.scrollTo?o.horizontal?container.scrollTo(pos,0):container.scrollTo(0,pos):o.horizontal?container.scrollLeft=Math.round(pos):container.scrollTop=Math.round(pos)}function setStyleProperty(elem,name,value,speed,resetTransition){(resetTransition||browser.edge)&&(elem.style.transition="none",void elem.offsetWidth),elem.style.transition="transform "+speed+"ms ease-out",elem.style[name]=value}function renderAnimate(){var speed=o.speed;animation.immediate&&(speed=o.immediateSpeed||50),o.horizontal?setStyleProperty(slideeElement,"transform","translateX("+-round(animation.to)+"px)",speed):setStyleProperty(slideeElement,"transform","translateY("+-round(animation.to)+"px)",speed),self._pos.cur=animation.to,o.dispatchScrollEvent&&frame.dispatchEvent(new CustomEvent("scroll",{bubbles:!0,cancelable:!1}))}function getBoundingClientRect(elem){return elem.getBoundingClientRect?elem.getBoundingClientRect():{top:0,left:0}}function dragInitSlidee(event){var isTouch="touchstart"===event.type;if(!(dragging.init||!isTouch&&isInteractive(event.target))&&(isTouch?o.touchDragging:o.mouseDragging&&event.which<2)){isTouch||event.preventDefault(),dragging.released=0,dragging.init=0,dragging.source=event.target,dragging.touch=isTouch;var pointer=isTouch?event.touches[0]:event;dragging.initX=pointer.pageX,dragging.initY=pointer.pageY,dragging.initPos=self._pos.cur,dragging.start=+new Date,dragging.time=0,dragging.path=0,dragging.delta=0,dragging.locked=0,dragging.pathToLock=isTouch?30:10,transform&&(isTouch?dragTouchEvents.forEach(function(eventName){dom.addEventListener(document,eventName,dragHandler,{passive:!0})}):dragMouseEvents.forEach(function(eventName){dom.addEventListener(document,eventName,dragHandler,{passive:!0})}))}}function dragHandler(event){dragging.released="mouseup"===event.type||"touchend"===event.type;var pointer=dragging.touch?event[dragging.released?"changedTouches":"touches"][0]:event;if(dragging.pathX=pointer.pageX-dragging.initX,dragging.pathY=pointer.pageY-dragging.initY,dragging.path=sqrt(pow(dragging.pathX,2)+pow(dragging.pathY,2)),dragging.delta=o.horizontal?dragging.pathX:dragging.pathY,dragging.released||!(dragging.path<1)){if(!dragging.init){if(dragging.pathabs(dragging.pathY):abs(dragging.pathX)dragging.pathToLock&&(dragging.locked=1,dragging.source.addEventListener("click",disableOneEvent)),dragging.released&&dragEnd(),self.slideTo(round(dragging.initPos-dragging.delta))}}function dragEnd(){dragging.released=!0,dragTouchEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),dragMouseEvents.forEach(function(eventName){dom.removeEventListener(document,eventName,dragHandler,{passive:!0})}),setTimeout(function(){dragging.source.removeEventListener("click",disableOneEvent)}),dragging.init=0}function isInteractive(element){for(;element;){if(interactiveElements.indexOf(element.tagName)!==-1)return!0;element=element.parentNode}return!1}function normalizeWheelDelta(event){return scrolling.curDelta=(o.horizontal?event.deltaY||event.deltaX:event.deltaY)||-event.wheelDelta,transform&&(scrolling.curDelta/=1===event.deltaMode?3:100),scrolling.curDelta}function scrollHandler(event){ensureSizeInfo();var pos=self._pos;if(o.scrollBy&&pos.start!==pos.end){var delta=normalizeWheelDelta(event);transform?(delta>0&&pos.destpos.start,self.slideBy(o.scrollBy*delta)):(isSmoothScrollSupported&&(delta*=12),o.horizontal?nativeScrollElement.scrollLeft+=delta:nativeScrollElement.scrollTop+=delta)}}function onResize(){load(!1)}function resetScroll(){o.horizontal?this.scrollLeft=0:this.scrollTop=0}function onFrameClick(e){if(1===e.which){var focusableParent=focusManager.focusableParent(e.target);focusableParent&&focusableParent!==document.activeElement&&focusableParent.focus()}}var o=Object.assign({},{slidee:null,horizontal:!1,mouseWheel:!0,scrollBy:0,dragSource:null,mouseDragging:1,touchDragging:1,swingSpeed:.2,dragThreshold:3,intervactive:null,speed:0},options),isSmoothScrollSupported="scrollBehavior"in document.documentElement.style,browserSupportsAnimation=!!browser.animate;isSmoothScrollSupported&&browser.firefox?options.enableNativeScroll=!0:options.requireAnimation&&browserSupportsAnimation?options.enableNativeScroll=!1:layoutManager.tv&&browserSupportsAnimation||(options.enableNativeScroll=!0);var self=this;self.options=o;var slideeElement=o.slidee?o.slidee:sibling(frame.firstChild)[0];self._pos={start:0,center:0,end:0,cur:0,dest:0};var transform=!options.enableNativeScroll,scrollSource=frame,dragSourceElement=o.dragSource?o.dragSource:frame,animation={},dragging={released:1},scrolling={last:0,delta:0,resetTime:200};self.initialized=0,self.slidee=slideeElement,self.options=o,self.dragging=dragging;var nativeScrollElement=frame,requiresReflow=!0,frameSize=0;self.reload=function(){load()},self.slideTo=function(newPos,immediate,fullItemPos){ensureSizeInfo();var pos=self._pos;if(newPos=within(newPos,pos.start,pos.end),!transform)return void nativeScrollTo(nativeScrollElement,newPos,immediate);animation.from=pos.cur,animation.to=newPos,animation.immediate=immediate||dragging.init||!o.speed;var now=(new Date).getTime();o.autoImmediate&&!animation.immediate&&now-(animation.lastAnimate||0)<=50&&(animation.immediate=!0),!animation.immediate&&o.skipSlideToWhenVisible&&fullItemPos&&fullItemPos.isVisible||newPos!==pos.dest&&(pos.dest=newPos,renderAnimate(animation),animation.lastAnimate=now)};self.getPos=function(item){var scrollElement=transform?slideeElement:nativeScrollElement,slideeOffset=getBoundingClientRect(scrollElement),itemOffset=getBoundingClientRect(item),offset=(o.horizontal?slideeOffset.left:slideeOffset.top,o.horizontal?slideeOffset.right:slideeOffset.bottom,o.horizontal?itemOffset.left-slideeOffset.left:itemOffset.top-slideeOffset.top),size=o.horizontal?itemOffset.width:itemOffset.height;size||0===size||(size=item[o.horizontal?"offsetWidth":"offsetHeight"]);var centerOffset=o.centerOffset||0;transform||(centerOffset=0,offset+=o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop),ensureSizeInfo();var currentStart=self._pos.cur,currentEnd=currentStart+frameSize,isVisible=offset>=currentStart&&offset+size<=currentEnd;return{start:offset,center:offset+centerOffset-frameSize/2+size/2,end:offset-frameSize+size,size:size,isVisible:isVisible}},self.getCenterPosition=function(item){ensureSizeInfo();var pos=self.getPos(item);return within(pos.center,pos.start,pos.end)},self.destroy=function(){return dom.removeEventListener(window,"resize",onResize,{passive:!0}),self.frameResizeObserver&&(self.frameResizeObserver.disconnect(),self.frameResizeObserver=null),dom.removeEventListener(frame,"scroll",resetScroll,{passive:!0}),dom.removeEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.removeEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),dom.removeEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),dom.removeEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),self.initialized=0,self},self.getScrollPosition=function(){return transform?self._pos.cur:o.horizontal?nativeScrollElement.scrollLeft:nativeScrollElement.scrollTop},self.init=function(){if(!self.initialized)return transform?(frame.style.overflow="hidden",slideeElement.style["will-change"]="transform",slideeElement.style.transition="transform "+o.speed+"ms ease-out",o.horizontal?slideeElement.classList.add("animatedScrollX"):slideeElement.classList.add("animatedScrollY")):o.horizontal?layoutManager.desktop?nativeScrollElement.classList.add("smoothScrollX"):nativeScrollElement.classList.add("hiddenScrollX"):layoutManager.desktop?nativeScrollElement.classList.add("smoothScrollY"):nativeScrollElement.classList.add("hiddenScrollY"),(transform||layoutManager.tv)&&dom.addEventListener(dragSourceElement,"mousedown",dragInitSlidee,{}),transform?(dom.addEventListener(dragSourceElement,"touchstart",dragInitSlidee,{passive:!0}),window.ResizeObserver?initFrameResizeObserver():o.scrollWidth||dom.addEventListener(window,"resize",onResize,{passive:!0}),o.horizontal||dom.addEventListener(frame,"scroll",resetScroll,{passive:!0}),o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0})):o.horizontal&&o.mouseWheel&&dom.addEventListener(scrollSource,wheelEvent,scrollHandler,{passive:!0}),dom.addEventListener(frame,"click",onFrameClick,{passive:!0,capture:!0}),self.initialized=1,load(!0),self}});return scrollerFactory.prototype.slideBy=function(delta,immediate){delta&&this.slideTo(this._pos.dest+delta,immediate)},scrollerFactory.prototype.to=function(location,item,immediate){if("boolean"===type(item)&&(immediate=item,item=void 0),void 0===item)this.slideTo(this._pos[location],immediate);else{var itemPos=this.getPos(item);itemPos&&this.slideTo(itemPos[location],immediate,itemPos)}},scrollerFactory.prototype.toStart=function(item,immediate){this.to("start",item,immediate)},scrollerFactory.prototype.toEnd=function(item,immediate){this.to("end",item,immediate)},scrollerFactory.prototype.toCenter=function(item,immediate){this.to("center",item,immediate)},scrollerFactory.create=function(frame,options){var instance=new scrollerFactory(frame,options);return Promise.resolve(instance)},scrollerFactory}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.css b/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.css new file mode 100644 index 0000000000..88ce85b4e0 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.css @@ -0,0 +1 @@ +.searchFieldsInner{max-width:60em;margin:0 auto}.searchfields-icon{margin-top:.5em;margin-right:.5em;font-size:2em} \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js b/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js new file mode 100644 index 0000000000..9742df5f7c --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.js @@ -0,0 +1 @@ +define(["layoutManager","globalize","require","events","browser","alphaPicker","emby-input","flexStyles","material-icons","css!./searchfields"],function(layoutManager,globalize,require,events,browser,AlphaPicker){"use strict";function onSearchTimeout(){var instance=this,value=instance.nextSearchValue;value=(value||"").trim(),events.trigger(instance,"search",[value])}function triggerSearch(instance,value){instance.searchTimeout&&clearTimeout(instance.searchTimeout),instance.nextSearchValue=value,instance.searchTimeout=setTimeout(onSearchTimeout.bind(instance),300)}function onAlphaValueClicked(e){var value=e.detail.value,searchFieldsInstance=this,txtSearch=searchFieldsInstance.options.element.querySelector(".searchfields-txtSearch");if("backspace"===value){var val=txtSearch.value;txtSearch.value=val.length?val.substring(0,val.length-1):""}else txtSearch.value+=value;txtSearch.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}function initAlphaPicker(alphaPickerElement,instance){instance.alphaPicker=new AlphaPicker({element:alphaPickerElement,mode:"keyboard"}),alphaPickerElement.addEventListener("alphavalueclicked",onAlphaValueClicked.bind(instance))}function onSearchInput(e){var value=e.target.value,searchFieldsInstance=this;triggerSearch(searchFieldsInstance,value)}function embed(elem,instance,options){require(["text!./searchfields.template.html"],function(template){var html=globalize.translateDocument(template,"sharedcomponents");elem.innerHTML=html,elem.classList.add("searchFields");var txtSearch=elem.querySelector(".searchfields-txtSearch");if(layoutManager.tv){var alphaPickerElement=elem.querySelector(".alphaPicker");elem.querySelector(".alphaPicker").classList.remove("hide"),initAlphaPicker(alphaPickerElement,instance)}(browser.tizen||browser.orsay)&&(txtSearch.readOnly=!0),txtSearch.addEventListener("input",onSearchInput.bind(instance))})}function SearchFields(options){this.options=options,embed(options.element,this,options)}return SearchFields.prototype.focus=function(){this.options.element.querySelector(".searchfields-txtSearch").focus()},SearchFields.prototype.destroy=function(){var options=this.options;options&&options.element.classList.remove("searchFields"),this.options=null;var alphaPicker=this.alphaPicker;alphaPicker&&alphaPicker.destroy(),this.alphaPicker=null;var searchTimeout=this.searchTimeout;searchTimeout&&clearTimeout(searchTimeout),this.searchTimeout=null,this.nextSearchValue=null},SearchFields}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.template.html b/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.template.html new file mode 100644 index 0000000000..7f54d8ca29 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/search/searchfields.template.html @@ -0,0 +1,7 @@ +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/search/searchresults.js b/dashboard-ui/bower_components/emby-webcomponents/search/searchresults.js new file mode 100644 index 0000000000..788e8cfc7c --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/search/searchresults.js @@ -0,0 +1 @@ +define(["layoutManager","globalize","require","events","connectionManager","cardBuilder","embyRouter","emby-scroller","emby-itemscontainer"],function(layoutManager,globalize,require,events,connectionManager,cardBuilder,embyRouter){"use strict";function loadSuggestions(instance,context,apiClient){var options={SortBy:"IsFavoriteOrLiked,Random",IncludeItemTypes:"Movie,Series,MusicArtist",Limit:20,Recursive:!0,ImageTypeLimit:0,EnableImages:!1,ParentId:instance.options.parentId};apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var html=result.Items.map(function(i){var href=embyRouter.getRouteUrl(i),itemHtml='"}).join(""),searchSuggestions=context.querySelector(".searchSuggestions");searchSuggestions.querySelector(".searchSuggestionsList").innerHTML=html,searchSuggestions.classList.remove("hide")})}function getSearchHints(instance,apiClient,query){if(!query.searchTerm)return Promise.resolve({SearchHints:[]});var allowSearch=!0,queryIncludeItemTypes=query.IncludeItemTypes;return"tvshows"===instance.options.collectionType?query.IncludeArtists?allowSearch=!1:"Movie"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes||(allowSearch=!1):"movies"===instance.options.collectionType?query.IncludeArtists?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes||(allowSearch=!1):"music"===instance.options.collectionType?query.People?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"LiveTvProgram"!==queryIncludeItemTypes&&"Movie"!==queryIncludeItemTypes||(allowSearch=!1):"livetv"===instance.options.collectionType&&(query.IncludeArtists||query.IncludePeople?allowSearch=!1:"Series"!==queryIncludeItemTypes&&"Episode"!==queryIncludeItemTypes&&"MusicAlbum"!==queryIncludeItemTypes&&"Audio"!==queryIncludeItemTypes&&"Book"!==queryIncludeItemTypes&&"AudioBook"!==queryIncludeItemTypes&&"Movie"!==queryIncludeItemTypes&&"Video"!==query.MediaTypes||(allowSearch=!1)),"NullType"===queryIncludeItemTypes&&(allowSearch=!1),allowSearch?apiClient.getSearchHints(query):Promise.resolve({SearchHints:[]})}function search(instance,apiClient,context,value){value||layoutManager.tv?context.querySelector(".searchSuggestions").classList.add("hide"):loadSuggestions(instance,context,apiClient),"livetv"===instance.options.collectionType?searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsMovie:!0,IsKids:!1},context,".movieResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowPortrait":"portrait",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}):searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Movie"},context,".movieResults",{showTitle:!0,overlayText:!1,centerText:!0,showYear:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Series"},context,".seriesResults",{showTitle:!0,overlayText:!1,centerText:!0,showYear:!0}),"livetv"===instance.options.collectionType?searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsSeries:!0,IsSports:!1,IsKids:!1,IsNews:!1},context,".episodeResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}):searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Episode"},context,".episodeResults",{coverImage:!0,showTitle:!0,showParentTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsSports:!0},context,".sportsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"livetv"===instance.options.collectionType?"LiveTvProgram":"NullType",IsKids:!0},context,".kidsResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"LiveTvProgram",IsMovie:"livetv"!==instance.options.collectionType&&null,IsSeries:"livetv"!==instance.options.collectionType&&null,IsSports:"livetv"!==instance.options.collectionType&&null,IsKids:"livetv"!==instance.options.collectionType&&null},context,".programResults",{preferThumb:!0,inheritThumb:!1,shape:enableScrollX()?"overflowBackdrop":"backdrop",showParentTitleOrTitle:!0,showTitle:!1,centerText:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0,showAirTime:!0,showAirDateTime:!0,showChannelName:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,MediaTypes:"Video",ExcludeItemTypes:"Movie,Episode"},context,".videoResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!0,IncludeMedia:!1,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1},context,".peopleResults",{coverImage:!0,showTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!1,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!0},context,".artistResults",{coverImage:!0,showTitle:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"MusicAlbum"},context,".albumResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Audio"},context,".songResults",{showParentTitle:!0,showTitle:!0,overlayText:!1,centerText:!0,action:"play"}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"Book"},context,".bookResults",{showTitle:!0,overlayText:!1,centerText:!0}),searchType(instance,apiClient,{searchTerm:value,IncludePeople:!1,IncludeMedia:!0,IncludeGenres:!1,IncludeStudios:!1,IncludeArtists:!1,IncludeItemTypes:"AudioBook"},context,".audioBookResults",{showTitle:!0,overlayText:!1,centerText:!0})}function searchType(instance,apiClient,query,context,section,cardOptions){query.UserId=apiClient.getCurrentUserId(),query.Limit=enableScrollX()?24:16,query.ParentId=instance.options.parentId,getSearchHints(instance,apiClient,query).then(function(result){populateResults(result,context,section,cardOptions)})}function populateResults(result,context,section,cardOptions){section=context.querySelector(section);var items=result.SearchHints,itemsContainer=section.querySelector(".itemsContainer");cardBuilder.buildCards(items,Object.assign({itemsContainer:itemsContainer,parentContainer:section,shape:enableScrollX()?"autooverflow":"auto",scalable:!0,overlayText:!1,centerText:!0,allowBottomPadding:!enableScrollX()},cardOptions||{})),section.querySelector(".emby-scroller").scrollToBeginning(!0)}function enableScrollX(){return!layoutManager.desktop}function replaceAll(originalString,strReplace,strWith){var reg=new RegExp(strReplace,"ig");return originalString.replace(reg,strWith)}function embed(elem,instance,options){require(["text!./searchresults.template.html"],function(template){enableScrollX()||(template=replaceAll(template,'data-horizontal="true"','data-horizontal="false"'),template=replaceAll(template,"itemsContainer scrollSlider","itemsContainer scrollSlider vertical-wrap"));var html=globalize.translateDocument(template,"sharedcomponents");elem.innerHTML=html,elem.classList.add("searchResults"),instance.search("")})}function SearchResults(options){this.options=options,embed(options.element,this,options)}return SearchResults.prototype.search=function(value){var apiClient=connectionManager.getApiClient(this.options.serverId);search(this,apiClient,this.options.element,value)},SearchResults.prototype.destroy=function(){var options=this.options;options&&options.element.classList.remove("searchFields"),this.options=null},SearchResults}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/search/searchresults.template.html b/dashboard-ui/bower_components/emby-webcomponents/search/searchresults.template.html new file mode 100644 index 0000000000..52df41e1d1 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/search/searchresults.template.html @@ -0,0 +1,140 @@ +
    + +
    +

    ${Suggestions}

    +
    + +
    + +
    +
    + +
    +
    +

    ${Movies}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Shows}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Episodes}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Sports}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Kids}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Programs}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Videos}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Artists}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Albums}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Songs}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${HeaderAudioBooks}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${Books}

    +
    + +
    +
    +
    +
    + +
    +
    +

    ${People}

    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/sessionplayer.js b/dashboard-ui/bower_components/emby-webcomponents/sessionplayer.js index 67cf9a9656..a97162ee5b 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/sessionplayer.js +++ b/dashboard-ui/bower_components/emby-webcomponents/sessionplayer.js @@ -1 +1 @@ -define(["playbackManager","events","serverNotifications","connectionManager"],function(playbackManager,events,serverNotifications,connectionManager){"use strict";function getActivePlayerId(){var info=playbackManager.getPlayerInfo();return info?info.id:null}function sendPlayCommand(apiClient,options,playType){var sessionId=getActivePlayerId(),ids=options.ids||options.items.map(function(i){return i.Id}),remoteOptions={ItemIds:ids.join(","),PlayCommand:playType};return options.startPositionTicks&&(remoteOptions.startPositionTicks=options.startPositionTicks),apiClient.sendPlayCommand(sessionId,remoteOptions)}function sendPlayStateCommand(apiClient,command,options){var sessionId=getActivePlayerId();apiClient.sendPlayStateCommand(sessionId,command,options)}return function(){function getCurrentApiClient(){return currentServerId?connectionManager.getApiClient(currentServerId):connectionManager.currentApiClient()}function sendCommandByName(name,options){var command={Name:name};options&&(command.Arguments=options),self.sendCommand(command)}function onPollIntervalFired(){var apiClient=getCurrentApiClient();apiClient.isWebSocketOpen()||apiClient&&apiClient.getSessions().then(function(sessions){processUpdatedSessions(sessions,apiClient)})}function unsubscribeFromPlayerUpdates(){self.isUpdating=!0;var apiClient=getCurrentApiClient();apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SessionsStop"),pollInterval&&(clearInterval(pollInterval),pollInterval=null)}function getPlayerState(session){return session}function normalizeImages(state){if(state&&state.NowPlayingItem){var item=state.NowPlayingItem;item.ImageTags&&item.ImageTags.Primary||item.PrimaryImageTag&&(item.ImageTags=item.ImageTags||{},item.ImageTags.Primary=item.PrimaryImageTag),item.BackdropImageTag&&item.BackdropItemId===item.Id&&(item.BackdropImageTags=[item.BackdropImageTag]),item.BackdropImageTag&&item.BackdropItemId!==item.Id&&(item.ParentBackdropImageTags=[item.BackdropImageTag],item.ParentBackdropItemId=item.BackdropItemId)}}function firePlaybackEvent(name,session){var state=getPlayerState(session);normalizeImages(state),self.lastPlayerData=state,events.trigger(self,name,[state])}function processUpdatedSessions(sessions,apiClient){var serverId=apiClient.serverId();sessions.map(function(s){s.NowPlayingItem&&(s.NowPlayingItem.ServerId=serverId)});var currentTargetId=getActivePlayerId(),session=sessions.filter(function(s){return s.Id===currentTargetId})[0];session&&(firePlaybackEvent("statechange",session),firePlaybackEvent("timeupdate",session),firePlaybackEvent("pause",session))}var self=this;self.name="Remote Control",self.type="mediaplayer",self.isLocalPlayer=!1,self.id="remoteplayer";var currentServerId;self.sendCommand=function(command){var sessionId=getActivePlayerId(),apiClient=getCurrentApiClient();apiClient.sendCommand(sessionId,command)},self.play=function(options){var playOptions={};return playOptions.ids=options.ids||options.items.map(function(i){return i.Id}),options.startPositionTicks&&(playOptions.startPositionTicks=options.startPositionTicks),sendPlayCommand(getCurrentApiClient(),playOptions,"PlayNow")},self.shuffle=function(item){sendPlayCommand(getCurrentApiClient(),{ids:[item.Id]},"PlayShuffle")},self.instantMix=function(item){sendPlayCommand(getCurrentApiClient(),{ids:[item.Id]},"PlayInstantMix")},self.queue=function(options){sendPlayCommand(getCurrentApiClient(),options,"PlayNext")},self.queueNext=function(options){sendPlayCommand(getCurrentApiClient(),options,"PlayLast")},self.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},self.canQueueMediaType=function(mediaType){return self.canPlayMediaType(mediaType)},self.stop=function(){sendPlayStateCommand(getCurrentApiClient(),"stop")},self.nextTrack=function(){sendPlayStateCommand(getCurrentApiClient(),"nextTrack")},self.previousTrack=function(){sendPlayStateCommand(getCurrentApiClient(),"previousTrack")},self.seek=function(positionTicks){sendPlayStateCommand(getCurrentApiClient(),"seek",{SeekPositionTicks:positionTicks})},self.currentTime=function(val){if(null!=val)return self.seek(val);var state=self.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},self.duration=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},self.paused=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},self.getVolume=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.VolumeLevel},self.pause=function(){sendPlayStateCommand(getCurrentApiClient(),"Pause")},self.unpause=function(){sendPlayStateCommand(getCurrentApiClient(),"Unpause")},self.setMute=function(isMuted){sendCommandByName(isMuted?"Mute":"Unmute")},self.toggleMute=function(){sendCommandByName("ToggleMute")},self.setVolume=function(vol){sendCommandByName("SetVolume",{Volume:vol})},self.volumeUp=function(){sendCommandByName("VolumeUp")},self.volumeDown=function(){sendCommandByName("VolumeDown")},self.toggleFullscreen=function(){sendCommandByName("ToggleFullscreen")},self.audioTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},self.getAudioStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},self.setAudioStreamIndex=function(index){sendCommandByName("SetAudioStreamIndex",{Index:index})},self.subtitleTracks=function(){var state=self.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},self.getSubtitleStreamIndex=function(){var state=self.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},self.setSubtitleStreamIndex=function(index){sendCommandByName("SetSubtitleStreamIndex",{Index:index})},self.getMaxStreamingBitrate=function(){},self.setMaxStreamingBitrate=function(options){},self.isFullscreen=function(){},self.toggleFullscreen=function(){},self.getRepeatMode=function(){},self.setRepeatMode=function(mode){sendCommandByName("SetRepeatMode",{RepeatMode:mode})},self.displayContent=function(options){sendCommandByName("DisplayContent",options)},self.isPlaying=function(){var state=self.lastPlayerData||{};return null!=state.NowPlayingItem},self.isPlayingVideo=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},self.isPlayingAudio=function(){var state=self.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},self.getPlaylist=function(){return Promise.resolve([])},self.getCurrentPlaylistItemId=function(){},self.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},self.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},self.getPlayerState=function(){var apiClient=getCurrentApiClient();return apiClient?apiClient.getSessions().then(function(sessions){var currentTargetId=getActivePlayerId(),session=sessions.filter(function(s){return s.Id===currentTargetId})[0];return session&&(session=getPlayerState(session)),session}):Promise.resolve({})};var pollInterval;self.subscribeToPlayerUpdates=function(){self.isUpdating=!0;var apiClient=getCurrentApiClient();apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SessionsStart","100,800"),pollInterval&&(clearInterval(pollInterval),pollInterval=null),pollInterval=setInterval(onPollIntervalFired,5e3)};var playerListenerCount=0;self.beginPlayerUpdates=function(){playerListenerCount<=0&&(playerListenerCount=0,self.subscribeToPlayerUpdates()),playerListenerCount++},self.endPlayerUpdates=function(){playerListenerCount--,playerListenerCount<=0&&(unsubscribeFromPlayerUpdates(),playerListenerCount=0)},self.getTargets=function(){var apiClient=getCurrentApiClient(),sessionQuery={ControllableByUserId:apiClient.getCurrentUserId()};return apiClient?apiClient.getSessions(sessionQuery).then(function(sessions){return sessions.filter(function(s){return s.DeviceId!==apiClient.deviceId()}).map(function(s){return{name:s.DeviceName,deviceName:s.DeviceName,id:s.Id,playerName:self.name,appName:s.Client,playableMediaTypes:s.PlayableMediaTypes,isLocalPlayer:!1,supportedCommands:s.SupportedCommands}})}):Promise.resolve([])},self.tryPair=function(target){return Promise.resolve()},events.on(serverNotifications,"Sessions",function(e,apiClient,data){processUpdatedSessions(data,apiClient)}),events.on(serverNotifications,"SessionEnded",function(e,apiClient,data){console.log("Server reports another session ended"),getActivePlayerId()===data.Id&&playbackManager.setDefaultPlayerActive()}),events.on(serverNotifications,"PlaybackStart",function(e,apiClient,data){data.DeviceId!==apiClient.deviceId()&&getActivePlayerId()===data.Id&&firePlaybackEvent("playbackstart",data)}),events.on(serverNotifications,"PlaybackStopped",function(e,apiClient,data){data.DeviceId!==apiClient.deviceId()&&getActivePlayerId()===data.Id&&firePlaybackEvent("playbackstop",data)})}}); \ No newline at end of file +define(["playbackManager","events","serverNotifications","connectionManager"],function(playbackManager,events,serverNotifications,connectionManager){"use strict";function getActivePlayerId(){var info=playbackManager.getPlayerInfo();return info?info.id:null}function sendPlayCommand(apiClient,options,playType){var sessionId=getActivePlayerId(),ids=options.ids||options.items.map(function(i){return i.Id}),remoteOptions={ItemIds:ids.join(","),PlayCommand:playType};return options.startPositionTicks&&(remoteOptions.startPositionTicks=options.startPositionTicks),apiClient.sendPlayCommand(sessionId,remoteOptions)}function sendPlayStateCommand(apiClient,command,options){var sessionId=getActivePlayerId();apiClient.sendPlayStateCommand(sessionId,command,options)}function getCurrentApiClient(instance){var currentServerId=instance.currentServerId;return currentServerId?connectionManager.getApiClient(currentServerId):connectionManager.currentApiClient()}function sendCommandByName(instance,name,options){var command={Name:name};options&&(command.Arguments=options),instance.sendCommand(command)}function unsubscribeFromPlayerUpdates(instance){instance.isUpdating=!0;var apiClient=getCurrentApiClient(instance);apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SessionsStop"),instance.pollInterval&&(clearInterval(instance.pollInterval),instance.pollInterval=null)}function processUpdatedSessions(instance,sessions,apiClient){var serverId=apiClient.serverId();sessions.map(function(s){s.NowPlayingItem&&(s.NowPlayingItem.ServerId=serverId)});var currentTargetId=getActivePlayerId(),session=sessions.filter(function(s){return s.Id===currentTargetId})[0];session&&(firePlaybackEvent(instance,"statechange",session,apiClient),firePlaybackEvent(instance,"timeupdate",session,apiClient),firePlaybackEvent(instance,"pause",session,apiClient))}function onPollIntervalFired(){var instance=this,apiClient=getCurrentApiClient(instance);apiClient.isWebSocketOpen()||apiClient&&apiClient.getSessions().then(function(sessions){processUpdatedSessions(instance,sessions,apiClient)})}function subscribeToPlayerUpdates(instance){instance.isUpdating=!0;var apiClient=getCurrentApiClient(instance);apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SessionsStart","100,800"),instance.pollInterval&&(clearInterval(instance.pollInterval),instance.pollInterval=null),instance.pollInterval=setInterval(onPollIntervalFired.bind(instance),5e3)}function getPlayerState(session){return session}function normalizeImages(state,apiClient){if(state&&state.NowPlayingItem){var item=state.NowPlayingItem;item.ImageTags&&item.ImageTags.Primary||item.PrimaryImageTag&&(item.ImageTags=item.ImageTags||{},item.ImageTags.Primary=item.PrimaryImageTag),item.BackdropImageTag&&item.BackdropItemId===item.Id&&(item.BackdropImageTags=[item.BackdropImageTag]),item.BackdropImageTag&&item.BackdropItemId!==item.Id&&(item.ParentBackdropImageTags=[item.BackdropImageTag],item.ParentBackdropItemId=item.BackdropItemId),item.ServerId||(item.ServerId=apiClient.serverId())}}function firePlaybackEvent(instance,name,session,apiClient){var state=getPlayerState(session);normalizeImages(state,apiClient),instance.lastPlayerData=state,events.trigger(instance,name,[state])}function SessionPlayer(){var self=this;this.name="Remote Control",this.type="mediaplayer",this.isLocalPlayer=!1,this.id="remoteplayer",events.on(serverNotifications,"Sessions",function(e,apiClient,data){processUpdatedSessions(self,data,apiClient)}),events.on(serverNotifications,"SessionEnded",function(e,apiClient,data){console.log("Server reports another session ended"),getActivePlayerId()===data.Id&&playbackManager.setDefaultPlayerActive()}),events.on(serverNotifications,"PlaybackStart",function(e,apiClient,data){data.DeviceId!==apiClient.deviceId()&&getActivePlayerId()===data.Id&&firePlaybackEvent(self,"playbackstart",data,apiClient)}),events.on(serverNotifications,"PlaybackStopped",function(e,apiClient,data){data.DeviceId!==apiClient.deviceId()&&getActivePlayerId()===data.Id&&firePlaybackEvent(self,"playbackstop",data,apiClient)})}return SessionPlayer.prototype.beginPlayerUpdates=function(){this.playerListenerCount=this.playerListenerCount||0,this.playerListenerCount<=0&&(this.playerListenerCount=0,subscribeToPlayerUpdates(this)),this.playerListenerCount++},SessionPlayer.prototype.endPlayerUpdates=function(){this.playerListenerCount=this.playerListenerCount||0,this.playerListenerCount--,this.playerListenerCount<=0&&(unsubscribeFromPlayerUpdates(this),this.playerListenerCount=0)},SessionPlayer.prototype.getPlayerState=function(){var apiClient=getCurrentApiClient(this);return apiClient?apiClient.getSessions().then(function(sessions){var currentTargetId=getActivePlayerId(),session=sessions.filter(function(s){return s.Id===currentTargetId})[0];return session&&(session=getPlayerState(session)),session}):Promise.resolve({})},SessionPlayer.prototype.getTargets=function(){var apiClient=getCurrentApiClient(this),sessionQuery={ControllableByUserId:apiClient.getCurrentUserId()};if(apiClient){var name=this.name;return apiClient.getSessions(sessionQuery).then(function(sessions){return sessions.filter(function(s){return s.DeviceId!==apiClient.deviceId()}).map(function(s){return{name:s.DeviceName,deviceName:s.DeviceName,id:s.Id,playerName:name,appName:s.Client,playableMediaTypes:s.PlayableMediaTypes,isLocalPlayer:!1,supportedCommands:s.SupportedCommands}})})}return Promise.resolve([])},SessionPlayer.prototype.sendCommand=function(command){var sessionId=getActivePlayerId(),apiClient=getCurrentApiClient(this);apiClient.sendCommand(sessionId,command)},SessionPlayer.prototype.play=function(options){var playOptions={};return playOptions.ids=options.ids||options.items.map(function(i){return i.Id}),options.startPositionTicks&&(playOptions.startPositionTicks=options.startPositionTicks),sendPlayCommand(getCurrentApiClient(this),playOptions,"PlayNow")},SessionPlayer.prototype.shuffle=function(item){sendPlayCommand(getCurrentApiClient(this),{ids:[item.Id]},"PlayShuffle")},SessionPlayer.prototype.instantMix=function(item){sendPlayCommand(getCurrentApiClient(this),{ids:[item.Id]},"PlayInstantMix")},SessionPlayer.prototype.queue=function(options){sendPlayCommand(getCurrentApiClient(this),options,"PlayNext")},SessionPlayer.prototype.queueNext=function(options){sendPlayCommand(getCurrentApiClient(this),options,"PlayLast")},SessionPlayer.prototype.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},SessionPlayer.prototype.canQueueMediaType=function(mediaType){return this.canPlayMediaType(mediaType)},SessionPlayer.prototype.stop=function(){sendPlayStateCommand(getCurrentApiClient(this),"stop")},SessionPlayer.prototype.nextTrack=function(){sendPlayStateCommand(getCurrentApiClient(this),"nextTrack")},SessionPlayer.prototype.previousTrack=function(){sendPlayStateCommand(getCurrentApiClient(this),"previousTrack")},SessionPlayer.prototype.seek=function(positionTicks){sendPlayStateCommand(getCurrentApiClient(this),"seek",{SeekPositionTicks:positionTicks})},SessionPlayer.prototype.currentTime=function(val){if(null!=val)return this.seek(val);var state=this.lastPlayerData||{};return state=state.PlayState||{},state.PositionTicks},SessionPlayer.prototype.duration=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},state.RunTimeTicks},SessionPlayer.prototype.paused=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.IsPaused},SessionPlayer.prototype.getVolume=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.VolumeLevel},SessionPlayer.prototype.pause=function(){sendPlayStateCommand(getCurrentApiClient(this),"Pause")},SessionPlayer.prototype.unpause=function(){sendPlayStateCommand(getCurrentApiClient(this),"Unpause")},SessionPlayer.prototype.playPause=function(){this.paused()?this.unpause():this.pause()},SessionPlayer.prototype.setMute=function(isMuted){isMuted?sendCommandByName(this,"Mute"):sendCommandByName(this,"Unmute")},SessionPlayer.prototype.toggleMute=function(){sendCommandByName(this,"ToggleMute")},SessionPlayer.prototype.setVolume=function(vol){sendCommandByName(this,"SetVolume",{Volume:vol})},SessionPlayer.prototype.volumeUp=function(){sendCommandByName(this,"VolumeUp")},SessionPlayer.prototype.volumeDown=function(){sendCommandByName(this,"VolumeDown")},SessionPlayer.prototype.toggleFullscreen=function(){sendCommandByName(this,"ToggleFullscreen")},SessionPlayer.prototype.audioTracks=function(){var state=this.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Audio"===s.Type})},SessionPlayer.prototype.getAudioStreamIndex=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.AudioStreamIndex},SessionPlayer.prototype.setAudioStreamIndex=function(index){sendCommandByName(this,"SetAudioStreamIndex",{Index:index})},SessionPlayer.prototype.subtitleTracks=function(){var state=this.lastPlayerData||{};state=state.NowPlayingItem||{};var streams=state.MediaStreams||[];return streams.filter(function(s){return"Subtitle"===s.Type})},SessionPlayer.prototype.getSubtitleStreamIndex=function(){var state=this.lastPlayerData||{};return state=state.PlayState||{},state.SubtitleStreamIndex},SessionPlayer.prototype.setSubtitleStreamIndex=function(index){sendCommandByName(this,"SetSubtitleStreamIndex",{Index:index})},SessionPlayer.prototype.getMaxStreamingBitrate=function(){},SessionPlayer.prototype.setMaxStreamingBitrate=function(options){},SessionPlayer.prototype.isFullscreen=function(){},SessionPlayer.prototype.toggleFullscreen=function(){},SessionPlayer.prototype.getRepeatMode=function(){},SessionPlayer.prototype.setRepeatMode=function(mode){sendCommandByName(this,"SetRepeatMode",{RepeatMode:mode})},SessionPlayer.prototype.displayContent=function(options){sendCommandByName(this,"DisplayContent",options)},SessionPlayer.prototype.isPlaying=function(){var state=this.lastPlayerData||{};return null!=state.NowPlayingItem},SessionPlayer.prototype.isPlayingVideo=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},"Video"===state.MediaType},SessionPlayer.prototype.isPlayingAudio=function(){var state=this.lastPlayerData||{};return state=state.NowPlayingItem||{},"Audio"===state.MediaType},SessionPlayer.prototype.getPlaylist=function(){return Promise.resolve([])},SessionPlayer.prototype.getCurrentPlaylistItemId=function(){},SessionPlayer.prototype.setCurrentPlaylistItem=function(playlistItemId){return Promise.resolve()},SessionPlayer.prototype.removeFromPlaylist=function(playlistItemIds){return Promise.resolve()},SessionPlayer.prototype.tryPair=function(target){return Promise.resolve()},SessionPlayer}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json index 952814b48e..672627eafc 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ar.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "\u0627\u0644\u063a\u0627\u0621", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json b/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json index 54493b8447..323c02a445 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/bg-bg.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "\u041e\u0442\u043c\u0435\u043d\u0438", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "\u041e\u0442\u0434\u0435\u043b\u0435\u0442\u0435 \u043d\u044f\u043a\u043e\u043b\u043a\u043e \u0441 ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json index cbcd2d8dc7..29100c9076 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ca.json @@ -15,13 +15,6 @@ "ItemCount": "{0} \u00edtems", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Diu", - "OptionMondayShort": "Dil", - "OptionTuesdayShort": "Dim", - "OptionWednesdayShort": "Dmc", - "OptionThursdayShort": "Dij", - "OptionFridayShort": "Div", - "OptionSaturdayShort": "Dis", "HeaderSelectDate": "Seleccionar Data", "ButtonOk": "D'acord", "ButtonCancel": "Cancel\u00b7la", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separa'n varis emprant ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "\u00c0lbum:", + "Artists": "Artists", "LabelCommunityRating": "Valoraci\u00f3 de la comunitat:", "LabelVoteCount": "Recompte de vots:", "LabelCriticRating": "Valoraci\u00f3 cr\u00edtica:", - "LabelCriticRatingSummary": "Resum de la valoraci\u00f3 cr\u00edtica:", "LabelAwardSummary": "Resum de premis:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 v\u00eddeo musical", "ValueMusicVideoCount": "{0} v\u00eddeos musicals", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "\u00cdtem desat.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sincronitza a un altre dispositiu", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Prefer\u00e8ncies", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json b/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json index 76506b6b6c..4cfec19013 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/cs.json @@ -15,13 +15,6 @@ "ItemCount": "{0} polo\u017eek", "OriginalAirDateValue": "Datum vys\u00edl\u00e1n\u00ed origin\u00e1lu: {0}", "EndsAtValue": "Kon\u010d\u00ed v {0}", - "OptionSundayShort": "Ned", - "OptionMondayShort": "Pon", - "OptionTuesdayShort": "\u00date", - "OptionWednesdayShort": "St\u0159", - "OptionThursdayShort": "\u010ctv", - "OptionFridayShort": "P\u00e1t", - "OptionSaturdayShort": "Sob", "HeaderSelectDate": "Vyber datum", "ButtonOk": "Ok", "ButtonCancel": "Zru\u0161it", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline m\u00e9dia", "HeaderOfflineDownloadsDescription": "St\u00e1hnout m\u00e9dia do va\u0161eho za\u0159\u00edzen\u00ed pro snadn\u00e9 pou\u017eit\u00ed offline.", "CloudSyncFeatureDescription": "Synchronizujte va\u0161e m\u00e9dia na cloud pro jednodu\u0161\u0161\u00ed z\u00e1lohov\u00e1n\u00ed, archivaci a konverzi.", - "CoverArtFeatureDescription": "Cover Art vytv\u00e1\u0159\u00ed z\u00e1bavn\u00e9 obaly a dal\u0161\u00ed mo\u017enosti \u00faprav, kter\u00e9 v\u00e1m pomohou p\u0159izp\u016fsobit va\u0161e medi\u00e1ln\u00ed obr\u00e1zky.", - "CoverArt": "Obal", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Zru\u0161it synchronizaci", "CancelSyncJobConfirmation": "Zru\u0161en\u00edm synchronizace budou odstran\u011bny ji\u017e synchronizovan\u00e1 media ze za\u0159\u00edzen\u00ed b\u011bhem dal\u0161\u00edho synchroniza\u010dn\u00edho procesu. Chcete opravdu pokra\u010dovat?", "CinemaModeFeatureDescription": "S re\u017eimem Kino z\u00edskate funkci, kter\u00e1 p\u0159ed hlavn\u00edm programem p\u0159ehraje trailery a u\u017eivatelsk\u00e1 intra.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Odd\u011bl pomoc\u00ed ;", "LabelAlbumArtists": "Alba \u00fam\u011blce:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Hodnocen\u00ed komunity:", "LabelVoteCount": "Po\u010det hlas\u016f:", "LabelCriticRating": "Hodnocen\u00ed kritik\u016f:", - "LabelCriticRatingSummary": "Shrnut\u00ed hodnocen\u00ed kritik\u016f:", "LabelAwardSummary": "P\u0159ehled ocen\u011bn\u00ed:", "LabelWebsite": "Webov\u00e9 str\u00e1nky:", "LabelTagline": "Slogan:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 hudebn\u00ed klip", "ValueMusicVideoCount": "{0} hudebn\u00edch klip\u016f", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Zadejte jedno nebo v\u00edce vyhled\u00e1vac\u00edch krit\u00e9ri\u00ed. Odstra\u0148te krit\u00e9ria pro vyhled\u00e1n\u00ed v\u00edce v\u00fdsledk\u016f.", "PleaseEnterNameOrId": "Pros\u00edm, zadejte n\u00e1zev nebo extern\u00ed Id.", "MessageItemSaved": "Polo\u017eka ulo\u017eena.", "SearchResults": "V\u00fdsledky vyhled\u00e1v\u00e1n\u00ed", - "SyncToOtherDevice": "Synchronizovat na dal\u0161\u00ed za\u0159\u00edzen\u00ed", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Zp\u0159\u00edstupnit offline", "ServerNameIsRestarting": "Emby Server - {0} je restartov\u00e1n.", "ServerNameIsShuttingDown": "Emby Server - {0} je vyp\u00edn\u00e1n.", @@ -290,7 +286,9 @@ "Settings": "Nastaven\u00ed", "ShowIndicatorsFor": "Zobrazit indik\u00e1tor pro:", "NewEpisodes": "Nov\u00e9 episody", + "Episodes": "Episodes", "HDPrograms": "HD programy", + "Programs": "Programs", "LiveBroadcasts": "P\u0159\u00edm\u00e9 p\u0159enosy", "Premieres": "Premi\u00e9ry", "RepeatEpisodes": "Opakovan\u00ed epizod", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/da.json b/dashboard-ui/bower_components/emby-webcomponents/strings/da.json index b8d155cb5b..314154d890 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/da.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/da.json @@ -15,13 +15,6 @@ "ItemCount": "{0} elementer", "OriginalAirDateValue": "Originalt sendt: {0}", "EndsAtValue": "Slutter {0}", - "OptionSundayShort": "S\u00f8n.", - "OptionMondayShort": "Man.", - "OptionTuesdayShort": "Tirs.", - "OptionWednesdayShort": "Ons.", - "OptionThursdayShort": "Tors.", - "OptionFridayShort": "Fre.", - "OptionSaturdayShort": "L\u00f8r.", "HeaderSelectDate": "V\u00e6lg dato", "ButtonOk": "Ok", "ButtonCancel": "Annuller", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Medie", "HeaderOfflineDownloadsDescription": "Download medier til dine enheder for nem offline-brug.", "CloudSyncFeatureDescription": "Synk dine medier til skyen for nem backup, arkivering og konvertering.", - "CoverArtFeatureDescription": "Cover Art opretter sjove covers og andre \u00e6ndringer for at personalisere dine mediebilleder.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Annull\u00e9r synk", "CancelSyncJobConfirmation": "Annullering af synk-jobbet fjerner synkroniserede medier fra enheden under n\u00e6ste synk. Er du sikker p\u00e5 at du vil forts\u00e6tte?", "CinemaModeFeatureDescription": "Biograftilstand giver dig den \u00e6gte biografoplevelse med trailers og brugertilpassede introer, f\u00f8r selve filmen.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Angiv flere ved at s\u00e6tte ; mellem dem.", "LabelAlbumArtists": "Albumartister:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "F\u00e6llesskabsvurdering:", "LabelVoteCount": "Antal stemmer:", "LabelCriticRating": "Kritikervurdering:", - "LabelCriticRatingSummary": "Resum\u00e9 af kritikervurderinger:", "LabelAwardSummary": "Resum\u00e9 af priser:", "LabelWebsite": "Hjemmeside:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 musikvideo", "ValueMusicVideoCount": "{0} musikvideoer", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Indtast et eller flere s\u00f8gekriterier.Fjern kriterier for at f\u00e5 flere s\u00f8geresultater.", "PleaseEnterNameOrId": "Indtast venligst et navn eller eksternt Id.", "MessageItemSaved": "Element gemt.", "SearchResults": "S\u00f8geresultater", - "SyncToOtherDevice": "Synk til anden enhed", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "G\u00f8r tilg\u00e6ngelig offline", "ServerNameIsRestarting": "Emby Server - {0} genstarter.", "ServerNameIsShuttingDown": "Emby Server - {0} lukker ned.", @@ -290,7 +286,9 @@ "Settings": "Indstillinger", "ShowIndicatorsFor": "Vis indikatorer for:", "NewEpisodes": "Nye episoder", + "Episodes": "Episodes", "HDPrograms": "HD-programmer", + "Programs": "Programs", "LiveBroadcasts": "Live-udsending", "Premieres": "Premiere", "RepeatEpisodes": "Gentag episoder", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/de.json b/dashboard-ui/bower_components/emby-webcomponents/strings/de.json index 3f0b77b6f2..596bf8d3ed 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/de.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/de.json @@ -15,13 +15,6 @@ "ItemCount": "{0} Eintr\u00e4ge", "OriginalAirDateValue": "Erstausstrahlung: {0}", "EndsAtValue": "Endet um {0}", - "OptionSundayShort": "So", - "OptionMondayShort": "Mo", - "OptionTuesdayShort": "Di", - "OptionWednesdayShort": "Mi", - "OptionThursdayShort": "Do", - "OptionFridayShort": "Fr", - "OptionSaturdayShort": "Sa", "HeaderSelectDate": "Datum w\u00e4hlen", "ButtonOk": "Ok", "ButtonCancel": "Abbrechen", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Medien", "HeaderOfflineDownloadsDescription": "Lade Medien auf deine Ger\u00e4te herunter um sie einfach offline zu nutzen.", "CloudSyncFeatureDescription": "Synchronisiere deine Medien in die Cloud f\u00fcr ein Backup, eine Archivierung und Konvertierung.", - "CoverArtFeatureDescription": "Cover Art erstellt z.B. lustige Cover und erlaubt dir eine weitergehende pers\u00f6nliche Gestaltung deiner Medienbilder.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Plane individuelle Aufnahmen von Live-TV, Serien und mehr mit Emby DVR.", "ButtonCancelSyncJob": "Download abbrechen", "CancelSyncJobConfirmation": "Der Abbruch der Synchronisation wird bereits heruntergeladene Medien bei der n\u00e4chsten Synchronisation vom Ger\u00e4t l\u00f6schen. M\u00f6chtest du wirklich fortfahren?", "CinemaModeFeatureDescription": "Der Cinema Mode bringt das richtige Kinogef\u00fchl mit Trailern und eigenen Intros vor dem Hauptfilm.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Trenne mehrere Eintr\u00e4ge durch ;", "LabelAlbumArtists": "Alben Interpreten:", "LabelAlbum": "Album:", + "Artists": "Interpreten", "LabelCommunityRating": "Community Bewertung:", "LabelVoteCount": "Stimmen:", "LabelCriticRating": "Kritiker Bewertung:", - "LabelCriticRatingSummary": "Kritikerbewertungen:", "LabelAwardSummary": "Auszeichnungen:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 Musikvideo", "ValueMusicVideoCount": "{0} Musikvideos", "ValueMinutes": "{0} Minuten", + "Albums": "Alben", + "Songs": "Songs", + "Books": "B\u00fccher", + "HeaderAudioBooks": "H\u00f6rb\u00fccher", "HeaderIdentifyItemHelp": "Gib ein oder mehrere Suchkriterien ein. Entferne Kriterien um die Suchergebnisse zu erweitern.", "PleaseEnterNameOrId": "Bitte gib einen Namen oder eine externe Id an.", "MessageItemSaved": "Element gespeichert", "SearchResults": "Suchergebnisse", - "SyncToOtherDevice": "Mit einem anderen Ger\u00e4t synchronisieren", + "DownloadToOtherDevice": "Auf ein anderes Ger\u00e4t herunterladen", "MakeAvailableOffline": "Offline verf\u00fcgbar machen", "ServerNameIsRestarting": "Emby Server - {0} startet neu.", "ServerNameIsShuttingDown": "Emby Server - {0} f\u00e4hrt herunter.", @@ -290,7 +286,9 @@ "Settings": "Einstellungen", "ShowIndicatorsFor": "Zeige Indikatoren f\u00fcr:", "NewEpisodes": "Neue Episoden", + "Episodes": "Episoden", "HDPrograms": "HD Programme", + "Programs": "Programme", "LiveBroadcasts": "Live\u00fcbertragungen", "Premieres": "Premieren", "RepeatEpisodes": "Wiederholung Episoden", @@ -425,10 +423,13 @@ "Suggestions": "Empfehlungen", "Favorites": "Favoriten", "Collections": "Sammlungen", - "LabelSelectFolderGroups": "Automatically group content from the following folders into views such as Movies, Music and TV:", - "LabelSelectFolderGroupsHelp": "Folders that are unchecked will be displayed by themselves in their own view.", + "LabelSelectFolderGroups": "Gruppiere Inhalte von folgenden Verzeichnissen automatisch zu Ansichten wie beispielsweise Filme, Musik und TV:", + "LabelSelectFolderGroupsHelp": "Verzeichnisse die nicht markiert sind werden alleine mit ihren eigenen Ansichten angezeigt.", "Shows": "Serien", - "HeaderLibraryFolders": "Library Folders", + "HeaderLibraryFolders": "Bibliotheksverzeichnisse", "HeaderLandingScreens": "Einstiegsbildschirme", - "LandingScreensHelp": "W\u00e4hle den Standard-Einstiegsbildschirm bei Klick auf eine Bibliothek." + "LandingScreensHelp": "W\u00e4hle den Standard-Einstiegsbildschirm bei Klick auf eine Bibliothek.", + "HeaderTermsOfPurchase": "Bestellungsbedingungen", + "PrivacyPolicy": "Datenschutzbestimmungen", + "TermsOfUse": "Nutzungsbedingungen" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/el.json b/dashboard-ui/bower_components/emby-webcomponents/strings/el.json index b1778219c8..513d6191dd 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/el.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/el.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "\u039a\u03c5\u03c1", - "OptionMondayShort": "\u0394\u03b5\u03c5", - "OptionTuesdayShort": "\u03a4\u03c1\u03b9", - "OptionWednesdayShort": "\u03a4\u03b5\u03c4", - "OptionThursdayShort": "\u03a0\u03b5\u03bc", - "OptionFridayShort": "\u03a0\u03b1\u03c1", - "OptionSaturdayShort": "\u03a3\u03b1\u03b2", "HeaderSelectDate": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u0397\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1\u03c2", "ButtonOk": "Ok", "ButtonCancel": "\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7 ", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json index e4a9dc7a8a..b2ae5bc8e7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-gb.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalise your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel sync", "CancelSyncJobConfirmation": "Cancelling the sync job will remove synced media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external ID.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programmes", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json index 63d916aa51..d302dbb9e7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-us.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json b/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json index b92844d4ac..865dfe445a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/es-ar.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json b/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json index 47400e37a3..f82047ceac 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/es-mx.json @@ -15,13 +15,6 @@ "ItemCount": "{0} \u00edtems", "OriginalAirDateValue": "Fecha de transmisi\u00f3n original: {0}", "EndsAtValue": "Termina a las {0}", - "OptionSundayShort": "Dom", - "OptionMondayShort": "Lun", - "OptionTuesdayShort": "Mar", - "OptionWednesdayShort": "Mie", - "OptionThursdayShort": "Jue", - "OptionFridayShort": "Vie", - "OptionSaturdayShort": "Sab", "HeaderSelectDate": "Seleccionar fecha", "ButtonOk": "Ok", "ButtonCancel": "Cancelar", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Medios sin conexion", "HeaderOfflineDownloadsDescription": "Descargue sus medios en su dispositivo para f\u00e1cil uso mientras esta desconectado.", "CloudSyncFeatureDescription": "Sincronice sus medios a la nube para un f\u00e1cil respaldo, archivo y conversi\u00f3n.", - "CoverArtFeatureDescription": "Cover Art crea divertidas caratulas y da otros tratamientos para ayudar a personalizar las im\u00e1genes de sus medios.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Programe grabaciones individuales de TV en Vivo, series, y mas con Emby DVR.", "ButtonCancelSyncJob": "Cancelar descarga", "CancelSyncJobConfirmation": "Cancelando el trabajo de sincronizaci\u00f3n eliminara los medios descargados del dispositivo durante el pr\u00f3ximo proceso de sincronizaci\u00f3n. \u00bfEsta seguro de que desea continuar?", "CinemaModeFeatureDescription": "El Modo Cine le da una verdadera experiencia de cine con trailers e intros personalizados antes de la funci\u00f3n.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separar m\u00faltiples empleando:", "LabelAlbumArtists": "Artistas del \u00e1lbum:", "LabelAlbum": "\u00c1lbum", + "Artists": "Artists", "LabelCommunityRating": "Calificaci\u00f3n de la comunidad:", "LabelVoteCount": "Cantidad de votos:", "LabelCriticRating": "Calificaci\u00f3n de la cr\u00edtica:", - "LabelCriticRatingSummary": "Res\u00famen de la calificaci\u00f3n de la cr\u00edtica:", "LabelAwardSummary": "Res\u00famen de premios:", "LabelWebsite": "Sitio web:", "LabelTagline": "Eslogan", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 video musical", "ValueMusicVideoCount": "{0} videos musicales", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Introduzca uno o m\u00e1s criterios de b\u00fasqueda. Elimine criterios para expandir los resultados.", "PleaseEnterNameOrId": "Por favor introduzca un nombre o id externo.", "MessageItemSaved": "\u00cdtem guardado.", "SearchResults": "Resultados de la b\u00fasqueda", - "SyncToOtherDevice": "Sincronizar a otro dispositivo", + "DownloadToOtherDevice": "Descargar a otro dispositivo", "MakeAvailableOffline": "Hacer disponible sin conexi\u00f3n", "ServerNameIsRestarting": "El Servidor Emby - {0} se esta reiniciando.", "ServerNameIsShuttingDown": "El Servidor Emby - {0} se esta apagando.", @@ -290,7 +286,9 @@ "Settings": "Configuraci\u00f3n", "ShowIndicatorsFor": "Mostrar indicadores para:", "NewEpisodes": "Episodios nuevos", + "Episodes": "Episodes", "HDPrograms": "Programas en HD", + "Programs": "Programs", "LiveBroadcasts": "Transmisiones en vivo", "Premieres": "Estrenos", "RepeatEpisodes": "Repetir episodios", @@ -428,7 +426,10 @@ "LabelSelectFolderGroups": "Agrupar autom\u00e1ticamente el contenido de las siguientes carpetas en vistas tales como Pel\u00edculas, M\u00fasica y TV:", "LabelSelectFolderGroupsHelp": "Las carpetas sin marcar ser\u00e1n mostradas individualmente en su propia vista.", "Shows": "Programas", - "HeaderLibraryFolders": "Library Folders", + "HeaderLibraryFolders": "Carpetas de Biblioteca", "HeaderLandingScreens": "Pantallas de Llegada", - "LandingScreensHelp": "Seleccione la pantalla de llegada por defecto al dar clic sobre una biblioteca." + "LandingScreensHelp": "Seleccione la pantalla de llegada por defecto al dar clic sobre una biblioteca.", + "HeaderTermsOfPurchase": "T\u00e9rminos de Compra", + "PrivacyPolicy": "Pol\u00edtica de privacidad", + "TermsOfUse": "T\u00e9rminos de uso" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/es.json b/dashboard-ui/bower_components/emby-webcomponents/strings/es.json index 4b86c2efca..f83fa550fe 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/es.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/es.json @@ -15,13 +15,6 @@ "ItemCount": "\u00edtems {0}", "OriginalAirDateValue": "Fecha de emisi\u00f3n original: {0}", "EndsAtValue": "Termina a las {0}", - "OptionSundayShort": "Dom", - "OptionMondayShort": "Lun", - "OptionTuesdayShort": "Mar", - "OptionWednesdayShort": "Mie", - "OptionThursdayShort": "Jue", - "OptionFridayShort": "Vie", - "OptionSaturdayShort": "S\u00e1b", "HeaderSelectDate": "Seleccionar Fecha", "ButtonOk": "Ok", "ButtonCancel": "Cancelar", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separar multiples usando ;", "LabelAlbumArtists": "Artistas de los \u00e1lbumes", "LabelAlbum": "\u00c1lbum", + "Artists": "Artists", "LabelCommunityRating": "Puntuaci\u00f3n de la comunidad", "LabelVoteCount": "Contador de votos:", "LabelCriticRating": "Valoraci\u00f3n de la cr\u00edtica:", - "LabelCriticRatingSummary": "Resumen de la valoraci\u00f3n de la cr\u00edtica:", "LabelAwardSummary": "Resumen de premios:", "LabelWebsite": "Sitio web:", "LabelTagline": "Lema:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 v\u00eddeo musical", "ValueMusicVideoCount": "{0} v\u00eddeos musicales", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Asigna uno o m\u00e1s criterios de b\u00fasqueda. Quita criterios para aumentar el n\u00famero de resultados de b\u00fasqueda", "PleaseEnterNameOrId": "Introduzca un nombre o un identificador externo.", "MessageItemSaved": "Elemento grabado.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Ajustes", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json b/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json index 0fe71f5c88..98cde245f9 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/fi.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Lopeta", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json b/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json index 8080c6b898..0226318a57 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/fr-ca.json @@ -15,13 +15,6 @@ "ItemCount": "{0} articles", "OriginalAirDateValue": "Date de diffusion originale: {0}", "EndsAtValue": "Se termine \u00e0 {0}", - "OptionSundayShort": "Dim", - "OptionMondayShort": "Lun", - "OptionTuesdayShort": "Mar", - "OptionWednesdayShort": "Mer", - "OptionThursdayShort": "Jeu", - "OptionFridayShort": "Ven", - "OptionSaturdayShort": "Sam", "HeaderSelectDate": "S\u00e9lectionner une date", "ButtonOk": "Ok", "ButtonCancel": "Annuler", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "M\u00e9dia hors ligne", "HeaderOfflineDownloadsDescription": "T\u00e9l\u00e9chargez le m\u00e9dia sur vos appareils pour une utilisation hors ligne facile.", "CloudSyncFeatureDescription": "Synchronisez vos m\u00e9dias avec le Cloud pour faciliter la sauvegarde, l'archivage et la conversion.", - "CoverArtFeatureDescription": "Covert Art cr\u00e9e des couvertures amusantes et d'autres traitements pour vous aider \u00e0 personnaliser vos images multim\u00e9dias.", - "CoverArt": "Covert Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Annuler la synchronisation", "CancelSyncJobConfirmation": "L'annulation de la t\u00e2che de synchronisation supprimera le support synchronis\u00e9 du p\u00e9riph\u00e9rique pendant le prochain processus de synchronisation. \u00cates-vous s\u00fbr de vouloir continuer?", "CinemaModeFeatureDescription": "Le Mode Cin\u00e9ma vous donne la v\u00e9ritable exp\u00e9rience cin\u00e9matographique avec des bandes annonces et des intros personnalis\u00e9s avant le film.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -353,7 +351,7 @@ "HeaderUnlockFeature": "Unlock Feature", "MessageDidYouKnowCinemaMode": "Did you know that with Emby Premiere, you can enhance your experience with features like Cinema Mode?", "MessageDidYouKnowCinemaMode2": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the main feature.", - "HeaderPlayMyMedia": "Play my Media", + "HeaderPlayMyMedia": "Jouer mon m\u00e9dia", "HeaderDiscoverEmbyPremiere": "Discover Emby Premiere", "Items": "Items", "OneChannel": "One channel", @@ -393,16 +391,16 @@ "Accept": "Accept", "Reject": "Reject", "Connect": "Connect", - "HeaderMyMedia": "My Media", - "HeaderMyMediaSmall": "My Media (small)", + "HeaderMyMedia": "Mes M\u00e9dias", + "HeaderMyMediaSmall": "Mes m\u00e9dias (petit)", "LatestFromLibrary": "Latest {0}", "HeaderLatestChannelMedia": "Latest Channel Items", - "HeaderContinueWatching": "Continue Watching", + "HeaderContinueWatching": "Continuer \u00e0 regarder", "HeaderContinueListening": "Continue Listening", "HeaderActiveRecordings": "Active Recordings", "HeaderLatestRecordings": "Latest Recordings", "LabelDownloadTo": "Download to:", - "HeaderNextUp": "Next Up", + "HeaderNextUp": "\u00c0 Suivre", "HeaderLatestFrom": "Latest from {0}", "LabelHomeScreenSectionValue": "Home screen section {0}:", "SettingsSaved": "Settings saved.", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json b/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json index c6b88855b3..462d5734fc 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/fr.json @@ -15,13 +15,6 @@ "ItemCount": "{0} \u00e9l\u00e9ments", "OriginalAirDateValue": "Date de diffusion originale: {0}", "EndsAtValue": "Se termine \u00e0 {0}", - "OptionSundayShort": "Dim", - "OptionMondayShort": "Lun", - "OptionTuesdayShort": "Mar", - "OptionWednesdayShort": "Mer", - "OptionThursdayShort": "Jeu", - "OptionFridayShort": "Ven", - "OptionSaturdayShort": "Sam", "HeaderSelectDate": "S\u00e9lectionnez la date", "ButtonOk": "OK", "ButtonCancel": "Annuler", @@ -43,13 +36,12 @@ "RecordSeries": "Enregistrer s\u00e9ries", "HeaderCinemaMode": "Mode Cin\u00e9ma", "HeaderCloudSync": "Synchronisation avec le cloud", - "HeaderDownloadedMedia": "Downloaded Media", - "Downloads": "Downloads", + "HeaderDownloadedMedia": "M\u00e9dia t\u00e9l\u00e9charg\u00e9", + "Downloads": "T\u00e9l\u00e9chargements", "HeaderOfflineDownloads": "Contenu multim\u00e9dia hors-ligne", "HeaderOfflineDownloadsDescription": "T\u00e9l\u00e9chargez votre contenu multim\u00e9dia vers vos appareils pour une meilleure utilisation hors-ligne.", "CloudSyncFeatureDescription": "Synchronisez votre contenu multim\u00e9dia vers le cloud pour le sauvegarder, l'archiver et le convertir plus facilement.", - "CoverArtFeatureDescription": "Pochette cr\u00e9\u00e9 des couvertures amusantes et d'autres fonctions pour vous aider \u00e0 personnaliser les pochettes de votre contenu multim\u00e9dia.", - "CoverArt": "Pochette", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Annuler la synchronisation", "CancelSyncJobConfirmation": "L'annulation d'une t\u00e2che de synchronisation provoquera la suppression des m\u00e9dias synchronis\u00e9s sur l'appareil lors la prochaine ex\u00e9cution de la synchronisation. \u00cates-vous s\u00fbr de vouloir continuer ?", "CinemaModeFeatureDescription": "Le Mode Cin\u00e9ma vous donne une v\u00e9ritable exp\u00e9rience cin\u00e9matique avec des trailers et des intros personnalis\u00e9es avant la lecture du contenu.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "S\u00e9parer les \u00e9l\u00e9ments par un point-virgule ;", "LabelAlbumArtists": "Artistes de l'album :", "LabelAlbum": "Album :", + "Artists": "Artists", "LabelCommunityRating": "Note de la communaut\u00e9", "LabelVoteCount": "Nombre de votes", "LabelCriticRating": "Note des critiques", - "LabelCriticRatingSummary": "R\u00e9sum\u00e9 des critiques", "LabelAwardSummary": "R\u00e9compenses", "LabelWebsite": "Site Web", "LabelTagline": "Slogan", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 vid\u00e9o musicale", "ValueMusicVideoCount": "{0} music Videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Entrez un ou plusieurs crit\u00e8res de recherche. Retirez des crit\u00e8res pour \u00e9largir les r\u00e9sultats de la recherche.", "PleaseEnterNameOrId": "Veuillez saisir un nom ou un identifiant externe.", "MessageItemSaved": "Item sauvegard\u00e9.", "SearchResults": "R\u00e9sultats de la recherche", - "SyncToOtherDevice": "Sync vers un autre appareil", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Rendre disponible hors connexion", "ServerNameIsRestarting": "Emby Server - {0} est red\u00e9marr\u00e9.", "ServerNameIsShuttingDown": "Emby Server - {0} est arr\u00eater.", @@ -290,7 +286,9 @@ "Settings": "Param\u00e8tres", "ShowIndicatorsFor": "Montrer les indicateurs pour:", "NewEpisodes": "Nouveaux \u00e9pisodes", + "Episodes": "Episodes", "HDPrograms": "Programmes HD", + "Programs": "Programs", "LiveBroadcasts": "Diffusions en direct", "Premieres": "Premi\u00e8res", "RepeatEpisodes": "R\u00e9p\u00e9ter les \u00e9pisodes", @@ -393,16 +391,16 @@ "Accept": "Accept", "Reject": "Reject", "Connect": "Connexion", - "HeaderMyMedia": "My Media", - "HeaderMyMediaSmall": "My Media (small)", + "HeaderMyMedia": "Mes M\u00e9dias", + "HeaderMyMediaSmall": "Mes m\u00e9dias (petit)", "LatestFromLibrary": "Derniers {0}", "HeaderLatestChannelMedia": "Derniers \u00e9l\u00e9ments de la cha\u00eene", - "HeaderContinueWatching": "Continue Watching", + "HeaderContinueWatching": "Continuer \u00e0 regarder", "HeaderContinueListening": "Continue Listening", "HeaderActiveRecordings": "Active Recordings", "HeaderLatestRecordings": "Derniers enregistrements", "LabelDownloadTo": "Download to:", - "HeaderNextUp": "Next Up", + "HeaderNextUp": "\u00c0 Suivre", "HeaderLatestFrom": "Derniers de {0}", "LabelHomeScreenSectionValue": "Home screen section {0}:", "SettingsSaved": "Settings saved.", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json b/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json index f336087992..66352d37e0 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/gsw.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Abbreche", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Trenn mehreri iistr\u00e4g dur es ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/he.json b/dashboard-ui/bower_components/emby-webcomponents/strings/he.json index 4fdba73ae6..e895fe8df7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/he.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/he.json @@ -15,13 +15,6 @@ "ItemCount": "\u05e4\u05e8\u05d9\u05d8\u05d9\u05dd {0}", "OriginalAirDateValue": "\u05ea\u05d0\u05e8\u05d9\u05da \u05d0\u05d5\u05d5\u05d9\u05e8 \u05de\u05e7\u05d5\u05e8\u05d9: {0}", "EndsAtValue": "\u05de\u05e1\u05ea\u05d9\u05d9\u05dd \u05d1 {0}", - "OptionSundayShort": "\u05e8\u05d0\u05e9\u05d5\u05df", - "OptionMondayShort": "\u05e9\u05e0\u05d9", - "OptionTuesdayShort": "\u05e9\u05dc\u05d9\u05e9\u05d9", - "OptionWednesdayShort": "\u05e8\u05d1\u05d9\u05e2\u05d9", - "OptionThursdayShort": "\u05d7\u05de\u05d9\u05e9\u05d9", - "OptionFridayShort": "\u05e9\u05d9\u05e9\u05d9", - "OptionSaturdayShort": "\u05e9\u05d1\u05ea", "HeaderSelectDate": "\u05d1\u05d7\u05e8 \u05ea\u05d0\u05e8\u05d9\u05da", "ButtonOk": "\u05d1\u05e1\u05d3\u05e8", "ButtonCancel": "\u05d1\u05d8\u05dc", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "\u05de\u05d3\u05d9\u05d4 \u05dc\u05d0 \u05de\u05e7\u05d5\u05d5\u05e0\u05ea", "HeaderOfflineDownloadsDescription": "\u05d4\u05d5\u05e8\u05d3 \u05de\u05d3\u05d9\u05d4 \u05dc\u05de\u05db\u05e9\u05d9\u05e8\u05d9\u05dd \u05e9\u05dc\u05da \u05dc\u05e9\u05d9\u05de\u05d5\u05e9 \u05dc\u05d0 \u05de\u05e7\u05d5\u05d5\u05df \u05d1\u05e7\u05dc\u05d5\u05ea.", "CloudSyncFeatureDescription": "\u05e1\u05e0\u05db\u05e8\u05df \u05d0\u05ea \u05d4\u05de\u05d3\u05d9\u05d4 \u05e9\u05dc\u05da \u05dc\u05e2\u05e0\u05df \u05dc\u05e6\u05d5\u05e8\u05da \u05d2\u05d9\u05d1\u05d5\u05d9 \u05e7\u05dc, \u05d0\u05d7\u05e1\u05d5\u05df \u05d1\u05d0\u05e8\u05db\u05d9\u05d5\u05df \u05d5\u05d4\u05de\u05e8\u05d4.", - "CoverArtFeatureDescription": "\u05d0\u05de\u05e0\u05d5\u05ea \u05db\u05e8\u05d9\u05db\u05d4 \u05d9\u05d5\u05e6\u05e8 \u05db\u05d9\u05e1\u05d5\u05d9\u05d9 \u05db\u05d9\u05e3 \u05d5\u05d8\u05d9\u05e4\u05d5\u05dc\u05d9\u05dd \u05d0\u05d7\u05e8\u05d9\u05dd \u05e9\u05d9\u05e1\u05d9\u05d9\u05e2\u05d5 \u05dc\u05da \u05dc\u05d4\u05ea\u05d0\u05d9\u05dd \u05d0\u05d9\u05e9\u05d9\u05ea \u05d0\u05ea \u05ea\u05de\u05d5\u05e0\u05d5\u05ea \u05d4\u05de\u05d3\u05d9\u05d4 \u05e9\u05dc\u05da.", - "CoverArt": "\u05d0\u05de\u05e0\u05d5\u05ea \u05db\u05e8\u05d9\u05db\u05d4", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "\u05d1\u05d9\u05d8\u05d5\u05dc \u05d4\u05d5\u05e8\u05d3\u05d4", "CancelSyncJobConfirmation": "\u05d1\u05d9\u05d8\u05d5\u05dc \u05de\u05e9\u05d9\u05de\u05ea \u05d4\u05e1\u05d9\u05e0\u05db\u05e8\u05d5\u05df \u05ea\u05e1\u05d9\u05e8 \u05de\u05d3\u05d9\u05d4 \u05e9\u05d4\u05d5\u05e8\u05d3\u05d4 \u05de\u05d4\u05de\u05db\u05e9\u05d9\u05e8 \u05d1\u05de\u05d4\u05dc\u05da \u05ea\u05d4\u05dc\u05d9\u05da \u05d4\u05e1\u05e0\u05db\u05e8\u05d5\u05df \u05d4\u05d1\u05d0. \u05d4\u05d0\u05dd \u05d0\u05ea\u05d4 \u05d1\u05d8\u05d5\u05d7 \u05e9\u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05de\u05e9\u05d9\u05da?", "CinemaModeFeatureDescription": "\u05de\u05e6\u05d1 \u05e7\u05d5\u05dc\u05e0\u05d5\u05e2 \u05e0\u05d5\u05ea\u05df \u05dc\u05da \u05d0\u05ea \u05d4\u05d7\u05d5\u05d5\u05d9\u05d4 \u05d4\u05e7\u05d5\u05dc\u05e0\u05d5\u05e2 \u05d0\u05de\u05d9\u05ea\u05d9 \u05e2\u05dd \u05e7\u05d3\u05d9\u05de\u05d5\u05e0\u05d9\u05dd \u05de\u05d5\u05ea\u05d0\u05de\u05d9\u05dd \u05d0\u05d9\u05e9\u05d9\u05ea \u05dc\u05e4\u05e0\u05d9 \u05d4\u05ea\u05db\u05d5\u05e0\u05d4.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "\u05d4\u05e4\u05e8\u05d3 \u05de\u05e8\u05d5\u05d1\u05d9\u05dd \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea;", "LabelAlbumArtists": "\u05d0\u05dc\u05d1\u05d5\u05dd \u05d0\u05d5\u05de\u05e0\u05d9\u05dd:", "LabelAlbum": "\u05d0\u05dc\u05d1\u05d5\u05dd:", + "Artists": "Artists", "LabelCommunityRating": "\u05d3\u05d9\u05e8\u05d5\u05d2 \u05d4\u05e7\u05d4\u05d9\u05dc\u05d4:", "LabelVoteCount": "\u05e1\u05e4\u05d9\u05e8\u05ea \u05d4\u05e6\u05d1\u05e2\u05d5\u05ea:", "LabelCriticRating": "\u05d3\u05d9\u05e8\u05d5\u05d2 \u05d1\u05d9\u05e7\u05d5\u05e8\u05ea:", - "LabelCriticRatingSummary": "\u05e1\u05d9\u05db\u05d5\u05dd \u05d3\u05d9\u05e8\u05d5\u05d2\u05d9\u05dd \u05d1\u05d9\u05e7\u05d5\u05e8\u05ea\u05d9\u05d9\u05dd:", "LabelAwardSummary": "\u05e1\u05d9\u05db\u05d5\u05dd \u05e4\u05e8\u05e1:", "LabelWebsite": "\u05d0\u05ea\u05e8:", "LabelTagline": "\u05e9\u05d5\u05e8\u05ea \u05ea\u05d9\u05d5\u05d2:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "\u05d5\u05d9\u05d3\u05d0\u05d5 \u05e7\u05dc\u05d9\u05e4 1", "ValueMusicVideoCount": "{0} \u05d5\u05d9\u05d3\u05d0\u05d5 \u05e7\u05dc\u05d9\u05e4\u05d9\u05dd", "ValueMinutes": "{0} \u05d3\u05e7\u05d5\u05ea", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "\u05d4\u05d6\u05df \u05e7\u05e8\u05d9\u05d8\u05e8\u05d9\u05d5\u05df \u05d7\u05d9\u05e4\u05d5\u05e9 \u05d0\u05d7\u05d3 \u05d0\u05d5 \u05d9\u05d5\u05ea\u05e8. \u05d4\u05e1\u05e8 \u05e7\u05e8\u05d9\u05d8\u05e8\u05d9\u05d5\u05e0\u05d9\u05dd \u05db\u05d3\u05d9 \u05dc\u05d4\u05d2\u05d3\u05d9\u05dc \u05d0\u05ea \u05ea\u05d5\u05e6\u05d0\u05d5\u05ea \u05d4\u05d7\u05d9\u05e4\u05d5\u05e9.", "PleaseEnterNameOrId": "\u05d4\u05d6\u05df \u05e9\u05dd \u05d0\u05d5 \u05de\u05d6\u05d4\u05d4 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9.", "MessageItemSaved": "\u05d4\u05e4\u05e8\u05d9\u05d8 \u05e0\u05e9\u05de\u05e8.", "SearchResults": "\u05ea\u05d5\u05e6\u05d0\u05d5\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9", - "SyncToOtherDevice": "\u05e1\u05e0\u05db\u05e8\u05df \u05dc\u05de\u05db\u05e9\u05d9\u05e8 \u05d0\u05d7\u05e8", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "\u05d4\u05e4\u05d5\u05da \u05dc\u05d6\u05de\u05d9\u05df \u05d1\u05de\u05e6\u05d1 \u05dc\u05d0 \u05de\u05e7\u05d5\u05d5\u05df", "ServerNameIsRestarting": "\u05e9\u05e8\u05ea Emby - {0} \u05de\u05d5\u05e4\u05e2\u05dc \u05de\u05d7\u05d3\u05e9.", "ServerNameIsShuttingDown": "\u05e9\u05e8\u05ea Emby - {0} \u05e0\u05db\u05d1\u05d4.", @@ -290,7 +286,9 @@ "Settings": "\u05d4\u05d2\u05d3\u05e8\u05d5\u05ea", "ShowIndicatorsFor": "\u05d4\u05e6\u05d2 \u05de\u05d7\u05d5\u05d5\u05e0\u05d9\u05dd \u05e2\u05d1\u05d5\u05e8:", "NewEpisodes": "\u05e4\u05e8\u05e7\u05d9\u05dd \u05d7\u05d3\u05e9\u05d9\u05dd", + "Episodes": "Episodes", "HDPrograms": "\u05ea\u05d5\u05db\u05e0\u05d9\u05d5\u05ea HD", + "Programs": "Programs", "LiveBroadcasts": "\u05e9\u05d9\u05d3\u05d5\u05e8\u05d9\u05dd \u05d7\u05d9\u05d9\u05dd", "Premieres": "\u05d1\u05db\u05d5\u05e8\u05d5\u05ea", "RepeatEpisodes": "\u05d7\u05d6\u05d5\u05e8 \u05e2\u05dc \u05e4\u05e8\u05e7\u05d9\u05dd", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json b/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json index feead7a4b4..3aa0b78a19 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/hr.json @@ -15,13 +15,6 @@ "ItemCount": "{0} stavaka", "OriginalAirDateValue": "Originalni datum prikazivanja: {0}", "EndsAtValue": "Zavr\u0161ava u {0}", - "OptionSundayShort": "Ned", - "OptionMondayShort": "Pon", - "OptionTuesdayShort": "Uto", - "OptionWednesdayShort": "Sre", - "OptionThursdayShort": "\u010cet", - "OptionFridayShort": "Pet", - "OptionSaturdayShort": "Sub", "HeaderSelectDate": "Odaberi datum", "ButtonOk": "U redu", "ButtonCancel": "Odustani", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Izvanmre\u017eni mediji", "HeaderOfflineDownloadsDescription": "Preuzimanje medija na svojim ure\u0111ajima za jednostavnu upotrebu izvan mre\u017ee.", "CloudSyncFeatureDescription": "Sinkronizirajte svoje medije na oblaku za jednostavni backup, arhiviranje i konvertiranje.", - "CoverArtFeatureDescription": "\"Cover Art\" stvara zabavne naslovnice i druge tretmane koji \u0107e vam pomo\u0107i personalizirati va\u0161e medijske slike.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Kino na\u010din vam daje pravi do\u017eivljaj kina s kratkim filmovima i prilago\u0111enim isje\u010dcima prije odabrane zna\u010dajke.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Odvoji vi\u0161estruko koriste\u0107i ;", "LabelAlbumArtists": "Izvo\u0111a\u010di albuma", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Ocjene zajednice:", "LabelVoteCount": "Prebrojavanje glasova:", "LabelCriticRating": "Ocjene kritike:", - "LabelCriticRatingSummary": "Sa\u017eetak ocjena kritike:", "LabelAwardSummary": "Sa\u017eetak nagrada:", "LabelWebsite": "Web stranica:", "LabelTagline": "Slogan:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 glazbeni video", "ValueMusicVideoCount": "{0} glazbenih videa", "ValueMinutes": "{0} minuta", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Unesite jednu ili vi\u0161e kriterija pretra\u017eivanja. Uklonite kriterije za pove\u0107anje rezultata pretra\u017eivanja.", "PleaseEnterNameOrId": "Unesite naziv ili vanjski Id.", "MessageItemSaved": "Stavka je snimljena.", "SearchResults": "Rezultati pretra\u017eivanja", - "SyncToOtherDevice": "Sinkronizacija na druge ure\u0111aje", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Dostupno izvanmre\u017eno", "ServerNameIsRestarting": "Emby Server - {0} se ponovo pokre\u0107e.", "ServerNameIsShuttingDown": "Emby Server - {0} se gasi.", @@ -290,7 +286,9 @@ "Settings": "Postavke", "ShowIndicatorsFor": "Prika\u017ei pokazatelja za:", "NewEpisodes": "Nove epizode", + "Episodes": "Episodes", "HDPrograms": "HD programi", + "Programs": "Programs", "LiveBroadcasts": "Emitiranja u\u017eivo", "Premieres": "Premijere", "RepeatEpisodes": "Reprize", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json b/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json index 120bf1e735..80284eb7ff 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/hu.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "V\u00e1rhat\u00f3 befejez\u00e9s {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "M\u00e9gsem", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Lemezbor\u00edt\u00f3", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "A Cinema Mode igazi mozi \u00e9lm\u00e9nyt ny\u00fajt el\u0151zetessel \u00e9s egyedi intr\u00f3val a film vet\u00edt\u00e9se el\u0151tt.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "K\u00f6z\u00f6ss\u00e9gi \u00e9rt\u00e9kel\u00e9s:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} \u00fajraindul.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Be\u00e1ll\u00edt\u00e1sok", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "\u00daj epiz\u00f3dok", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/id.json b/dashboard-ui/bower_components/emby-webcomponents/strings/id.json index b6a148e970..1c3f352485 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/id.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/id.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/it.json b/dashboard-ui/bower_components/emby-webcomponents/strings/it.json index 4e58072075..a8a4f1a249 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/it.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/it.json @@ -15,13 +15,6 @@ "ItemCount": "{0} elementi", "OriginalAirDateValue": "Prima messa in onda (originale): {0}", "EndsAtValue": "Finir\u00e0 alle {0}", - "OptionSundayShort": "Dom", - "OptionMondayShort": "Lun", - "OptionTuesdayShort": "Mar", - "OptionWednesdayShort": "Mer", - "OptionThursdayShort": "Gio", - "OptionFridayShort": "Ven", - "OptionSaturdayShort": "Sab", "HeaderSelectDate": "Scegli una data", "ButtonOk": "Ok", "ButtonCancel": "Annulla", @@ -48,10 +41,9 @@ "HeaderOfflineDownloads": "Media Offline", "HeaderOfflineDownloadsDescription": "Scarica facilmente i media sui tuoi dispositivi per vederli offline.", "CloudSyncFeatureDescription": "Sincronizza i tuoi media nel cloud per un facile backup, archiviazione e conversione.", - "CoverArtFeatureDescription": "Copertine crea delle copertine divertenti ed altri effetti per aiutarti a personalizzare le immagini dei tuoi media.", - "CoverArt": "Copertine", - "ButtonCancelSyncJob": "Annulla sinc.", - "CancelSyncJobConfirmation": "La cancellazione dell'attivit\u00e0 di sincronizzazione causer\u00e0, alla prossima sincronizzazione, la rimozione di tutti i media sincronizzati dal dispositivo. Sei sicuro di voler procedere?", + "DvrFeatureDescription": "Pianifica le registrazioni di Live TV, registrazioni di serie e altro ancora con Emby DVR.", + "ButtonCancelSyncJob": "Annulla download", + "CancelSyncJobConfirmation": "La cancellazione dell'attivit\u00e0 di sincronizzazione causer\u00e0, alla prossima sincronizzazione, la rimozione di tutti i media scaricati dal dispositivo. Sei sicuro di voler procedere?", "CinemaModeFeatureDescription": "Modalit\u00e0 Cinema ti fa provare la vera esperienza del cinema con trailer ed intro personalizzate prima del contenuto principale.", "HeaderFreeApps": "App Gratuite Emby", "FreeAppsFeatureDescription": "Godi dell'accesso gratuito alle App Emby dai tuoi dispositivi.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separa valori multipli usando ;", "LabelAlbumArtists": "Artisti album:", "LabelAlbum": "Album:", + "Artists": "Artisti", "LabelCommunityRating": "Voto del pubblico:", "LabelVoteCount": "Numero di voti:", "LabelCriticRating": "Voto della critica:", - "LabelCriticRatingSummary": "Sintesi voto della critica:", "LabelAwardSummary": "Sintesi premi:", "LabelWebsite": "Sito Web:", "LabelTagline": "Slogan:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 video musicale", "ValueMusicVideoCount": "{0} video musicali", "ValueMinutes": "{0} min", + "Albums": "Album", + "Songs": "Canzoni", + "Books": "Libri", + "HeaderAudioBooks": "Audiolibri", "HeaderIdentifyItemHelp": "Inserisci uno o pi\u00f9 criteri di ricerca. Rimuovi criteri per ottenere pi\u00f9 risultati.", "PleaseEnterNameOrId": "Per favore inserisci un nome o un id esterno.", "MessageItemSaved": "Elemento salvato.", "SearchResults": "Risultati della Ricerca", - "SyncToOtherDevice": "Invia ad un altro dispositivo", + "DownloadToOtherDevice": "Scarica su un altro dispositivo", "MakeAvailableOffline": "Rendi disponibile offline", "ServerNameIsRestarting": "Emby Server - {0} si sta riavviando.", "ServerNameIsShuttingDown": "Emby Server - {0} si sta arrestando.", @@ -269,19 +265,19 @@ "SyncJobCreated": "Attivit\u00e0 di Sinc. creata", "LabelSyncJobName": "Nome Attivit\u00e0 di Sinc.:", "LabelQuality": "Qualit\u00e0:", - "LabelSyncNoTargetsHelp": "Al momento non hai applicazioni che supportino la sincronizzazione.", + "LabelSyncNoTargetsHelp": "Al momento non hai applicazioni che supportino il download offline.", "DownloadScheduled": "Scaricamento pianificato", "HeaderSyncRequiresSub": "La sincronizzazione richiede un abbonamento Emby Premiere.", "LearnMore": "saperne di pi\u00f9", "LabelProfile": "Profilo:", "LabelBitrateMbps": "Bitrate (Mbps):", - "SyncUnwatchedVideosOnly": "Sincronizza solo i video non visti", - "SyncUnwatchedVideosOnlyHelp": "Solo i video non visti verranno sincronizzati, e verranno rimossi dal dispositivo non appena visti.", - "AutomaticallySyncNewContent": "Sincronizza automaticamente i nuovi contenuti", - "AutomaticallySyncNewContentHelp": "I nuovi contenuti aggiunti verranno sincronizzati automaticamente al dispositivo.", + "SyncUnwatchedVideosOnly": "Scarica solo i video non visti", + "SyncUnwatchedVideosOnlyHelp": "Solo i video non visti verranno scaricati, e verranno rimossi dal dispositivo non appena visti.", + "AutomaticallySyncNewContent": "Scarica automaticamente i nuovi contenuti", + "AutomaticallySyncNewContentHelp": "I nuovi contenuti aggiunti verranno scaricati automaticamente al dispositivo.", "LabelItemLimit": "Limite elementi:", - "LabelItemLimitHelp": "Facoltativo. Imposta un limite al numero di elementi che verranno sincronizzati.", - "PleaseSelectDeviceToSyncTo": "Seleziona un dispositivo per sincronizzare.", + "LabelItemLimitHelp": "Facoltativo. Imposta un limite al numero di elementi che verranno scaricati.", + "PleaseSelectDeviceToSyncTo": "Seleziona un dispositivo per eseguire il download.", "Screenshots": "Screenshot", "MoveRight": "Sposta a destra", "MoveLeft": "Sposta a sinistra", @@ -290,7 +286,9 @@ "Settings": "Impostazioni", "ShowIndicatorsFor": "Mostra indicatori per:", "NewEpisodes": "Nuovi episodi", + "Episodes": "Episodi", "HDPrograms": "Programmi HD", + "Programs": "Programmi", "LiveBroadcasts": "Tramissioni in diretta", "Premieres": "Prime Visioni", "RepeatEpisodes": "Ripeti episodi", @@ -393,42 +391,45 @@ "Accept": "Accetta", "Reject": "Rifiuta", "Connect": "Connetti", - "HeaderMyMedia": "My Media", - "HeaderMyMediaSmall": "My Media (small)", - "LatestFromLibrary": "Latest {0}", - "HeaderLatestChannelMedia": "Latest Channel Items", - "HeaderContinueWatching": "Continue Watching", - "HeaderContinueListening": "Continue Listening", - "HeaderActiveRecordings": "Active Recordings", - "HeaderLatestRecordings": "Latest Recordings", - "LabelDownloadTo": "Download to:", - "HeaderNextUp": "Next Up", - "HeaderLatestFrom": "Latest from {0}", - "LabelHomeScreenSectionValue": "Home screen section {0}:", - "SettingsSaved": "Settings saved.", - "None": "None", + "HeaderMyMedia": "I miei media", + "HeaderMyMediaSmall": "I miei media (piccolo)", + "LatestFromLibrary": "Ultimi {0}", + "HeaderLatestChannelMedia": "Ultimi elementi aggiunti", + "HeaderContinueWatching": "Continua a guardare", + "HeaderContinueListening": "Continua ad ascoltare", + "HeaderActiveRecordings": "Registrazioni Attive", + "HeaderLatestRecordings": "Ultime registrazioni", + "LabelDownloadTo": "Scarica a:", + "HeaderNextUp": "Prossimo", + "HeaderLatestFrom": "Ultime da {0}", + "LabelHomeScreenSectionValue": "Pagina iniziale Sezione {0}:", + "SettingsSaved": "Settaggi salvati.", + "None": "Nessuno", "More": "Dettagli", - "Up": "Up", - "Down": "Down", - "HeaderHomeScreen": "Home Screen", - "HeaderLatestMedia": "Latest Media", - "HeaderLatestChannelItems": "Latest Channel Items", - "LabelSelectLastestItemsFolders": "Include items from the following sections in Latest Media", - "HeaderLibraryOrder": "Library Order", - "HideWatchedContentFromLatestMedia": "Hide watched content from latest media", - "HeaderOnNow": "On Now", + "Up": "Su", + "Down": "Gi\u00f9", + "HeaderHomeScreen": "Pagina iniziale", + "HeaderLatestMedia": "Ultimi Media", + "HeaderLatestChannelItems": "Ultimi elementi aggiunti", + "LabelSelectLastestItemsFolders": "Includi gli elementi delle seguenti sezioni in Ultimi Media", + "HeaderLibraryOrder": "Ordine Libreria", + "HideWatchedContentFromLatestMedia": "Nascondi i contenuti gi\u00e0 visti dagli Ultimi Media", + "HeaderOnNow": "In onda ora", "HeaderPlaybackError": "Errore di riproduzione", - "PlaybackErrorNotAllowed": "You're currently not authorized to play this content. Please contact your system administrator for details.", - "PlaybackErrorNoCompatibleStream": "No compatible streams are currently available. Please try again later or contact your system administrator for details.", - "PlaybackErrorPlaceHolder": "Please insert the disc in order to play this video.", - "Guide": "Guide", - "Suggestions": "Suggestions", - "Favorites": "Favorites", - "Collections": "Collections", - "LabelSelectFolderGroups": "Automatically group content from the following folders into views such as Movies, Music and TV:", - "LabelSelectFolderGroupsHelp": "Folders that are unchecked will be displayed by themselves in their own view.", - "Shows": "Shows", - "HeaderLibraryFolders": "Library Folders", - "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "PlaybackErrorNotAllowed": "Al momento non sei autorizzato a riprodurre questo contenuto. Per favore contatta l'amministratore del sistema per ulteriori dettagli", + "PlaybackErrorNoCompatibleStream": "Nessuna trasmissione compatibile \u00e8 al momento disponibile. Per favore riprova in seguito o contatta il tuo Amministratore di sistema per chiarimenti", + "PlaybackErrorPlaceHolder": "Per favore inserisci i dischi nell'ordine per riprodurre questo video.", + "Guide": "Guida", + "Suggestions": "Suggerimenti", + "Favorites": "Preferiti", + "Collections": "Collezioni", + "LabelSelectFolderGroups": "Raggruppa i contenuti delle seguenti cartelle in viste come Film, Musica e Serie TV", + "LabelSelectFolderGroupsHelp": "Le cartelle non selezionate verranno mostrate come se stesse nelle proprie viste", + "Shows": "Programmi", + "HeaderLibraryFolders": "Cartelle Libreria", + "HeaderLandingScreens": "Schermata di Destinazione", + "LandingScreensHelp": "Selezionare la schermata di destinazione predefinita quando si fa clic su una libreria", + "HeaderTermsOfPurchase": "Termini di pagamento", + "PrivacyPolicy": "Informativa sulla privacy", + "TermsOfUse": "Termini di utilizzo" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json b/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json index cbff59798b..0bd7caac3d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/kk.json @@ -15,13 +15,6 @@ "ItemCount": "{0} \u0442\u0430\u0440\u043c\u0430\u049b", "OriginalAirDateValue": "\u0411\u0430\u0441\u0442\u0430\u043f\u049b\u044b \u044d\u0444\u0438\u0440: {0}", "EndsAtValue": "\u0410\u044f\u049b\u0442\u0430\u043b\u0443\u044b: {0}", - "OptionSundayShort": "\u0436\u0435\u043a", - "OptionMondayShort": "\u0434\u04af\u0439", - "OptionTuesdayShort": "\u0441\u0435\u0439", - "OptionWednesdayShort": "\u0441\u04d9\u0440", - "OptionThursdayShort": "\u0431\u0435\u0439", - "OptionFridayShort": "\u0436\u04b1\u043c", - "OptionSaturdayShort": "\u0441\u0435\u043d", "HeaderSelectDate": "\u041a\u04af\u043d\u0434\u0456 \u0442\u0430\u04a3\u0434\u0430\u0443", "ButtonOk": "\u0416\u0430\u0440\u0430\u0439\u0434\u044b", "ButtonCancel": "\u0411\u043e\u043b\u0434\u044b\u0440\u043c\u0430\u0443", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "\u0414\u0435\u0440\u0431\u0435\u0441 \u0442\u0430\u0441\u044b\u0493\u044b\u0448\u0434\u0435\u0440\u0435\u043a", "HeaderOfflineDownloadsDescription": "\u041e\u04a3\u0430\u0439 \u0434\u0435\u0440\u0431\u0435\u0441 \u049b\u043e\u043b\u0434\u0430\u043d\u0443 \u04af\u0448\u0456\u043d \u049b\u04b1\u0440\u044b\u043b\u0493\u044b\u043b\u0430\u0440\u044b\u04a3\u044b\u0437\u0493\u0430 \u0442\u0430\u0441\u044b\u0493\u044b\u0448\u0434\u0435\u0440\u0435\u043a\u0442\u0435\u0440\u0434\u0456 \u0436\u04af\u043a\u0442\u0435\u043f \u0430\u043b\u044b\u04a3\u044b\u0437.", "CloudSyncFeatureDescription": "\u0421\u0430\u049b\u0442\u044b\u049b \u043a\u04e9\u0448\u0456\u0440\u043c\u0435\u043d\u0456, \u043c\u04b1\u0440\u0430\u0493\u0430\u0442\u0442\u0430\u0443\u0434\u044b \u0436\u04d9\u043d\u0435 \u0442\u04af\u0440\u043b\u0435\u043d\u0434\u0456\u0440\u0443\u0434\u0456 \u0436\u0435\u04a3\u0456\u043b\u0434\u0435\u0442\u0443 \u04af\u0448\u0456\u043d \u0442\u0430\u0441\u044b\u0493\u044b\u0448 \u0434\u0435\u0440\u0435\u043a\u0442\u0435\u0440\u0434\u0456 \u0431\u04b1\u043b\u0442\u043f\u0435\u043d \u04af\u043d\u0434\u0435\u0441\u0442\u0456\u0440\u0456\u04a3\u0456\u0437.", - "CoverArtFeatureDescription": "\u0422\u0430\u0441\u044b\u0493\u044b\u0448 \u0441\u0443\u0440\u0435\u0442\u0442\u0435\u0440\u0456\u043d \u0436\u0435\u043a\u0435\u043b\u0435\u0443\u0433\u0435 \u043a\u04e9\u043c\u0435\u043a\u0442\u0435\u0441\u0443 \u04af\u0448\u0456\u043d Cover Art \u049b\u044b\u0437\u044b\u049b\u0442\u044b \u043c\u04b1\u049b\u0430\u0431\u0430\u043b\u0430\u0440\u0434\u044b \u0436\u04d9\u043d\u0435 \u0431\u0430\u0441\u049b\u0430 \u0434\u0430 \u04e9\u04a3\u0434\u0435\u0442\u0443\u043b\u0435\u0440\u0434\u0456 \u0436\u0430\u0441\u0430\u0439\u0434\u044b.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Emby DVR \u043a\u0435\u0441\u0442\u0435\u0441\u0456\u043d\u0435 \u0436\u0435\u043a\u0435 \u044d\u0444\u0438\u0440\u043b\u0456\u043a \u0436\u0430\u0437\u0431\u0430\u043b\u0430\u0440\u0434\u044b, \u0442\u043e\u043f\u0442\u0430\u043c\u0430 \u0436\u0430\u0437\u0431\u0430\u043b\u0430\u0440\u0434\u044b, \u0436\u04d9\u043d\u0435 \u043e\u043d\u0430\u043d \u0431\u0430\u0441\u049b\u0430\u043b\u0430\u0440\u0434\u044b \u0435\u043d\u0433\u0456\u0437\u0456\u04a3\u0456\u0437.", "ButtonCancelSyncJob": "\u0416\u04af\u043a\u0442\u0435\u043f \u0430\u043b\u0443\u0434\u044b \u0431\u043e\u043b\u0434\u044b\u0440\u043c\u0430\u0443", "CancelSyncJobConfirmation": "\u04ae\u043d\u0434\u0435\u0441\u0442\u0456\u0440\u0443 \u0436\u04b1\u043c\u044b\u0441\u044b\u043d \u0431\u043e\u043b\u0434\u044b\u0440\u043c\u0430\u0443\u044b \u043a\u0435\u043b\u0435\u0441\u0456 \u04af\u043d\u0434\u0435\u0441\u0442\u0456\u0440\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0456 \u043a\u0435\u0437\u0456\u043d\u0434\u0435 \u049b\u04b1\u0440\u044b\u043b\u0493\u044b\u0434\u0430\u043d \u0436\u04af\u043a\u0442\u0435\u043f \u0430\u043b\u044b\u043d\u0493\u0430\u043d \u0442\u0430\u0441\u044b\u0493\u044b\u0448\u0434\u0435\u0440\u0435\u043a\u0442\u0435\u0440\u0434\u0456 \u0436\u043e\u044f\u0434\u044b. \u0428\u044b\u043d\u044b\u043c\u0435\u043d \u043a\u0456\u0440\u0456\u0441\u0443 \u049b\u0430\u0436\u0435\u0442 \u043f\u0435?", "CinemaModeFeatureDescription": "\u041a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440 \u0440\u0435\u0436\u0456\u043c\u0456 \u0442\u0440\u0435\u0439\u043b\u0435\u0440\u043b\u0435\u0440\u0434\u0456 \u0436\u04d9\u043d\u0435 \u0442\u0435\u04a3\u0448\u0435\u043b\u0433\u0435\u043d \u043a\u04e9\u0440\u043d\u0435\u0443\u0434\u0456 \u0444\u0438\u043b\u044c\u043c \u0430\u043b\u0434\u044b\u043d\u0434\u0430 \u043e\u0439\u043d\u0430\u0442\u0443 \u043a\u0438\u043d\u043e\u0437\u0430\u043b \u04d9\u0441\u0435\u0440\u0456\u043d \u0436\u0435\u0442\u043a\u0456\u0437\u0435\u0434\u0456.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "\u0411\u0456\u0440\u043d\u0435\u0448\u0443\u0456\u043d (;) \u0430\u0440\u049b\u044b\u043b\u044b \u0431\u04e9\u043b\u0456\u04a3\u0456\u0437", "LabelAlbumArtists": "\u0410\u043b\u044c\u0431\u043e\u043c \u043e\u0440\u044b\u043d\u0434\u0430\u0443\u0448\u044b\u043b\u0430\u0440\u044b:", "LabelAlbum": "\u0410\u043b\u044c\u0431\u043e\u043c:", + "Artists": "\u041e\u0440\u044b\u043d\u0434\u0430\u0443\u0448\u044b\u043b\u0430\u0440", "LabelCommunityRating": "\u049a\u0430\u0443\u044b\u043c \u0431\u0430\u0493\u0430\u043b\u0430\u0443\u044b:", "LabelVoteCount": "\u0414\u0430\u0443\u044b\u0441 \u0435\u0441\u0435\u0431\u0456:", "LabelCriticRating": "\u0421\u044b\u043d\u0448\u044b\u043b\u0430\u0440 \u0431\u0430\u0493\u0430\u043b\u0430\u0443\u044b:", - "LabelCriticRatingSummary": "\u0421\u044b\u043d\u0448\u044b\u043b\u0430\u0440 \u0431\u0430\u0493\u0430\u043b\u0430\u0443 \u0430\u049b\u043f\u0430\u0440\u044b:", "LabelAwardSummary": "\u041c\u0430\u0440\u0430\u043f\u0430\u0442 \u0430\u049b\u043f\u0430\u0440\u044b:", "LabelWebsite": "\u0492\u0430\u043b\u0430\u043c\u0442\u043e\u0440 \u0441\u0430\u0439\u0442\u044b:", "LabelTagline": "\u041d\u0435\u0433\u0456\u0437\u0433\u0456 \u0441\u04e9\u0439\u043b\u0435\u043c:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044b\u049b \u0431\u0435\u0439\u043d\u0435", "ValueMusicVideoCount": "{0} \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044b\u049b \u0431\u0435\u0439\u043d\u0435", "ValueMinutes": "{0} \u043c\u0438\u043d", + "Albums": "\u0410\u043b\u044c\u0431\u043e\u043c\u0434\u0430\u0440", + "Songs": "\u04d8\u0443\u0435\u043d\u0434\u0435\u0440", + "Books": "\u041a\u0456\u0442\u0430\u043f\u0442\u0430\u0440", + "HeaderAudioBooks": "\u0414\u044b\u0431\u044b\u0441\u0442\u044b\u049b \u043a\u0456\u0442\u0430\u043f\u0442\u0430\u0440", "HeaderIdentifyItemHelp": "\u0406\u0437\u0434\u0435\u0443\u0434\u0456\u04a3 \u0431\u0456\u0440 \u043d\u0435 \u0431\u0456\u0440\u043d\u0435\u0448\u0435 \u0448\u0430\u0440\u0442\u044b\u043d \u0435\u043d\u0433\u0456\u0437\u0456\u04a3\u0456\u0437. \u0406\u0437\u0434\u0435\u0443 \u043d\u04d9\u0442\u0438\u0436\u0435\u043b\u0435\u0440\u0456\u043d \u043a\u04e9\u0431\u0435\u0439\u0442\u0443 \u04af\u0448\u0456\u043d \u0448\u0430\u0440\u0442\u0442\u044b \u0430\u043b\u0430\u0441\u0442\u0430\u04a3\u044b\u0437.", "PleaseEnterNameOrId": "\u0410\u0442\u044b\u043d \u043d\u0435\u043c\u0435\u0441\u0435 \u0441\u044b\u0440\u0442\u049b\u044b ID \u0435\u043d\u0433\u0456\u0437\u0456\u04a3\u0456\u0437.", "MessageItemSaved": "\u0422\u0430\u0440\u043c\u0430\u049b \u0441\u0430\u049b\u0442\u0430\u043b\u0434\u044b.", "SearchResults": "\u0406\u0437\u0434\u0435\u0443 \u043d\u04d9\u0442\u0438\u0436\u0435\u043b\u0435\u0440\u0456", - "SyncToOtherDevice": "\u0411\u0430\u0441\u049b\u0430 \u049b\u04b1\u0440\u044b\u043b\u0493\u044b\u043c\u0435\u043d \u04af\u043d\u0434\u0435\u0441\u0442\u0456\u0440\u0443", + "DownloadToOtherDevice": "\u0411\u0430\u0441\u049b\u0430 \u049b\u04b1\u0440\u044b\u043b\u0493\u044b\u0493\u0430 \u0436\u04af\u043a\u0442\u0435\u0443", "MakeAvailableOffline": "\u0414\u0435\u0440\u0431\u0435\u0441 \u049b\u043e\u043b\u0436\u0435\u0442\u0456\u043c\u0434\u0456 \u0435\u0442\u0443", "ServerNameIsRestarting": "Emby Server - {0} \u049b\u0430\u0439\u0442\u0430 \u0456\u0441\u043a\u0435 \u049b\u043e\u0441\u044b\u043b\u0443\u0434\u0430.", "ServerNameIsShuttingDown": "Emby Server - {0} \u0436\u04b1\u043c\u044b\u0441\u044b\u043d \u0430\u044f\u049b\u0442\u0430\u0443\u0434\u0430.", @@ -290,7 +286,9 @@ "Settings": "\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043b\u0435\u0440", "ShowIndicatorsFor": "\u041c\u044b\u043d\u0430\u0443 \u04af\u0448\u0456\u043d \u0431\u0435\u043b\u0433\u0456 \u043a\u04e9\u0440\u0441\u0435\u0442\u0443:", "NewEpisodes": "\u0416\u0430\u04a3\u0430 \u0431\u04e9\u043b\u0456\u043c\u0434\u0435\u0440", + "Episodes": "\u0411\u04e9\u043b\u0456\u043c\u0434\u0435\u0440", "HDPrograms": "HD-\u043a\u04e9\u0440\u0441\u0435\u0442\u0456\u043c\u0434\u0435\u0440", + "Programs": "\u041a\u04e9\u0440\u0441\u0435\u0442\u0456\u043c\u0434\u0435\u0440", "LiveBroadcasts": "\u0422\u0456\u043a\u0435\u043b\u0435\u0439 \u0442\u0430\u0440\u0430\u0442\u044b\u043c\u0434\u0430\u0440", "Premieres": "\u041f\u0440\u0435\u043c\u044c\u0435\u0440\u0430\u043b\u0430\u0440", "RepeatEpisodes": "\u0411\u04e9\u043b\u0456\u043c\u0434\u0435\u0440\u0434\u0456\u04a3 \u049b\u0430\u0439\u0442\u0430\u043b\u0430\u043d\u0443\u044b", @@ -425,10 +423,13 @@ "Suggestions": "\u04b0\u0441\u044b\u043d\u044b\u0441\u0442\u0430\u0440", "Favorites": "\u0422\u0430\u04a3\u0434\u0430\u0443\u043b\u044b\u043b\u0430\u0440", "Collections": "\u0416\u0438\u044b\u043d\u0442\u044b\u049b\u0442\u0430\u0440", - "LabelSelectFolderGroups": "Automatically group content from the following folders into views such as Movies, Music and TV:", - "LabelSelectFolderGroupsHelp": "Folders that are unchecked will be displayed by themselves in their own view.", + "LabelSelectFolderGroups": "\u041a\u0435\u043b\u0435\u0441\u0456 \u049b\u0430\u043b\u0442\u0430\u043b\u0430\u0440\u0434\u0430\u0493\u044b \u043c\u0430\u0437\u043c\u04b1\u043d\u0434\u044b \u041a\u0438\u043d\u043e, \u041c\u0443\u0437\u044b\u043a\u0430 \u0436\u04d9\u043d\u0435 \u0422\u0414 \u0441\u0438\u044f\u049b\u0442\u044b \u0430\u0441\u043f\u0435\u043a\u0442\u0442\u0435\u0440\u0433\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0442\u044b \u0442\u04af\u0440\u0434\u0435 \u0442\u043e\u043f\u0442\u0430\u0441\u0442\u044b\u0440\u0443:", + "LabelSelectFolderGroupsHelp": "\u0411\u0435\u043b\u0433\u0456\u043b\u0435\u043d\u0431\u0435\u0433\u0435\u043d \u049b\u0430\u043b\u0442\u0430\u043b\u0430\u0440 \u04e9\u0437 \u0431\u0435\u0442\u0456\u043c\u0435\u043d \u04e9\u0437\u0456\u043d\u0456\u04a3 \u0430\u0441\u043f\u0435\u043a\u0442\u0456\u043d\u0434\u0435 \u0431\u0435\u0439\u043d\u0435\u043b\u0435\u043d\u0435\u0434\u0456.", "Shows": "\u041a\u04e9\u0440\u0441\u0435\u0442\u0456\u043c\u0434\u0435\u0440", - "HeaderLibraryFolders": "Library Folders", + "HeaderLibraryFolders": "\u0422\u0430\u0441\u044b\u0493\u044b\u0448\u0445\u0430\u043d\u0430\u043b\u044b\u049b \u049b\u0430\u043b\u0442\u0430\u043b\u0430\u0440", "HeaderLandingScreens": "\u041c\u0430\u049b\u0441\u0430\u0442\u0442\u044b \u044d\u043a\u0440\u0430\u043d\u0434\u0430\u0440", - "LandingScreensHelp": "\u0422\u0430\u0441\u044b\u0493\u044b\u0448\u0445\u0430\u043d\u0430\u0493\u0430 \u0431\u0430\u0441\u0443 \u043a\u0435\u0437\u0456\u043d\u0434\u0435 \u043a\u04e9\u0440\u0441\u0435\u0442\u0456\u043b\u0435\u0442\u0456\u043d \u04d9\u0434\u0435\u043f\u043a\u0456 \u043c\u0430\u049b\u0441\u0430\u0442\u0442\u044b \u044d\u043a\u0440\u0430\u043d\u0434\u044b \u0442\u0430\u04a3\u0434\u0430\u04a3\u044b\u0437." + "LandingScreensHelp": "\u0422\u0430\u0441\u044b\u0493\u044b\u0448\u0445\u0430\u043d\u0430\u0493\u0430 \u0431\u0430\u0441\u0443 \u043a\u0435\u0437\u0456\u043d\u0434\u0435 \u043a\u04e9\u0440\u0441\u0435\u0442\u0456\u043b\u0435\u0442\u0456\u043d \u04d9\u0434\u0435\u043f\u043a\u0456 \u043c\u0430\u049b\u0441\u0430\u0442\u0442\u044b \u044d\u043a\u0440\u0430\u043d\u0434\u044b \u0442\u0430\u04a3\u0434\u0430\u04a3\u044b\u0437.", + "HeaderTermsOfPurchase": "\u0421\u0430\u0442\u044b\u043f \u0430\u043b\u0443 \u0448\u0430\u0440\u0442\u0442\u0430\u0440\u044b", + "PrivacyPolicy": "\u049a\u04b1\u043f\u0438\u044f\u043b\u044b\u043b\u044b\u049b \u0441\u0430\u044f\u0441\u0430\u0442\u044b", + "TermsOfUse": "\u041f\u0430\u0439\u0434\u0430\u043b\u0430\u043d\u0443 \u0448\u0430\u0440\u0442\u0442\u0430\u0440\u044b" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json index fc941e7e02..413c52f980 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ko.json @@ -15,13 +15,6 @@ "ItemCount": "{0} \ud56d\ubaa9", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "\ub0a0\uc9dc \uc120\ud0dd", "ButtonOk": "OK", "ButtonCancel": "\ucde8\uc18c", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "\uc568\ubc94 \uc544\ud2f0\uc2a4\ud2b8:", "LabelAlbum": "\uc568\ubc94", + "Artists": "Artists", "LabelCommunityRating": "\ucee4\ubba4\ub2c8\ud2f0 \ud3c9\uc810:", "LabelVoteCount": "\ud3c9\uac00 \ud69f\uc218:", "LabelCriticRating": "Critic \ud3c9\uc810:", - "LabelCriticRatingSummary": "Critic \ud3c9\uc810 \uc694\uc57d:", "LabelAwardSummary": "\uc218\uc0c1 \uc694\uc57d:", "LabelWebsite": "\uc6f9\uc0ac\uc774\ud2b8:", "LabelTagline": "\ud0dc\uadf8\ub77c\uc778:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 \ubba4\uc9c1 \ube44\ub514\uc624", "ValueMusicVideoCount": "{0} \ubba4\uc9c1 \ube44\ub514\uc624", "ValueMinutes": "{0} \ubd84", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "\ud56d\ubaa9\uc774 \uc800\uc7a5\ub418\uc5c8\uc2b5\ub2c8\ub2e4.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "\uc124\uc815", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json b/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json index e43eef40ee..2deee5661c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/lt-lt.json @@ -15,13 +15,6 @@ "ItemCount": "{0} element\u0173", "OriginalAirDateValue": "Pirmo eterio data: {0}", "EndsAtValue": "Baigiasi {0}", - "OptionSundayShort": "Sek", - "OptionMondayShort": "Pir", - "OptionTuesdayShort": "Ant", - "OptionWednesdayShort": "Tre", - "OptionThursdayShort": "Ket", - "OptionFridayShort": "Pen", - "OptionSaturdayShort": "\u0160e\u0161", "HeaderSelectDate": "Pasirinkite dat\u0105", "ButtonOk": "OK", "ButtonCancel": "At\u0161aukti", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Vietin\u0117 medija", "HeaderOfflineDownloadsDescription": "Atsisi\u0173sti medij\u0105 \u012f savo \u012frenginius lengvai prieigai be interneto.", "CloudSyncFeatureDescription": "Sinchronizuokite savo medij\u0105 su debesimi lengvam i\u0161saugojimui, archyvavimui ir konvertavimui.", - "CoverArtFeatureDescription": "Vir\u0161eliai leid\u017eia sukurti linksmus vir\u0161elius ir kita pritaikant medijos paveikslus.", - "CoverArt": "Vir\u0161eliai", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Kinoteatro re\u017eimas papildomai rodo anonsus ir kit\u0105 med\u017eiag\u0105 prie\u0161 film\u0105.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Atskirti kelis naudojant:", "LabelAlbumArtists": "Albumo atlik\u0117jai:", "LabelAlbum": "Albumas:", + "Artists": "Artists", "LabelCommunityRating": "Bendruomen\u0117s vertinimas:", "LabelVoteCount": "Bals\u0173 skai\u010dius:", "LabelCriticRating": "Kritik\u0173 vertinimas:", - "LabelCriticRatingSummary": "Kritik\u0173 vertinimo ap\u017evalga:", "LabelAwardSummary": "Apdovanojim\u0173 ap\u017evalga:", "LabelWebsite": "Tinklapis:", "LabelTagline": "\u0160\u016bkis:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 muzikinis video", "ValueMusicVideoCount": "{0} muzikiniai video", "ValueMinutes": "{0} min.", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "\u012eveskite vien\u0105 ar daugiau paie\u0161kos kriterij\u0173. Pa\u0161alinkite kriterij\u0173 jei norite gauti daugiau paie\u0161kos rezultat\u0173.", "PleaseEnterNameOrId": "\u012eveskite vard\u0105 arba i\u0161orin\u012f ID.", "MessageItemSaved": "Elementas i\u0161saugotas.", "SearchResults": "Paie\u0161kos rezultatai", - "SyncToOtherDevice": "Sinchronizuoti \u012f kit\u0105 \u012frengin\u012f", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "\u012egalinti \u017ei\u016br\u0117jim\u0105 neprisijungus", "ServerNameIsRestarting": "Emby Serveris - {0} leid\u017eiamas i\u0161 naujo.", "ServerNameIsShuttingDown": "Emby Serveris - {0} i\u0161sijungia.", @@ -290,7 +286,9 @@ "Settings": "Nustatymai", "ShowIndicatorsFor": "Rodyti indikatorius:", "NewEpisodes": "Naujoms serijoms", + "Episodes": "Episodes", "HDPrograms": "HD laidoms", + "Programs": "Programs", "LiveBroadcasts": "Tiesiogin\u0117ms transliacijoms", "Premieres": "Premieras", "RepeatEpisodes": "Kartojamoms serijoms", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json index 45a12ae0ba..e4e6f761af 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ms.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json b/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json index ac557cc41b..e8673ea0ea 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/nb.json @@ -15,13 +15,6 @@ "ItemCount": "{0} elementer", "OriginalAirDateValue": "Original utgivelse dato: {0}", "EndsAtValue": "Ender p\u00e5 {0}", - "OptionSundayShort": "S\u00f8n", - "OptionMondayShort": "Man", - "OptionTuesdayShort": "Tir", - "OptionWednesdayShort": "Ons", - "OptionThursdayShort": "Tor", - "OptionFridayShort": "Fre", - "OptionSaturdayShort": "L\u00f8r", "HeaderSelectDate": "Velg dato", "ButtonOk": "Ok", "ButtonCancel": "Avbryt", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Skill flere med semikolon ;", "LabelAlbumArtists": "Album artister:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Fellesskap anmeldelse:", "LabelVoteCount": "Stemme tall:", "LabelCriticRating": "Kritiker anmeldelse:", - "LabelCriticRatingSummary": "Kritiker anmeldelse sammendrag:", "LabelAwardSummary": "Pris sammendrag:", "LabelWebsite": "Nettsted:", "LabelTagline": "Slagord:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 musikkvideo", "ValueMusicVideoCount": "{0} musikkvideoer", "ValueMinutes": "{0} minutter", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Oppgi ett eller flere s\u00f8ke kriterier. Fjern kriterie for \u00e5 \u00f8ke s\u00f8ke resultater.", "PleaseEnterNameOrId": "Vennligst skriv ett navn eller en ekstern id.", "MessageItemSaved": "Element lagret.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Innstillinger", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json b/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json index 42f7e0184b..e8cd67bbe3 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/nl.json @@ -1,27 +1,20 @@ { "MessageUnlockAppWithPurchaseOrSupporter": "Ontgrendel deze functie met een kleine eenmalige aankoop, of met een actief Emby Premiere abonnement.", "MessageUnlockAppWithSupporter": "Ontgrendel deze functie met een actief Emby Premiere abonnement.", - "MessageToValidateSupporter": "Als u een actieve Emby Premiere abonnement heeft , zorg er dan voor dat u deze activeert in uw Emby Server Dashboard door te klikken op Emby Premiere in het hoofdmenu.", + "MessageToValidateSupporter": "Als u een actieve Emby Premiere abonnement heeft, zorg er dan voor dat u deze activeert in uw Emby Server Dashboard door te klikken op Emby Premiere in het hoofdmenu.", "ValueSpecialEpisodeName": "Speciaal - {0}", "Share": "Delen", "Add": "Toevoegen", "ServerUpdateNeeded": "Deze Emby Server moet worden bijgewerkt. Om de laatste versie te downloaden, gaat u naar {0}", "LiveTvGuideRequiresUnlock": "De Live TV Gids is momenteel gelimiteerd tot {0} kanalen. Klik op de Geef vrij knop om te zien hoe u deze limiet op kunt heffen.", "AttributeNew": "Nieuw", - "Premiere": "Premi\u00e8re", + "Premiere": "Premiere", "Live": "Live", "Repeat": "Herhaling", "TrackCount": "{0} nummers", "ItemCount": "{0} items", "OriginalAirDateValue": "Originele uitzenddatum: {0}", "EndsAtValue": "Eindigt om {0}", - "OptionSundayShort": "Zo", - "OptionMondayShort": "Ma", - "OptionTuesdayShort": "Di", - "OptionWednesdayShort": "Wo", - "OptionThursdayShort": "Do", - "OptionFridayShort": "Vr", - "OptionSaturdayShort": "Za", "HeaderSelectDate": "Selecteer Datum", "ButtonOk": "Ok", "ButtonCancel": "Annuleren", @@ -43,16 +36,15 @@ "RecordSeries": "Series Opnemen", "HeaderCinemaMode": "Bioscoop mode", "HeaderCloudSync": "Cloud Synchronisatie", - "HeaderDownloadedMedia": "Downloaded Media", + "HeaderDownloadedMedia": "Gedownloade Media", "Downloads": "Downloads", "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media naar je apparaten voor gemakkelijk offlineebruik.", "CloudSyncFeatureDescription": "Synchroniseer uw media naar de cloud voor eenvoudige backup, archivering en conversie.", - "CoverArtFeatureDescription": "Cover Art cre\u00ebert leuke covers en andere bewerkingen om u te helpen uw mediabeelden te personaliseren.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Plan individuele Live TV opnames, serie opnames en meer met Emby DVR.", "ButtonCancelSyncJob": "Annuleer synchronisatie", "CancelSyncJobConfirmation": "Als u de synchroniseertaak annuleert wordt de gesynchroniseerde media bij de volgende synchroniseertaak van het apparaat verwijderd. Weet u zeker dat u door wilt gaan?", - "CinemaModeFeatureDescription": "Bioscoop mode geeft u de ware bioscoopervaring met trailers en aangepaste intro voor de weergave van uw keuze.", + "CinemaModeFeatureDescription": "Bioscoop mode geeft u de ware bioscoopervaring met trailers en aangepaste intro's voor de weergave van uw keuze.", "HeaderFreeApps": "Gratis Emby Apps", "FreeAppsFeatureDescription": "Geniet van gratis toegang tot Emby apps voor uw apparaten.", "HeaderBecomeProjectSupporter": "Verkrijg Emby Premiere", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Scheidt meerdere met een ;", "LabelAlbumArtists": "Album artiesten:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Beoordeling gemeenschap:", "LabelVoteCount": "Aantal stemmen:", "LabelCriticRating": "Beoordeling critici:", - "LabelCriticRatingSummary": "Samenvatting beoordeling critici:", "LabelAwardSummary": "Samenvatting prijzen:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 muziek video", "ValueMusicVideoCount": "{0} muziek video's", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Vul \u00e9\u00e9n of meer zoek criteria in. Verwijder criteria om zoekresultaten te vergroten.", "PleaseEnterNameOrId": "Voer een naam of een externe Id in", "MessageItemSaved": "Item opgeslagen.", "SearchResults": "Zoekresultaten", - "SyncToOtherDevice": "Synchroniseren met een ander apparaat", + "DownloadToOtherDevice": "Naar ander apparaat downloaden", "MakeAvailableOffline": "Maak offline beschikbaar", "ServerNameIsRestarting": "Emby Server - {0} is opnieuw aan het opstarten.", "ServerNameIsShuttingDown": "Emby Server - {0} is aan het afsluiten.", @@ -290,11 +286,13 @@ "Settings": "Instellingen", "ShowIndicatorsFor": "Toon indicatoren voor:", "NewEpisodes": "Nieuwe afleveringen", + "Episodes": "Episodes", "HDPrograms": "HD Programma's", + "Programs": "Programs", "LiveBroadcasts": "Live uitzendingen", "Premieres": "Premi\u00e8res", "RepeatEpisodes": "Herhaal afleveringen", - "DvrSubscriptionRequired": "Emby DVR vereist een actieve Emby premi\u00e8re-abonnement.", + "DvrSubscriptionRequired": "Emby DVR vereist een actief Emby Premiere abonnement.", "HeaderCancelRecording": "Opname Annuleren", "CancelRecording": "Opname annuleren", "HeaderKeepRecording": "Bewaar opname", @@ -334,101 +332,104 @@ "Movies": "Films", "Kids": "Kinderen", "EnableColorCodedBackgrounds": "Inschakelen van kleur gecodeerde achtergronden", - "SortChannelsBy": "Sort channels by:", - "RecentlyWatched": "Recently watched", - "ChannelNumber": "Channel number", - "HeaderBenefitsEmbyPremiere": "Benefits of Emby Premiere", - "ThankYouForTryingEnjoyOneMinute": "Please enjoy one minute of playback. Thank you for trying Emby.", - "HeaderTryPlayback": "Try Playback", - "HowDidYouPay": "How did you pay?", - "IHaveEmbyPremiere": "I have Emby Premiere", - "IPurchasedThisApp": "I purchased this app", - "ButtonRestorePreviousPurchase": "Restore Purchase", - "ButtonUnlockWithPurchase": "Unlock with Purchase", - "ButtonUnlockPrice": "Unlock {0}", - "EmbyPremiereMonthlyWithPrice": "Emby Premiere Monthly {0}", - "HeaderAlreadyPaid": "Already Paid?", - "ButtonPlayOneMinute": "Play One Minute", - "PlaceFavoriteChannelsAtBeginning": "Place favorite channels at the beginning", - "HeaderUnlockFeature": "Unlock Feature", - "MessageDidYouKnowCinemaMode": "Did you know that with Emby Premiere, you can enhance your experience with features like Cinema Mode?", - "MessageDidYouKnowCinemaMode2": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the main feature.", - "HeaderPlayMyMedia": "Play my Media", - "HeaderDiscoverEmbyPremiere": "Discover Emby Premiere", + "SortChannelsBy": "Sorteer kanalen op:", + "RecentlyWatched": "Onlangs bekeken", + "ChannelNumber": "Kanaal nummer", + "HeaderBenefitsEmbyPremiere": "Voordelen van Emby Premiere", + "ThankYouForTryingEnjoyOneMinute": "U kunt nu genieten van \u00e9\u00e9n minuut afspelen. Bedankt voor het uitproberen van Emby.", + "HeaderTryPlayback": "Probeer Afspelen", + "HowDidYouPay": "Hoe hebt u betaald?", + "IHaveEmbyPremiere": "Ik heb Emby Premiere", + "IPurchasedThisApp": "Ik heb deze app gekocht", + "ButtonRestorePreviousPurchase": "Herstel Aankoop", + "ButtonUnlockWithPurchase": "Geef vrij met een aankoop", + "ButtonUnlockPrice": "{0} Vrijgeven", + "EmbyPremiereMonthlyWithPrice": "Emby Premiere Maandelijks {0}", + "HeaderAlreadyPaid": "Reeds betaald?", + "ButtonPlayOneMinute": "Speel \u00e9\u00e9n minuut", + "PlaceFavoriteChannelsAtBeginning": "Plaats favoriete kanalen aan het begin", + "HeaderUnlockFeature": "Ontgrendel Functionaliteit", + "MessageDidYouKnowCinemaMode": "Wist u dat u met Emby Premiere u uw ervaring met functies zoals Cinema Mode kunt verbeteren?", + "MessageDidYouKnowCinemaMode2": "Cinema Mode geeft u de echte bioscoop ervaring met trailers en eigen intro's voordat de film begint.", + "HeaderPlayMyMedia": "Mijn Media afspelen", + "HeaderDiscoverEmbyPremiere": "Ontdek Emby Premiere", "Items": "Items", - "OneChannel": "One channel", - "ConfirmRemoveDownload": "Remove download?", - "RemoveDownload": "Remove download", - "AddedOnValue": "Added {0}", - "RemovingFromDevice": "Removing from device", - "RemoveFromDevice": "Remove from device", - "KeepOnDevice": "Keep on device", - "CancelDownload": "Cancel download", - "SyncJobItemStatusReadyToTransfer": "Ready to Transfer", - "SyncJobItemStatusSyncedMarkForRemoval": "Removing from device", - "SyncJobItemStatusQueued": "Queued", - "SyncJobItemStatusConverting": "Converting", - "SyncJobItemStatusTransferring": "Transferring", - "SyncJobItemStatusSynced": "Downloaded", - "SyncJobItemStatusFailed": "Failed", - "SyncJobItemStatusRemovedFromDevice": "Removed from device", - "SyncJobItemStatusCancelled": "Cancelled", - "Retry": "Retry", - "HeaderMyDevice": "My Device", - "Continue": "Continue", - "ContinueInSecondsValue": "Continue in {0} seconds.", - "HeaderRemoteControl": "Remote Control", - "Disconnect": "Disconnect", - "EnableDisplayMirroring": "Enable display mirroring", - "HeaderSelectPlayer": "Select Player", - "Quality": "Quality", - "Auto": "Auto", - "AndroidUnlockRestoreHelp": "To restore your previous purchase, please ensure you're signed into the device with the same Google (or Amazon) account that originally made the purchase. Make sure the app store is enabled and not restricted by any parental controls, and ensure you have an active internet connection. You'll only have to do this once to restore your previous purchase.", - "AspectRatio": "Aspect ratio", - "Original": "Original", - "Fill": "Fill", - "BestFit": "Best fit", - "MessageNoServersAvailableToConnect": "No servers are available to connect to. If you've been invited to share a server, make sure to accept it below or by clicking the link in the email.", - "MessagePlayAccessRestricted": "Playback of this content is currently restricted. Please contact your Emby Server administrator for more information.", - "Accept": "Accept", - "Reject": "Reject", + "OneChannel": "E\u00e9n kanaal", + "ConfirmRemoveDownload": "Download verwijderen?", + "RemoveDownload": "Download verijderen", + "AddedOnValue": "{0} Toegevoegd", + "RemovingFromDevice": "Verwijderen van apparaat", + "RemoveFromDevice": "Verwijderen van apparaat", + "KeepOnDevice": "Bewaar op apparaat", + "CancelDownload": "Download annuleren", + "SyncJobItemStatusReadyToTransfer": "Klaar om te Verzenden", + "SyncJobItemStatusSyncedMarkForRemoval": "Verwijderen van apparaat", + "SyncJobItemStatusQueued": "In wachtrij", + "SyncJobItemStatusConverting": "Converteren", + "SyncJobItemStatusTransferring": "Verzenden", + "SyncJobItemStatusSynced": "Gedownload", + "SyncJobItemStatusFailed": "Mislukt", + "SyncJobItemStatusRemovedFromDevice": "Verwijderd van apparaat", + "SyncJobItemStatusCancelled": "Geannuleerd", + "Retry": "Opnieuw proberen", + "HeaderMyDevice": "Mijn Apparaat", + "Continue": "Hervatten", + "ContinueInSecondsValue": "Hervatten over {0} seconden.", + "HeaderRemoteControl": "Afstandsbediening", + "Disconnect": "Loskoppelen", + "EnableDisplayMirroring": "Inschakelen beeld spiegelen", + "HeaderSelectPlayer": "Selecteer Speler", + "Quality": "Kwaliteit", + "Auto": "Automatisch", + "AndroidUnlockRestoreHelp": "Om uw eerdere aankoop te herstellen, controleert u of u aangemeld bent met hetzelfde Google (of Amazon) account waarmee u de aankoop deed. Controleer dat de app store is ingeschakeld en niet door ouderlijk toezicht wordt tegengehouden en controleer dat u een actieve internet verbinding hebt. U hoeft dit slechts eenmalig te doen om uw eerdere aankoop te herstellen.", + "AspectRatio": "Beeldverhouding", + "Original": "Origineel", + "Fill": "Vullen", + "BestFit": "Best passend", + "MessageNoServersAvailableToConnect": "Er zijn geen servers beschikbaar om mee te verbinden. Als u uitgenodigd bent om een server te delen accepteer dit hieronder of door op de link in het e-mailbericht te klikken.", + "MessagePlayAccessRestricted": "Afspelen hiervan is op dit moment niet toegestaan. Neem contact op met uw Emby Server beheerder voor meer informatie.", + "Accept": "Accepteren", + "Reject": "Weigeren", "Connect": "Verbind", - "HeaderMyMedia": "My Media", - "HeaderMyMediaSmall": "My Media (small)", - "LatestFromLibrary": "Latest {0}", - "HeaderLatestChannelMedia": "Latest Channel Items", - "HeaderContinueWatching": "Continue Watching", - "HeaderContinueListening": "Continue Listening", - "HeaderActiveRecordings": "Active Recordings", - "HeaderLatestRecordings": "Latest Recordings", - "LabelDownloadTo": "Download to:", - "HeaderNextUp": "Next Up", - "HeaderLatestFrom": "Latest from {0}", - "LabelHomeScreenSectionValue": "Home screen section {0}:", - "SettingsSaved": "Settings saved.", - "None": "None", + "HeaderMyMedia": "Mijn Media", + "HeaderMyMediaSmall": "Mijn Media (klein)", + "LatestFromLibrary": "Laatste {0}", + "HeaderLatestChannelMedia": "Nieuwste Kanaal Items", + "HeaderContinueWatching": "Kijken hervatten", + "HeaderContinueListening": "Luisteren hervatten", + "HeaderActiveRecordings": "Actieve Opnames", + "HeaderLatestRecordings": "Nieuwste Opnames", + "LabelDownloadTo": "Downloaden naar:", + "HeaderNextUp": "Volgende", + "HeaderLatestFrom": "Laatste van {0}", + "LabelHomeScreenSectionValue": "Beginscherm sectie {0}:", + "SettingsSaved": "Instellingen opgeslagen.", + "None": "Geen", "More": "Meer", - "Up": "Up", - "Down": "Down", - "HeaderHomeScreen": "Home Screen", - "HeaderLatestMedia": "Latest Media", - "HeaderLatestChannelItems": "Latest Channel Items", - "LabelSelectLastestItemsFolders": "Include items from the following sections in Latest Media", - "HeaderLibraryOrder": "Library Order", - "HideWatchedContentFromLatestMedia": "Hide watched content from latest media", - "HeaderOnNow": "On Now", + "Up": "Omhoog", + "Down": "Omlaag", + "HeaderHomeScreen": "Begin Scherm", + "HeaderLatestMedia": "Nieuwste Media", + "HeaderLatestChannelItems": "Nieuwste Kanaal Items", + "LabelSelectLastestItemsFolders": "Voeg media van de volgende secties toe aan Nieuwste Media", + "HeaderLibraryOrder": "Bibliotheek Volgorde", + "HideWatchedContentFromLatestMedia": "Verberg gekeken inhoud uit nieuwste media", + "HeaderOnNow": "Aan het spelen", "HeaderPlaybackError": "Afspeel Fout", - "PlaybackErrorNotAllowed": "You're currently not authorized to play this content. Please contact your system administrator for details.", - "PlaybackErrorNoCompatibleStream": "No compatible streams are currently available. Please try again later or contact your system administrator for details.", - "PlaybackErrorPlaceHolder": "Please insert the disc in order to play this video.", - "Guide": "Guide", - "Suggestions": "Suggestions", - "Favorites": "Favorites", - "Collections": "Collections", - "LabelSelectFolderGroups": "Automatically group content from the following folders into views such as Movies, Music and TV:", - "LabelSelectFolderGroupsHelp": "Folders that are unchecked will be displayed by themselves in their own view.", - "Shows": "Shows", - "HeaderLibraryFolders": "Library Folders", - "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "PlaybackErrorNotAllowed": "U bent niet bevoegd om deze content af te spelen. Neem contact op met uw systeembeheerder voor meer informatie.", + "PlaybackErrorNoCompatibleStream": "Geen compatibele streams beschikbaar. Probeer het later opnieuw of neem contact op met de serverbeheerder.", + "PlaybackErrorPlaceHolder": "De gekozen content is niet af te spelen vanaf dit apparaat. Plaats de schijf.", + "Guide": "Gids", + "Suggestions": "Suggesties", + "Favorites": "Favorieten", + "Collections": "Collecties", + "LabelSelectFolderGroups": "De inhoud van de volgende mappen automatisch groeperen in secties zoals Films, Muziek en TV:", + "LabelSelectFolderGroupsHelp": "Mappen die niet aangevinkt zijn worden getoond in hun eigen weergave.", + "Shows": "Series", + "HeaderLibraryFolders": "Bibliotheek Mappen", + "HeaderLandingScreens": "Standaard Secties", + "LandingScreensHelp": "Selecteer de standaard sectie wanneer op een bibliotheek wordt geklikt.", + "HeaderTermsOfPurchase": "Aankoop Voorwaarden", + "PrivacyPolicy": "Privacy beleid", + "TermsOfUse": "Gebruiksvoorwaarden" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json b/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json index 2005955365..40103c2a14 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/pl.json @@ -15,13 +15,6 @@ "ItemCount": "{0} pozycji", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Ndz.", - "OptionMondayShort": "Pon.", - "OptionTuesdayShort": "Wt.", - "OptionWednesdayShort": "\u015ar.", - "OptionThursdayShort": "Czw.", - "OptionFridayShort": "Pi\u0105.", - "OptionSaturdayShort": "Sob.", "HeaderSelectDate": "Wybierz Dat\u0119", "ButtonOk": "Ok", "ButtonCancel": "Anuluj", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Oddziel wiele u\u017cywaj\u0105c ;", "LabelAlbumArtists": "Wynonawcy albumu", "LabelAlbum": "Album", + "Artists": "Artists", "LabelCommunityRating": "Ocena spo\u0142eczno\u015bci:", "LabelVoteCount": "Liczba g\u0142os\u00f3w:", "LabelCriticRating": "Ocena krytyk\u00f3w:", - "LabelCriticRatingSummary": "Podsumowanie oceny krytyk\u00f3w:", "LabelAwardSummary": "Zdobyte nagrody:", "LabelWebsite": "Strona internetowa", "LabelTagline": "Tagi", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 teledysk", "ValueMusicVideoCount": "{0} teledyski", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Wpisz kryteria wyszukiwania. Zmniejszaj\u0105c ilo\u015b\u0107 kryteri\u00f3w zwi\u0119kszysz ilo\u015b\u0107 wynik\u00f3w.", "PleaseEnterNameOrId": "Prosz\u0119 wprowad\u017a nazw\u0119 lub zewn\u0119trzne Id.", "MessageItemSaved": "Obiekt zapisany.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Ustawienia", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json index b1d1c60b14..1aaef38495 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-br.json @@ -15,13 +15,6 @@ "ItemCount": "{0} itens", "OriginalAirDateValue": "Data de exibi\u00e7\u00e3o original: {0}", "EndsAtValue": "Termina \u00e0s {0}", - "OptionSundayShort": "Dom", - "OptionMondayShort": "Seg", - "OptionTuesdayShort": "Ter", - "OptionWednesdayShort": "Qua", - "OptionThursdayShort": "Qui", - "OptionFridayShort": "Sex", - "OptionSaturdayShort": "S\u00e1b", "HeaderSelectDate": "Selecionar Data", "ButtonOk": "Ok", "ButtonCancel": "Cancelar", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "M\u00eddia Offline", "HeaderOfflineDownloadsDescription": "Download sua m\u00eddia para seus dispositivos para uso offline f\u00e1cil.", "CloudSyncFeatureDescription": "Sincronize sua m\u00eddia para a nuvem para backup, arquivamento e convers\u00e3o f\u00e1ceis.", - "CoverArtFeatureDescription": "Arta da Capa cria capas divertidas e d\u00e1 outros tratamentos para ajudar na personaliza\u00e7\u00e3o das imagens da sua m\u00eddia.", - "CoverArt": "Arta da Capa", + "DvrFeatureDescription": "Agendar grava\u00e7\u00f5es individuais de TV ao vivo, grava\u00e7\u00f5es de s\u00e9ries e mais com o Emby DVR.", "ButtonCancelSyncJob": "Cancelar download", "CancelSyncJobConfirmation": "Cancelar a tarefa de sincroniza\u00e7\u00e3o remover\u00e1 as m\u00eddias transferidas do dispositivo durante o pr\u00f3ximo processo de sincroniza\u00e7\u00e3o. Deseja realmente continuar?", "CinemaModeFeatureDescription": "Modo Cinema oferece a voc\u00ea uma verdadeira experi\u00eancia de cinema com trailers e intros customizados antes da funcionalidade.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separar m\u00faltiplos usando ;", "LabelAlbumArtists": "Artistas do \u00c1lbum:", "LabelAlbum": "\u00c1lbum:", + "Artists": "Artists", "LabelCommunityRating": "Avalia\u00e7\u00e3o da comunidade:", "LabelVoteCount": "Contagem de votos:", "LabelCriticRating": "Avalia\u00e7\u00e3o da cr\u00edtica:", - "LabelCriticRatingSummary": "Resumo da avalia\u00e7\u00e3o da cr\u00edtica:", "LabelAwardSummary": "Resumo da premia\u00e7\u00e3o:", "LabelWebsite": "Website:", "LabelTagline": "Slogan:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 v\u00eddeo musical", "ValueMusicVideoCount": "{0} v\u00eddeos musicais", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Digite um ou mais crit\u00e9rios de busca. Exclua o crit\u00e9rio para aumentar os resultados da busca.", "PleaseEnterNameOrId": "Por favor, digite um nome ou Id externo.", "MessageItemSaved": "Item salvo.", "SearchResults": "Resultados da Busca", - "SyncToOtherDevice": "Sincronizar para outro dispositivo", + "DownloadToOtherDevice": "Transferir para outro dispositivo", "MakeAvailableOffline": "Disponibilizar Offline", "ServerNameIsRestarting": "Servidor Emby - {0} est\u00e1 reiniciando.", "ServerNameIsShuttingDown": "Servidor Emby - {0} est\u00e1 desligando.", @@ -275,9 +271,9 @@ "LearnMore": "Saiba mais", "LabelProfile": "Perfil:", "LabelBitrateMbps": "Taxa (Mbps):", - "SyncUnwatchedVideosOnly": "Sincronizar apenas v\u00eddeos n\u00e3o assistidos", + "SyncUnwatchedVideosOnly": "Transferir apenas v\u00eddeos n\u00e3o assistidos", "SyncUnwatchedVideosOnlyHelp": "Apenas v\u00eddeos n\u00e3o assistidos ser\u00e3o transferidos, e os v\u00eddeos ser\u00e3o removidos do dispositivo assim que forem assistidos.", - "AutomaticallySyncNewContent": "Sincronizar novo conte\u00fado automaticamente", + "AutomaticallySyncNewContent": "Transferir novo conte\u00fado automaticamente", "AutomaticallySyncNewContentHelp": "Novo conte\u00fado adicionado a esta pasta ser\u00e1 automaticamente transferido para o dispositivo.", "LabelItemLimit": "Limite de itens:", "LabelItemLimitHelp": "Opcional. Defina o n\u00famero limite de itens que ser\u00e3o transferidos.", @@ -290,7 +286,9 @@ "Settings": "Ajustes", "ShowIndicatorsFor": "Mostrar indicadores para:", "NewEpisodes": "Novos epis\u00f3dios", + "Episodes": "Episodes", "HDPrograms": "Programas em HD", + "Programs": "Programs", "LiveBroadcasts": "Broadcasts ao vivo", "Premieres": "Estr\u00e9ias", "RepeatEpisodes": "Repetir epis\u00f3dios", @@ -418,17 +416,20 @@ "HideWatchedContentFromLatestMedia": "Ocultar conte\u00fado assistido das m\u00eddias recentes", "HeaderOnNow": "Em Exibi\u00e7\u00e3o", "HeaderPlaybackError": "Erro na Reprodu\u00e7\u00e3o", - "PlaybackErrorNotAllowed": "You're currently not authorized to play this content. Please contact your system administrator for details.", - "PlaybackErrorNoCompatibleStream": "No compatible streams are currently available. Please try again later or contact your system administrator for details.", - "PlaybackErrorPlaceHolder": "Please insert the disc in order to play this video.", + "PlaybackErrorNotAllowed": "Voc\u00ea n\u00e3o est\u00e1 autorizado a reproduzir este conte\u00fado. Por favor, contacte seu administrador do sistema para mais detalhes.", + "PlaybackErrorNoCompatibleStream": "N\u00e3o existem streams compat\u00edveis. Por favor, tente novamente mais tarde ou contate o administrador do sistema para mais detalhes.", + "PlaybackErrorPlaceHolder": "Por favor, insira o disco para reproduzir este v\u00eddeo.", "Guide": "Guia", - "Suggestions": "Suggestions", - "Favorites": "Favorites", - "Collections": "Collections", - "LabelSelectFolderGroups": "Automatically group content from the following folders into views such as Movies, Music and TV:", - "LabelSelectFolderGroupsHelp": "Folders that are unchecked will be displayed by themselves in their own view.", - "Shows": "Shows", - "HeaderLibraryFolders": "Library Folders", - "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "Suggestions": "Sugest\u00f5es", + "Favorites": "Favoritos", + "Collections": "Colet\u00e2neas", + "LabelSelectFolderGroups": "Agrupar automaticamente o conte\u00fado das seguintes pastas dentro das visualiza\u00e7\u00f5es como Filmes, M\u00fasicas e TV:", + "LabelSelectFolderGroupsHelp": "Pastas que n\u00e3o est\u00e3o marcadas ser\u00e3o exibidas em sua pr\u00f3pria visualiza\u00e7\u00e3o.", + "Shows": "S\u00e9ries", + "HeaderLibraryFolders": "Pastas da Biblioteca", + "HeaderLandingScreens": "Telas de Entrada", + "LandingScreensHelp": "Selecione a tela de entrada padr\u00e3o quando clicar em uma biblioteca.", + "HeaderTermsOfPurchase": "Termos de Compra", + "PrivacyPolicy": "Pol\u00edtica de privacidade", + "TermsOfUse": "Termos de uso" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json index d7636a6f74..273a741983 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/pt-pt.json @@ -15,13 +15,6 @@ "ItemCount": "{0} itens", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Selecionar Data", "ButtonOk": "Ok", "ButtonCancel": "Cancelar", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separa m\u00faltiplas com ;", "LabelAlbumArtists": "Artistas do \u00c1lbum:", "LabelAlbum": "\u00c1lbum:", + "Artists": "Artists", "LabelCommunityRating": "Avalia\u00e7\u00e3o da comunidade:", "LabelVoteCount": "Contagem de votos:", "LabelCriticRating": "Avalia\u00e7\u00e3o da cr\u00edtica:", - "LabelCriticRatingSummary": "Resumo da avalia\u00e7\u00e3o da cr\u00edtica:", "LabelAwardSummary": "Resumo da premia\u00e7\u00e3o:", "LabelWebsite": "Website:", "LabelTagline": "Slogan:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Digite um ou mais crit\u00e9rios de busca. Exclua o crit\u00e9rio para aumentar os resultados da busca.", "PleaseEnterNameOrId": "Por favor, digite um nome ou Id externo.", "MessageItemSaved": "Item salvo.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Ajustes", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json index 5f0aa5c64a..205cd70413 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ro.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Anuleaza", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Folosire separata multipla", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json b/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json index 2cdc8a0bc3..3ed5f15944 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/ru.json @@ -15,13 +15,6 @@ "ItemCount": "{0} \u044d\u043b\u0435\u043c\u0435\u043d\u0442(\u0430\/\u043e\u0432)", "OriginalAirDateValue": "\u0414\u0430\u0442\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u044d\u0444\u0438\u0440\u0430: {0}", "EndsAtValue": "\u041a\u043e\u043d\u0435\u0446 \u0432 {0}", - "OptionSundayShort": "\u0432\u0441\u043a", - "OptionMondayShort": "\u043f\u043d\u0434", - "OptionTuesdayShort": "\u0432\u0442\u0440", - "OptionWednesdayShort": "\u0441\u0440\u0434", - "OptionThursdayShort": "\u0447\u0442\u0432", - "OptionFridayShort": "\u043f\u0442\u043d", - "OptionSaturdayShort": "\u0441\u0431\u0442", "HeaderSelectDate": "\u0412\u044b\u0431\u043e\u0440 \u0434\u0430\u0442\u044b", "ButtonOk": "\u041e\u043a", "ButtonCancel": "\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "\u0410\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0435 \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u0435", "HeaderOfflineDownloadsDescription": "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0430\u0448\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.", "CloudSyncFeatureDescription": "\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0430\u0448\u0438\u0445 \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0431\u043b\u0430\u043a\u043e\u043c \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0445 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.", - "CoverArtFeatureDescription": "Cover Art \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u043b\u043e\u0436\u043a\u0438 \u0438 \u0438\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0430\u043c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0438\u0441\u0443\u043d\u043a\u0438 \u043a \u0432\u0430\u0448\u0438\u043c \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u043c.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "\u0412\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 \u0432 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u044d\u0444\u0438\u0440\u0430, \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Emby DVR.", "ButtonCancelSyncJob": "\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443", "CancelSyncJobConfirmation": "\u041e\u0442\u043c\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0438\u0437\u044a\u044f\u0442\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c?", "CinemaModeFeatureDescription": "\u0420\u0435\u0436\u0438\u043c \u043a\u0438\u043d\u043e\u0437\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0430\u043c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043b\u0430 \u0441 \u0442\u0440\u0435\u0439\u043b\u0435\u0440\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u0434 \u0444\u0438\u043b\u044c\u043c\u043e\u043c.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "\u0414\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u043e\u0447\u043a\u0443 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 (;)", "LabelAlbumArtists": "\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438 \u0430\u043b\u044c\u0431\u043e\u043c\u0430:", "LabelAlbum": "\u0410\u043b\u044c\u0431\u043e\u043c", + "Artists": "\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438", "LabelCommunityRating": "\u041e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430:", "LabelVoteCount": "\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432:", "LabelCriticRating": "\u041e\u0446\u0435\u043d\u043a\u0430 \u043a\u0440\u0438\u0442\u0438\u043a\u043e\u0432:", - "LabelCriticRatingSummary": "\u0421\u0432\u043e\u0434\u043a\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u043e\u0432:", "LabelAwardSummary": "\u0421\u0432\u043e\u0434\u043a\u0430 \u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439:", "LabelWebsite": "\u0412\u0435\u0431\u0441\u0430\u0439\u0442:", "LabelTagline": "\u041a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u0444\u0440\u0430\u0437\u0430:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e", "ValueMusicVideoCount": "{0} \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0438\u0434\u0435\u043e", "ValueMinutes": "{0} \u043c\u0438\u043d", + "Albums": "\u0410\u043b\u044c\u0431\u043e\u043c\u044b", + "Songs": "\u041a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438", + "Books": "\u041a\u043d\u0438\u0433\u0438", + "HeaderAudioBooks": "\u0410\u0443\u0434\u0438\u043e\u043a\u043d\u0438\u0433\u0438", "HeaderIdentifyItemHelp": "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0434\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043f\u043e\u0438\u0441\u043a\u0430. \u0418\u0437\u044b\u043c\u0438\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.", "PleaseEnterNameOrId": "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 ID.", "MessageItemSaved": "\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d.", "SearchResults": "\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430", - "SyncToOtherDevice": "\u0421\u0438\u043d\u0445\u0440\u043e \u0441 \u0434\u0440. \u0443\u0441\u0442\u0440-\u043e\u043c", + "DownloadToOtherDevice": "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430 \u0434\u0440. \u0443\u0441\u0442\u0440-\u0432\u043e", "MakeAvailableOffline": "\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e", "ServerNameIsRestarting": "Emby Server - {0} \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f.", "ServerNameIsShuttingDown": "Emby Server - {0} \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443.", @@ -290,7 +286,9 @@ "Settings": "\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b", "ShowIndicatorsFor": "\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f:", "NewEpisodes": "\u041d\u043e\u0432\u044b\u0435 \u044d\u043f\u0438\u0437\u043e\u0434\u044b", + "Episodes": "\u042d\u043f\u0438\u0437\u043e\u0434\u044b", "HDPrograms": "HD-\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438", + "Programs": "\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0438", "LiveBroadcasts": "\u041f\u0440\u044f\u043c\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438", "Premieres": "\u041f\u0440\u0435\u043c\u044c\u0435\u0440\u044b", "RepeatEpisodes": "\u041f\u043e\u0432\u0442\u043e\u0440 \u044d\u043f\u0438\u0437\u043e\u0434\u043e\u0432", @@ -331,7 +329,7 @@ "Categories": "\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438", "Sports": "\u0421\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0435", "News": "\u041d\u043e\u0432\u043e\u0441\u0442\u043d\u044b\u0435", - "Movies": "\u0424\u0438\u043b\u044c\u043c\u043e\u0432\u044b\u0435", + "Movies": "\u0424\u0438\u043b\u044c\u043c\u044b", "Kids": "\u0414\u0435\u0442\u0441\u043a\u0438\u0435", "EnableColorCodedBackgrounds": "\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0444\u043e\u043d", "SortChannelsBy": "\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043d\u0430\u043b\u044b \u043f\u043e:", @@ -425,10 +423,13 @@ "Suggestions": "\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435", "Favorites": "\u0418\u0437\u0431\u0440\u0430\u043d\u043d\u043e\u0435", "Collections": "\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438", - "LabelSelectFolderGroups": "Automatically group content from the following folders into views such as Movies, Music and TV:", - "LabelSelectFolderGroupsHelp": "Folders that are unchecked will be displayed by themselves in their own view.", + "LabelSelectFolderGroups": "\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u041a\u0438\u043d\u043e, \u041c\u0443\u0437\u044b\u043a\u0430 \u0438 \u0422\u0412) \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0430\u043f\u043e\u043a:", + "LabelSelectFolderGroupsHelp": "\u041f\u0430\u043f\u043a\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043d\u044f\u0442\u044b \u0444\u043b\u0430\u0436\u043a\u0438, \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u0445.", "Shows": "\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0438", - "HeaderLibraryFolders": "Library Folders", + "HeaderLibraryFolders": "\u041c\u0435\u0434\u0438\u0430\u0442\u0435\u0447\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438", "HeaderLandingScreens": "\u0426\u0435\u043b\u0435\u0432\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u044b", - "LandingScreensHelp": "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u044d\u043a\u0440\u0430\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0449\u0435\u043b\u0447\u043a\u0435 \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0435." + "LandingScreensHelp": "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u044d\u043a\u0440\u0430\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0449\u0435\u043b\u0447\u043a\u0435 \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0435.", + "HeaderTermsOfPurchase": "\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0435\u0442\u0435\u043d\u0438\u044f", + "PrivacyPolicy": "\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438", + "TermsOfUse": "\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json b/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json index 45a12ae0ba..e4e6f761af 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/sk.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json b/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json index b5d9f25975..ac5795319e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/sl-si.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Cancel", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Nastavitve", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json b/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json index a24cc251a4..20f30495c8 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/sv.json @@ -15,13 +15,6 @@ "ItemCount": "{0} objekt", "OriginalAirDateValue": "Ursprungligt s\u00e4ndningsdatum: {0}", "EndsAtValue": "Slutar vid: {0}", - "OptionSundayShort": "S\u00f6n", - "OptionMondayShort": "M\u00e5n", - "OptionTuesdayShort": "Tis", - "OptionWednesdayShort": "Ons", - "OptionThursdayShort": "Tor", - "OptionFridayShort": "Fre", - "OptionSaturdayShort": "L\u00f6r", "HeaderSelectDate": "V\u00e4lj datum", "ButtonOk": "Ok", "ButtonCancel": "Avbryt", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offlinemedia", "HeaderOfflineDownloadsDescription": "Ladda ner media till dina enheter f\u00f6r att sen spela upp dom enkelt offline.", "CloudSyncFeatureDescription": "Synka din media till molnet f\u00f6r l\u00e4tttillg\u00e4ngligt backup, arkivering och konvertering.", - "CoverArtFeatureDescription": "Cover Art ger dig roliga omslag och andra funktioner f\u00f6r att personanpassa dina mediabilder.", - "CoverArt": "Bildomslag", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Avbryt synkronisering", "CancelSyncJobConfirmation": "Om synkroniseringen avbryts kommer synkad media tas bort under n\u00e4sta synkprocess. \u00c4r du s\u00e4ker p\u00e5 att du vill forts\u00e4tta?", "CinemaModeFeatureDescription": "Biol\u00e4get ger dig en bioupplevelse med trailers och anpassade intros f\u00f6re varje film.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separera med ; vid flera", "LabelAlbumArtists": "Albumartist:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Anv\u00e4ndaromd\u00f6me:", "LabelVoteCount": "Antal r\u00f6ster:", "LabelCriticRating": "Kritikerbetyg:", - "LabelCriticRatingSummary": "Sammanfattning av kritikerbetyg:", "LabelAwardSummary": "Sammanfattning av utm\u00e4rkelser:", "LabelWebsite": "Hemsida:", "LabelTagline": "Slogan:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 musikvideo", "ValueMusicVideoCount": "{0} musikvideor", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Ange ett eller flera s\u00f6kkriterier. Ta bort kriterier f\u00f6r att f\u00e5 fler tr\u00e4ffar.", "PleaseEnterNameOrId": "Ange ett namn eller externt id.", "MessageItemSaved": "Objektet har sparats.", "SearchResults": "S\u00f6kresultat", - "SyncToOtherDevice": "Synka till annan enhet", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "G\u00f6r tillg\u00e4nglig offline", "ServerNameIsRestarting": "Emby Server - {0} startas om.", "ServerNameIsShuttingDown": "Emby Server - {0} st\u00e4ngs ner.", @@ -290,7 +286,9 @@ "Settings": "Inst\u00e4llningar", "ShowIndicatorsFor": "Visa indikatorer f\u00f6r:", "NewEpisodes": "Nya avsnitt", + "Episodes": "Episodes", "HDPrograms": "HD-program", + "Programs": "Programs", "LiveBroadcasts": "Lives\u00e4ndningar", "Premieres": "Premi\u00e4rer", "RepeatEpisodes": "Upprepa avsnitt", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json b/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json index b22bdf9d5b..7d4d84926a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/tr.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "\u0130ptal", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json b/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json index 4c79ea122d..133c427d85 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/uk.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 \u043c\u0443\u0437\u0438\u0447\u043d\u0438\u0439 \u043a\u043b\u0456\u043f", "ValueMusicVideoCount": "{0} \u043c\u0443\u0437\u0438\u0447\u043d\u0438\u0445 \u043a\u043b\u0456\u043f\u0456\u0432", "ValueMinutes": "{0} \u0445\u0432\u0438\u043b\u0438\u043d", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json b/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json index f72e71b6d3..a77b6fde98 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/vi.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "Select Date", "ButtonOk": "Ok", "ButtonCancel": "Tho\u00e1t", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json index 25968da819..dda8d7347f 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-cn.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "\u7ed3\u675f\u4e8e {0}", - "OptionSundayShort": "\u661f\u671f\u65e5", - "OptionMondayShort": "\u661f\u671f\u4e00", - "OptionTuesdayShort": "\u661f\u671f\u4e8c", - "OptionWednesdayShort": "\u661f\u671f\u4e09", - "OptionThursdayShort": "\u661f\u671f\u56db", - "OptionFridayShort": "\u661f\u671f\u4e94", - "OptionSaturdayShort": "\u661f\u671f\u516d", "HeaderSelectDate": "\u9009\u62e9\u65e5\u671f", "ButtonOk": "\u786e\u5b9a", "ButtonCancel": "\u53d6\u6d88", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "\u79bb\u7ebf\u5a92\u4f53", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "\u5c01\u9762\u56fe", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "\u53d6\u6d88\u540c\u6b65", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "\u72ec\u7acb\u591a\u529f\u80fd\uff1b", "LabelAlbumArtists": "\u4e13\u8f91\u4f5c\u5bb6\uff1a", "LabelAlbum": "\u4e13\u8f91\uff1a", + "Artists": "Artists", "LabelCommunityRating": "\u516c\u4f17\u8bc4\u5206\uff1a", "LabelVoteCount": "\u6295\u7968\u8ba1\u6570\uff1a", "LabelCriticRating": "\u5f71\u8bc4\u4eba\u8bc4\u5206\uff1a", - "LabelCriticRatingSummary": "\u5f71\u8bc4\u4eba\u8bc4\u4ef7\uff1a", "LabelAwardSummary": "\u83b7\u5956\u6458\u8981\uff1a", "LabelWebsite": "\u7f51\u7ad9\uff1a", "LabelTagline": "\u53e3\u53f7\uff1a", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1\u4e2a\u97f3\u4e50\u89c6\u9891", "ValueMusicVideoCount": "{0} \u4e2a\u97f3\u4e50\u89c6\u9891", "ValueMinutes": "{0} \u5206\u949f", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "\u8f93\u5165\u4e00\u4e2a\u6216\u591a\u4e2a\u641c\u7d22\u6761\u4ef6\u3002\u5220\u9664\u6761\u4ef6\u53ef\u5f97\u5230\u66f4\u591a\u641c\u7d22\u7ed3\u679c\u3002", "PleaseEnterNameOrId": "\u8bf7\u8f93\u5165\u4e00\u4e2a\u540d\u79f0\u6216\u4e00\u4e2a\u5916\u90e8ID\u3002", "MessageItemSaved": "\u9879\u76ee\u5df2\u4fdd\u5b58\u3002", "SearchResults": "\u641c\u7d22\u7ed3\u679c", - "SyncToOtherDevice": "\u540c\u6b65\u5230\u5176\u4ed6\u8bbe\u5907", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} \u91cd\u542f\u4e2d\u3002", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "\u8bbe\u7f6e", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "\u9ad8\u6e05\u8282\u76ee", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json index bebce15626..5a230ffe54 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-hk.json @@ -15,13 +15,6 @@ "ItemCount": "{0} items", "OriginalAirDateValue": "Original air date: {0}", "EndsAtValue": "Ends at {0}", - "OptionSundayShort": "Sun", - "OptionMondayShort": "Mon", - "OptionTuesdayShort": "Tue", - "OptionWednesdayShort": "Wed", - "OptionThursdayShort": "Thu", - "OptionFridayShort": "Fri", - "OptionSaturdayShort": "Sat", "HeaderSelectDate": "\u9078\u64c7\u65e5\u671f", "ButtonOk": "Ok", "ButtonCancel": "\u53d6\u6d88", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "\u5206\u958b\u591a\u91cd\u4f7f\u7528", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "\u8a0e\u8ad6\u5340\u8a55\u5206", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1\u500b MV", "ValueMusicVideoCount": "{0} \u500b MV", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json index 6833e2ffc1..2f06d32d9a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/zh-tw.json @@ -15,13 +15,6 @@ "ItemCount": "{0}\u500b\u9805\u76ee", "OriginalAirDateValue": "\u539f\u59cb\u64ad\u51fa\u65e5\u671f\uff1a{0}", "EndsAtValue": "\u5b8c\u7d50\u65bc{0}", - "OptionSundayShort": "\u65e5", - "OptionMondayShort": "\u4e00", - "OptionTuesdayShort": "\u4e8c", - "OptionWednesdayShort": "\u4e09", - "OptionThursdayShort": "\u56db", - "OptionFridayShort": "\u4e94", - "OptionSaturdayShort": "\u516d", "HeaderSelectDate": "\u9078\u64c7\u65e5\u671f", "ButtonOk": "\u78ba\u5b9a", "ButtonCancel": "\u53d6\u6d88", @@ -48,8 +41,7 @@ "HeaderOfflineDownloads": "Offline Media", "HeaderOfflineDownloadsDescription": "Download media to your devices for easy offline use.", "CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.", - "CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.", - "CoverArt": "Cover Art", + "DvrFeatureDescription": "Schedule individual Live TV recordings, series recordings, and more with Emby DVR.", "ButtonCancelSyncJob": "Cancel download", "CancelSyncJobConfirmation": "Cancelling the sync job will remove downloaded media from the device during the next sync process. Are you sure you wish to proceed?", "CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.", @@ -154,10 +146,10 @@ "LabelArtistsHelp": "Separate multiple using ;", "LabelAlbumArtists": "Album artists:", "LabelAlbum": "Album:", + "Artists": "Artists", "LabelCommunityRating": "Community rating:", "LabelVoteCount": "Vote count:", "LabelCriticRating": "Critic rating:", - "LabelCriticRatingSummary": "Critic rating summary:", "LabelAwardSummary": "Award summary:", "LabelWebsite": "Website:", "LabelTagline": "Tagline:", @@ -255,11 +247,15 @@ "ValueOneMusicVideo": "1 music video", "ValueMusicVideoCount": "{0} music videos", "ValueMinutes": "{0} min", + "Albums": "Albums", + "Songs": "Songs", + "Books": "Books", + "HeaderAudioBooks": "Audio Books", "HeaderIdentifyItemHelp": "Enter one or more search criteria. Remove criteria to increase search results.", "PleaseEnterNameOrId": "Please enter a name or an external Id.", "MessageItemSaved": "Item saved.", "SearchResults": "Search Results", - "SyncToOtherDevice": "Sync to other device", + "DownloadToOtherDevice": "Download to other device", "MakeAvailableOffline": "Make available offline", "ServerNameIsRestarting": "Emby Server - {0} is restarting.", "ServerNameIsShuttingDown": "Emby Server - {0} is shutting down.", @@ -290,7 +286,9 @@ "Settings": "Settings", "ShowIndicatorsFor": "Show indicators for:", "NewEpisodes": "New episodes", + "Episodes": "Episodes", "HDPrograms": "HD programs", + "Programs": "Programs", "LiveBroadcasts": "Live broadcasts", "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", @@ -430,5 +428,8 @@ "Shows": "Shows", "HeaderLibraryFolders": "Library Folders", "HeaderLandingScreens": "Landing Screens", - "LandingScreensHelp": "Select the default landing screen when clicking on a library." + "LandingScreensHelp": "Select the default landing screen when clicking on a library.", + "HeaderTermsOfPurchase": "Terms of Purchase", + "PrivacyPolicy": "Privacy policy", + "TermsOfUse": "Terms of use" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js b/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js index ea6b70f1e6..71969c1e9a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js +++ b/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js @@ -1 +1 @@ -define(["apphost","globalize","connectionManager","layoutManager","shell","focusManager","scrollHelper","appSettings","registrationServices","dialogHelper","paper-icon-button-light","formDialogStyle"],function(appHost,globalize,connectionManager,layoutManager,shell,focusManager,scrollHelper,appSettings,registrationServices,dialogHelper){"use strict";function submitJob(dlg,apiClient,userId,syncOptions,form){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!form)throw new Error("form cannot be null");var selectSyncTarget=form.querySelector("#selectSyncTarget"),target=selectSyncTarget?selectSyncTarget.value:null;if(!target)return require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#PleaseSelectDeviceToSyncTo"))}),!1;var options={userId:userId,TargetId:target,ParentId:syncOptions.ParentId,Category:syncOptions.Category};return setJobValues(options,form),syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){dialogHelper.close(dlg),require(["toast"],function(toast){var msg=target===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadScheduled"):globalize.translate("sharedcomponents#SyncJobCreated");toast(msg)})}),!0}function submitQuickSyncJob(apiClient,userId,targetId,syncOptions){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!targetId)throw new Error("targetId cannot be null");var options={userId:userId,TargetId:targetId,ParentId:syncOptions.ParentId,Category:syncOptions.Category,Quality:syncOptions.Quality,Bitrate:syncOptions.Bitrate};return syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){require(["toast"],function(toast){var msg=targetId===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadScheduled"):globalize.translate("sharedcomponents#SyncJobCreated");toast(msg)})})}function setJobValues(job,form){var txtBitrate=form.querySelector("#txtBitrate"),bitrate=txtBitrate?txtBitrate.value:null;bitrate&&(bitrate=1e6*parseFloat(bitrate)),job.Bitrate=bitrate;var selectQuality=form.querySelector("#selectQuality");selectQuality&&(job.Quality=selectQuality.value,appSettings.set("sync-lastquality",job.Quality||""));var selectProfile=form.querySelector("#selectProfile");selectProfile&&(job.Profile=selectProfile.value);var txtItemLimit=form.querySelector("#txtItemLimit");txtItemLimit&&(job.ItemLimit=txtItemLimit.value||null);var chkSyncNewContent=form.querySelector("#chkSyncNewContent");chkSyncNewContent&&(job.SyncNewContent=chkSyncNewContent.checked);var chkUnwatchedOnly=form.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(job.UnwatchedOnly=chkUnwatchedOnly.checked)}function renderForm(options){return new Promise(function(resolve,reject){require(["emby-checkbox","emby-input","emby-select"],function(){appHost.appInfo().then(function(appInfo){renderFormInternal(options,appInfo,resolve)})})})}function onHelpLinkClick(e){return shell.openUrl(this.href),e.preventDefault(),!1}function renderFormInternal(options,appInfo,resolve){var elem=options.elem,dialogOptions=options.dialogOptions,targets=dialogOptions.Targets,html="",targetContainerClass=options.isLocalSync?" hide":"";(options.showName||dialogOptions.Options.indexOf("Name")!==-1)&&(html+='

    ');var syncTargetLabel=globalize.translate("sharedcomponents#LabelDownloadTo");options.readOnlySyncTarget?(html+='
    ',html+='',html+="
    "):(html+='
    ',html+='",targets.length||(html+='
    '+globalize.translate("sharedcomponents#LabelSyncNoTargetsHelp")+"
    ",html+='"),html+="
    "),html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='',html+="
    ",dialogOptions.Options.indexOf("UnwatchedOnly")!==-1&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#SyncUnwatchedVideosOnlyHelp")+"
    ",html+="
    "),dialogOptions.Options.indexOf("SyncNewContent")!==-1&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#AutomaticallySyncNewContentHelp")+"
    ",html+="
    "),dialogOptions.Options.indexOf("ItemLimit")!==-1&&(html+='
    ',html+='',html+='
    '+globalize.translate("sharedcomponents#LabelItemLimitHelp")+"
    ",html+="
    "),elem.innerHTML=html;var selectSyncTarget=elem.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.addEventListener("change",function(){loadQualityOptions(elem,this.value,options.dialogOptionsFn).then(resolve)}),selectSyncTarget.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectProfile=elem.querySelector("#selectProfile");selectProfile&&(selectProfile.addEventListener("change",function(){onProfileChange(elem,this.value)}),dialogOptions.ProfileOptions.length&&selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=elem.querySelector("#selectQuality");selectQuality&&(selectQuality.addEventListener("change",function(){onQualityChange(elem,this.value)}),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var lnkLearnMore=elem.querySelector(".lnkLearnMore");lnkLearnMore&&lnkLearnMore.addEventListener("click",onHelpLinkClick),setTimeout(function(){focusManager.autoFocus(elem)},100)}function showSyncMenu(options){return registrationServices.validateFeature("sync").then(function(){return showSyncMenuInternal(options)})}function enableAutoSync(options){if(!options.isLocalSync)return!1;var firstItem=(options.items||[])[0]||{};return"Audio"===firstItem.Type||("MusicAlbum"===firstItem.Type||("MusicArtist"===firstItem.Type||("MusicGenre"===firstItem.Type||"Playlist"===firstItem.Type&&"Audio"===firstItem.MediaType)))}function showSyncMenuInternal(options){var apiClient=connectionManager.getApiClient(options.serverId),userId=apiClient.getCurrentUserId();if(enableAutoSync(options))return submitQuickSyncJob(apiClient,userId,apiClient.deviceId(),{items:options.items,Quality:"custom",Bitrate:appSettings.maxStaticMusicBitrate()});var dialogOptionsQuery={UserId:userId,ItemIds:(options.items||[]).map(function(i){return i.Id||i}).join(","),ParentId:options.ParentId,Category:options.Category};return apiClient.getJSON(apiClient.getUrl("Sync/Options",dialogOptionsQuery)).then(function(dialogOptions){currentDialogOptions=dialogOptions;var dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="small";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ';var syncButtonLabel=options.isLocalSync?globalize.translate("sharedcomponents#Download"):globalize.translate("sharedcomponents#Sync");html+=syncButtonLabel,html+="

    ",html+='",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html,dlg.querySelector(".lnkHelp").addEventListener("click",onHelpLinkClick);var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return submitted=submitJob(dlg,apiClient,userId,options,this),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1);var promise=dialogHelper.open(dlg);return renderForm({elem:dlg.querySelector(".formFields"),dialogOptions:dialogOptions,dialogOptionsFn:getTargetDialogOptionsFn(apiClient,dialogOptionsQuery),isLocalSync:options.isLocalSync}),promise.then(function(){return layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})})}function getTargetDialogOptionsFn(apiClient,query){return function(targetId){return query.TargetId=targetId,apiClient.getJSON(apiClient.getUrl("Sync/Options",query))}}function setQualityFieldVisible(form,visible){var fldQuality=form.querySelector(".fldQuality"),selectQuality=form.querySelector("#selectQuality");visible?(fldQuality&&fldQuality.classList.remove("hide"),selectQuality&&selectQuality.removeAttribute("required")):(fldQuality&&fldQuality.classList.add("hide"),selectQuality&&selectQuality.removeAttribute("required"))}function onProfileChange(form,profileId){var options=currentDialogOptions||{},profileOptions=options.ProfileOptions||[];if(profileOptions.length){var option=profileOptions.filter(function(o){return o.Id===profileId})[0],qualityOptions=options.QualityOptions||[];option?(form.querySelector(".profileDescription").innerHTML=option.Description||"",setQualityFieldVisible(form,qualityOptions.length>0&&option.EnableQualityOptions&&options.Options.indexOf("Quality")!==-1)):(form.querySelector(".profileDescription").innerHTML="",setQualityFieldVisible(form,qualityOptions.length>0&&options.Options.indexOf("Quality")!==-1))}}function onQualityChange(form,qualityId){var options=currentDialogOptions||{},option=(options.QualityOptions||[]).filter(function(o){return o.Id===qualityId})[0],qualityDescription=form.querySelector(".qualityDescription");option?qualityDescription.innerHTML=option.Description||"":qualityDescription.innerHTML="";var fldBitrate=form.querySelector(".fldBitrate"),txtBitrate=form.querySelector("#txtBitrate");"custom"===qualityId?(fldBitrate&&fldBitrate.classList.remove("hide"),txtBitrate&&txtBitrate.setAttribute("required","required")):(fldBitrate&&fldBitrate.classList.add("hide"),txtBitrate&&txtBitrate.removeAttribute("required"))}function renderTargetDialogOptions(form,options){currentDialogOptions=options;var fldProfile=form.querySelector(".fldProfile"),selectProfile=form.querySelector("#selectProfile");options.ProfileOptions.length&&options.Options.indexOf("Profile")!==-1?(fldProfile&&fldProfile.classList.remove("hide"),selectProfile&&selectProfile.setAttribute("required","required")):(fldProfile&&fldProfile.classList.add("hide"),selectProfile&&selectProfile.removeAttribute("required")),setQualityFieldVisible(form,options.QualityOptions.length>0),selectProfile&&(selectProfile.innerHTML=options.ProfileOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join(""),selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=form.querySelector("#selectQuality");if(selectQuality){selectQuality.innerHTML=options.QualityOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join("");var lastQuality=appSettings.get("sync-lastquality");lastQuality&&options.QualityOptions.filter(function(i){return i.Id===lastQuality}).length&&(selectQuality.value=lastQuality),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}}function loadQualityOptions(form,targetId,dialogOptionsFn){return dialogOptionsFn(targetId).then(function(options){return renderTargetDialogOptions(form,options)})}var currentDialogOptions;return{showMenu:showSyncMenu,renderForm:renderForm,setJobValues:setJobValues}}); \ No newline at end of file +define(["apphost","globalize","connectionManager","layoutManager","focusManager","scrollHelper","appSettings","registrationServices","dialogHelper","paper-icon-button-light","formDialogStyle"],function(appHost,globalize,connectionManager,layoutManager,focusManager,scrollHelper,appSettings,registrationServices,dialogHelper){"use strict";function submitJob(dlg,apiClient,userId,syncOptions,form){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!form)throw new Error("form cannot be null");var selectSyncTarget=form.querySelector("#selectSyncTarget"),target=selectSyncTarget?selectSyncTarget.value:null;if(!target)return require(["toast"],function(toast){toast(globalize.translate("sharedcomponents#PleaseSelectDeviceToSyncTo"))}),!1;var options={userId:userId,TargetId:target,ParentId:syncOptions.ParentId,Category:syncOptions.Category};return setJobValues(options,form),syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){dialogHelper.close(dlg),require(["toast"],function(toast){var msg=target===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadScheduled"):globalize.translate("sharedcomponents#SyncJobCreated");toast(msg)})}),!0}function submitQuickSyncJob(apiClient,userId,targetId,syncOptions){if(!userId)throw new Error("userId cannot be null");if(!syncOptions)throw new Error("syncOptions cannot be null");if(!targetId)throw new Error("targetId cannot be null");var options={userId:userId,TargetId:targetId,ParentId:syncOptions.ParentId,Category:syncOptions.Category,Quality:syncOptions.Quality,Bitrate:syncOptions.Bitrate};return syncOptions.items&&syncOptions.items.length&&(options.ItemIds=(syncOptions.items||[]).map(function(i){return i.Id||i}).join(",")),apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/Jobs"),data:JSON.stringify(options),contentType:"application/json",dataType:"json"}).then(function(){require(["toast"],function(toast){var msg=targetId===apiClient.deviceId()?globalize.translate("sharedcomponents#DownloadScheduled"):globalize.translate("sharedcomponents#SyncJobCreated");toast(msg)})})}function setJobValues(job,form){var txtBitrate=form.querySelector("#txtBitrate"),bitrate=txtBitrate?txtBitrate.value:null;bitrate&&(bitrate=1e6*parseFloat(bitrate)),job.Bitrate=bitrate;var selectQuality=form.querySelector("#selectQuality");selectQuality&&(job.Quality=selectQuality.value,appSettings.set("sync-lastquality",job.Quality||""));var selectProfile=form.querySelector("#selectProfile");selectProfile&&(job.Profile=selectProfile.value);var txtItemLimit=form.querySelector("#txtItemLimit");txtItemLimit&&(job.ItemLimit=txtItemLimit.value||null);var chkSyncNewContent=form.querySelector("#chkSyncNewContent");chkSyncNewContent&&(job.SyncNewContent=chkSyncNewContent.checked);var chkUnwatchedOnly=form.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(job.UnwatchedOnly=chkUnwatchedOnly.checked)}function renderForm(options){return new Promise(function(resolve,reject){require(["emby-checkbox","emby-input","emby-select"],function(){appHost.appInfo().then(function(appInfo){renderFormInternal(options,appInfo,resolve)})})})}function renderFormInternal(options,appInfo,resolve){var elem=options.elem,dialogOptions=options.dialogOptions,targets=dialogOptions.Targets,html="",targetContainerClass=options.isLocalSync?" hide":"";(options.showName||dialogOptions.Options.indexOf("Name")!==-1)&&(html+='

    ');var syncTargetLabel=globalize.translate("sharedcomponents#LabelDownloadTo");options.readOnlySyncTarget?(html+='
    ',html+='',html+="
    "):(html+='
    ',html+='",targets.length||(html+='
    '+globalize.translate("sharedcomponents#LabelSyncNoTargetsHelp")+"
    ",html+='"),html+="
    "),html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='",html+='
    ',html+="
    ",html+='
    ',html+='',html+="
    ",dialogOptions.Options.indexOf("UnwatchedOnly")!==-1&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#SyncUnwatchedVideosOnlyHelp")+"
    ",html+="
    "),dialogOptions.Options.indexOf("SyncNewContent")!==-1&&(html+='
    ',html+="",html+='
    '+globalize.translate("sharedcomponents#AutomaticallySyncNewContentHelp")+"
    ",html+="
    "),dialogOptions.Options.indexOf("ItemLimit")!==-1&&(html+='
    ',html+='',html+='
    '+globalize.translate("sharedcomponents#LabelItemLimitHelp")+"
    ",html+="
    "),elem.innerHTML=html;var selectSyncTarget=elem.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.addEventListener("change",function(){loadQualityOptions(elem,this.value,options.dialogOptionsFn).then(resolve)}),selectSyncTarget.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectProfile=elem.querySelector("#selectProfile");selectProfile&&(selectProfile.addEventListener("change",function(){onProfileChange(elem,this.value)}),dialogOptions.ProfileOptions.length&&selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=elem.querySelector("#selectQuality");selectQuality&&(selectQuality.addEventListener("change",function(){onQualityChange(elem,this.value)}),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))),setTimeout(function(){focusManager.autoFocus(elem)},100)}function showSyncMenu(options){return registrationServices.validateFeature("sync").then(function(){return showSyncMenuInternal(options)})}function enableAutoSync(options){if(!options.isLocalSync)return!1;var firstItem=(options.items||[])[0]||{};return"Audio"===firstItem.Type||("MusicAlbum"===firstItem.Type||("MusicArtist"===firstItem.Type||("MusicGenre"===firstItem.Type||"Playlist"===firstItem.Type&&"Audio"===firstItem.MediaType)))}function showSyncMenuInternal(options){var apiClient=connectionManager.getApiClient(options.serverId),userId=apiClient.getCurrentUserId();if(enableAutoSync(options))return submitQuickSyncJob(apiClient,userId,apiClient.deviceId(),{items:options.items,Quality:"custom",Bitrate:appSettings.maxStaticMusicBitrate()});var dialogOptionsQuery={UserId:userId,ItemIds:(options.items||[]).map(function(i){return i.Id||i}).join(","),ParentId:options.ParentId,Category:options.Category};return apiClient.getJSON(apiClient.getUrl("Sync/Options",dialogOptionsQuery)).then(function(dialogOptions){currentDialogOptions=dialogOptions;var dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="small";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ';var syncButtonLabel=options.isLocalSync?globalize.translate("sharedcomponents#Download"):globalize.translate("sharedcomponents#Sync");html+=syncButtonLabel,html+="

    ",html+='info'+globalize.translate("sharedcomponents#Help")+"",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return submitted=submitJob(dlg,apiClient,userId,options,this),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1);var promise=dialogHelper.open(dlg);return renderForm({elem:dlg.querySelector(".formFields"),dialogOptions:dialogOptions,dialogOptionsFn:getTargetDialogOptionsFn(apiClient,dialogOptionsQuery),isLocalSync:options.isLocalSync}),promise.then(function(){return layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})})}function getTargetDialogOptionsFn(apiClient,query){return function(targetId){return query.TargetId=targetId,apiClient.getJSON(apiClient.getUrl("Sync/Options",query))}}function setQualityFieldVisible(form,visible){var fldQuality=form.querySelector(".fldQuality"),selectQuality=form.querySelector("#selectQuality");visible?(fldQuality&&fldQuality.classList.remove("hide"),selectQuality&&selectQuality.removeAttribute("required")):(fldQuality&&fldQuality.classList.add("hide"),selectQuality&&selectQuality.removeAttribute("required"))}function onProfileChange(form,profileId){var options=currentDialogOptions||{},profileOptions=options.ProfileOptions||[];if(profileOptions.length){var option=profileOptions.filter(function(o){return o.Id===profileId})[0],qualityOptions=options.QualityOptions||[];option?(form.querySelector(".profileDescription").innerHTML=option.Description||"",setQualityFieldVisible(form,qualityOptions.length>0&&option.EnableQualityOptions&&options.Options.indexOf("Quality")!==-1)):(form.querySelector(".profileDescription").innerHTML="",setQualityFieldVisible(form,qualityOptions.length>0&&options.Options.indexOf("Quality")!==-1))}}function onQualityChange(form,qualityId){var options=currentDialogOptions||{},option=(options.QualityOptions||[]).filter(function(o){return o.Id===qualityId})[0],qualityDescription=form.querySelector(".qualityDescription");option?qualityDescription.innerHTML=option.Description||"":qualityDescription.innerHTML="";var fldBitrate=form.querySelector(".fldBitrate"),txtBitrate=form.querySelector("#txtBitrate");"custom"===qualityId?(fldBitrate&&fldBitrate.classList.remove("hide"),txtBitrate&&txtBitrate.setAttribute("required","required")):(fldBitrate&&fldBitrate.classList.add("hide"),txtBitrate&&txtBitrate.removeAttribute("required"))}function renderTargetDialogOptions(form,options){currentDialogOptions=options;var fldProfile=form.querySelector(".fldProfile"),selectProfile=form.querySelector("#selectProfile");options.ProfileOptions.length&&options.Options.indexOf("Profile")!==-1?(fldProfile&&fldProfile.classList.remove("hide"),selectProfile&&selectProfile.setAttribute("required","required")):(fldProfile&&fldProfile.classList.add("hide"),selectProfile&&selectProfile.removeAttribute("required")),setQualityFieldVisible(form,options.QualityOptions.length>0),selectProfile&&(selectProfile.innerHTML=options.ProfileOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join(""),selectProfile.dispatchEvent(new CustomEvent("change",{bubbles:!0})));var selectQuality=form.querySelector("#selectQuality");if(selectQuality){selectQuality.innerHTML=options.QualityOptions.map(function(o){var selectedAttribute=o.IsDefault?' selected="selected"':"";return'"}).join("");var lastQuality=appSettings.get("sync-lastquality");lastQuality&&options.QualityOptions.filter(function(i){return i.Id===lastQuality}).length&&(selectQuality.value=lastQuality),selectQuality.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}}function loadQualityOptions(form,targetId,dialogOptionsFn){return dialogOptionsFn(targetId).then(function(options){return renderTargetDialogOptions(form,options)})}var currentDialogOptions;return{showMenu:showSyncMenu,renderForm:renderForm,setJobValues:setJobValues}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js b/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js index c59359db07..ae670dffde 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/sync/syncjobeditor.js @@ -1 +1 @@ -define(["connectionManager","serverNotifications","events","datetime","dom","imageLoader","loading","globalize","apphost","layoutManager","scrollHelper","dialogHelper","shell","listViewStyle","paper-icon-button-light","emby-button","formDialogStyle"],function(connectionManager,serverNotifications,events,datetime,dom,imageLoader,loading,globalize,appHost,layoutManager,scrollHelper,dialogHelper,shell){"use strict";function renderJob(context,job,dialogOptions){require(["syncDialog"],function(syncDialog){syncDialog.renderForm({elem:context.querySelector(".syncJobFormContent"),dialogOptions:dialogOptions,dialogOptionsFn:getTargetDialogOptionsFn(dialogOptions),showName:!0,readOnlySyncTarget:!0}).then(function(){fillJobValues(context,job,dialogOptions)})})}function getTargetDialogOptionsFn(dialogOptions){return function(targetId){return Promise.resolve(dialogOptions)}}function getJobItemHtml(jobItem,apiClient,index){var html="",hasActions=["Queued","Cancelled","Failed","ReadyToTransfer","Transferring","Converting","Synced"].indexOf(jobItem.Status)!==-1,listItemClass="listItem listItem-shaded";layoutManager.tv&&hasActions&&(listItemClass+=" btnJobItemMenu"),layoutManager.tv&&(listItemClass+=" listItem-button");var tagName=layoutManager.tv?"button":"div";html+="<"+tagName+' type="button" class="'+listItemClass+'" data-itemid="'+jobItem.Id+'" data-status="'+jobItem.Status+'" data-remove="'+jobItem.IsMarkedForRemoval+'">';var imgUrl;jobItem.PrimaryImageItemId&&(imgUrl=apiClient.getImageUrl(jobItem.PrimaryImageItemId,{type:"Primary",width:80,tag:jobItem.PrimaryImageTag,minScale:1.5})),html+=imgUrl?'
    ":'sync',html+='
    ',html+='

    ',html+=jobItem.ItemName,html+="

    ",html+="Failed"===jobItem.Status?'
    ':'
    ',html+=globalize.translate("sharedcomponents#SyncJobItemStatus"+jobItem.Status),"Synced"===jobItem.Status&&jobItem.IsMarkedForRemoval&&(html+="
    ",html+=globalize.translate("sharedcomponents#RemovingFromDevice")),html+="
    ",html+='
    ',html+='
    ',html+="
    ",html+="
    ";var moreIcon="dots-horiz"===appHost.moreIcon?"":"";return layoutManager.tv||(html+=hasActions?'":'"),html+=""}function renderJobItems(context,items,apiClient){var html="";html+="

    "+globalize.translate("sharedcomponents#Items")+"

    ",html+='
    ';var index=0;html+=items.map(function(i){return getJobItemHtml(i,apiClient,index++)}).join(""),html+="
    ";var elem=context.querySelector(".jobItems");elem.innerHTML=html,imageLoader.lazyChildren(elem)}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function showJobItemMenu(elem,jobId,apiClient){var context=parentWithClass(elem,"formDialog"),listItem=parentWithClass(elem,"listItem"),jobItemId=listItem.getAttribute("data-itemid"),status=listItem.getAttribute("data-status"),remove="true"===listItem.getAttribute("data-remove").toLowerCase(),menuItems=[];"Failed"===status||"Cancelled"===status?menuItems.push({name:globalize.translate("sharedcomponents#Retry"),id:"retry"}):"Queued"===status||"Transferring"===status||"Converting"===status||"ReadyToTransfer"===status?menuItems.push({name:globalize.translate("sharedcomponents#CancelDownload"),id:"cancel"}):"Synced"===status&&remove?menuItems.push({name:globalize.translate("sharedcomponents#KeepOnDevice"),id:"unmarkforremoval"}):"Synced"===status&&menuItems.push({name:globalize.translate("sharedcomponents#RemoveFromDevice"),id:"markforremoval"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"cancel":cancelJobItem(context,jobId,jobItemId,apiClient);break;case"retry":retryJobItem(context,jobId,jobItemId,apiClient);break;case"markforremoval":markForRemoval(context,jobId,jobItemId,apiClient);break;case"unmarkforremoval":unMarkForRemoval(context,jobId,jobItemId,apiClient)}}})})}function cancelJobItem(context,jobId,jobItemId,apiClient){loading.show(),apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Sync/JobItems/"+jobItemId)}).then(function(){loadJob(context,jobId,apiClient)})}function markForRemoval(context,jobId,jobItemId,apiClient){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/MarkForRemoval")}).then(function(){loadJob(context,jobId,apiClient)})}function unMarkForRemoval(context,jobId,jobItemId,apiClient){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/UnmarkForRemoval")}).then(function(){loadJob(context,jobId,apiClient)})}function retryJobItem(context,jobId,jobItemId,apiClient){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/Enable")}).then(function(){loadJob(context,jobId,apiClient)})}function fillJobValues(context,job,editOptions){var txtSyncJobName=context.querySelector(".syncJobName");txtSyncJobName&&(txtSyncJobName.innerHTML=job.Name);var selectProfile=context.querySelector("#selectProfile");selectProfile&&(selectProfile.value=job.Profile||"");var selectQuality=context.querySelector("#selectQuality");selectQuality&&(selectQuality.value=job.Quality||"");var chkUnwatchedOnly=context.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(chkUnwatchedOnly.checked=job.UnwatchedOnly);var chkSyncNewContent=context.querySelector("#chkSyncNewContent");chkSyncNewContent&&(chkSyncNewContent.checked=job.SyncNewContent);var txtItemLimit=context.querySelector("#txtItemLimit");txtItemLimit&&(txtItemLimit.value=job.ItemLimit);var txtBitrate=context.querySelector("#txtBitrate");job.Bitrate?txtBitrate.value=job.Bitrate/1e6:txtBitrate.value="";var target=editOptions.Targets.filter(function(t){return t.Id===job.TargetId})[0],targetName=target?target.Name:"",selectSyncTarget=context.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.value=targetName)}function loadJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){apiClient.getJSON(apiClient.getUrl("Sync/Options",{UserId:job.UserId,ItemIds:job.RequestedItemIds&&job.RequestedItemIds.length?job.RequestedItemIds.join(""):null,ParentId:job.ParentId,Category:job.Category,TargetId:job.TargetId})).then(function(options){_jobOptions=options,renderJob(context,job,options),loading.hide()})}),apiClient.getJSON(apiClient.getUrl("Sync/JobItems",{JobId:id,AddMetadata:!0})).then(function(result){renderJobItems(context,result.Items,apiClient),loading.hide()})}function loadJobInfo(context,job,jobItems,apiClient){renderJobItems(context,jobItems,apiClient),loading.hide()}function saveJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){require(["syncDialog"],function(syncDialog){syncDialog.setJobValues(job,context),apiClient.ajax({url:apiClient.getUrl("Sync/Jobs/"+id),type:"POST",data:JSON.stringify(job),contentType:"application/json"}).then(function(){loading.hide(),dialogHelper.close(context)})})})}function onHelpLinkClick(e){return shell.openUrl(this.href),e.preventDefault(),!1}function startListening(apiClient,jobId){var startParams="0,1500";startParams+=","+jobId,apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobStart",startParams)}function stopListening(apiClient){apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobStop","")}function bindEvents(context,jobId,apiClient){context.querySelector(".jobItems").addEventListener("click",function(e){var btnJobItemMenu=dom.parentWithClass(e.target,"btnJobItemMenu");btnJobItemMenu&&showJobItemMenu(btnJobItemMenu,jobId,apiClient)})}function showEditor(options){function onSyncJobMessage(e,apiClient,msg){loadJobInfo(dlg,msg.Job,msg.JobItems,apiClient)}var apiClient=connectionManager.getApiClient(options.serverId),id=options.jobId,dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="medium";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=globalize.translate("sharedcomponents#Sync"),html+="

    ",html+='",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html,dlg.querySelector(".lnkHelp").addEventListener("click",onHelpLinkClick);var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return saveJob(dlg,id,apiClient),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),loadJob(dlg,id,apiClient),bindEvents(dlg,id,apiClient);var promise=dialogHelper.open(dlg);return startListening(apiClient,id),events.on(serverNotifications,"SyncJob",onSyncJobMessage),promise.then(function(){return stopListening(apiClient),events.off(serverNotifications,"SyncJob",onSyncJobMessage),layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})}var _jobOptions;return{show:showEditor}}); \ No newline at end of file +define(["connectionManager","serverNotifications","events","datetime","dom","imageLoader","loading","globalize","apphost","layoutManager","scrollHelper","dialogHelper","listViewStyle","paper-icon-button-light","emby-button","formDialogStyle","emby-linkbutton"],function(connectionManager,serverNotifications,events,datetime,dom,imageLoader,loading,globalize,appHost,layoutManager,scrollHelper,dialogHelper){"use strict";function renderJob(context,job,dialogOptions){require(["syncDialog"],function(syncDialog){syncDialog.renderForm({elem:context.querySelector(".syncJobFormContent"),dialogOptions:dialogOptions,dialogOptionsFn:getTargetDialogOptionsFn(dialogOptions),showName:!0,readOnlySyncTarget:!0}).then(function(){fillJobValues(context,job,dialogOptions)})})}function getTargetDialogOptionsFn(dialogOptions){return function(targetId){return Promise.resolve(dialogOptions)}}function getJobItemHtml(jobItem,apiClient,index){var html="",hasActions=["Queued","Cancelled","Failed","ReadyToTransfer","Transferring","Converting","Synced"].indexOf(jobItem.Status)!==-1,listItemClass="listItem listItem-shaded";layoutManager.tv&&hasActions&&(listItemClass+=" btnJobItemMenu"),layoutManager.tv&&(listItemClass+=" listItem-button");var tagName=layoutManager.tv?"button":"div";html+="<"+tagName+' type="button" class="'+listItemClass+'" data-itemid="'+jobItem.Id+'" data-status="'+jobItem.Status+'" data-remove="'+jobItem.IsMarkedForRemoval+'">';var imgUrl;jobItem.PrimaryImageItemId&&(imgUrl=apiClient.getImageUrl(jobItem.PrimaryImageItemId,{type:"Primary",width:80,tag:jobItem.PrimaryImageTag,minScale:1.5})),html+=imgUrl?'
    ":'sync',html+='
    ',html+='

    ',html+=jobItem.ItemName,html+="

    ",html+="Failed"===jobItem.Status?'
    ':'
    ',html+=globalize.translate("sharedcomponents#SyncJobItemStatus"+jobItem.Status),"Synced"===jobItem.Status&&jobItem.IsMarkedForRemoval&&(html+="
    ",html+=globalize.translate("sharedcomponents#RemovingFromDevice")),html+="
    ",html+='
    ',html+='
    ',html+="
    ",html+="
    ";var moreIcon="dots-horiz"===appHost.moreIcon?"":"";return layoutManager.tv||(html+=hasActions?'":'"),html+=""}function renderJobItems(context,items,apiClient){var html="";html+="

    "+globalize.translate("sharedcomponents#Items")+"

    ",html+='
    ';var index=0;html+=items.map(function(i){return getJobItemHtml(i,apiClient,index++)}).join(""),html+="
    ";var elem=context.querySelector(".jobItems");elem.innerHTML=html,imageLoader.lazyChildren(elem)}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function showJobItemMenu(elem,jobId,apiClient){var context=parentWithClass(elem,"formDialog"),listItem=parentWithClass(elem,"listItem"),jobItemId=listItem.getAttribute("data-itemid"),status=listItem.getAttribute("data-status"),remove="true"===listItem.getAttribute("data-remove").toLowerCase(),menuItems=[];"Failed"===status||"Cancelled"===status?menuItems.push({name:globalize.translate("sharedcomponents#Retry"),id:"retry"}):"Queued"===status||"Transferring"===status||"Converting"===status||"ReadyToTransfer"===status?menuItems.push({name:globalize.translate("sharedcomponents#CancelDownload"),id:"cancel"}):"Synced"===status&&remove?menuItems.push({name:globalize.translate("sharedcomponents#KeepOnDevice"),id:"unmarkforremoval"}):"Synced"===status&&menuItems.push({name:globalize.translate("sharedcomponents#RemoveFromDevice"),id:"markforremoval"}),require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"cancel":cancelJobItem(context,jobId,jobItemId,apiClient);break;case"retry":retryJobItem(context,jobId,jobItemId,apiClient);break;case"markforremoval":markForRemoval(context,jobId,jobItemId,apiClient);break;case"unmarkforremoval":unMarkForRemoval(context,jobId,jobItemId,apiClient)}}})})}function cancelJobItem(context,jobId,jobItemId,apiClient){loading.show(),apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Sync/JobItems/"+jobItemId)}).then(function(){loadJob(context,jobId,apiClient)})}function markForRemoval(context,jobId,jobItemId,apiClient){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/MarkForRemoval")}).then(function(){loadJob(context,jobId,apiClient)})}function unMarkForRemoval(context,jobId,jobItemId,apiClient){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/UnmarkForRemoval")}).then(function(){loadJob(context,jobId,apiClient)})}function retryJobItem(context,jobId,jobItemId,apiClient){apiClient.ajax({type:"POST",url:apiClient.getUrl("Sync/JobItems/"+jobItemId+"/Enable")}).then(function(){loadJob(context,jobId,apiClient)})}function fillJobValues(context,job,editOptions){var txtSyncJobName=context.querySelector(".syncJobName");txtSyncJobName&&(txtSyncJobName.innerHTML=job.Name);var selectProfile=context.querySelector("#selectProfile");selectProfile&&(selectProfile.value=job.Profile||"");var selectQuality=context.querySelector("#selectQuality");selectQuality&&(selectQuality.value=job.Quality||"");var chkUnwatchedOnly=context.querySelector("#chkUnwatchedOnly");chkUnwatchedOnly&&(chkUnwatchedOnly.checked=job.UnwatchedOnly);var chkSyncNewContent=context.querySelector("#chkSyncNewContent");chkSyncNewContent&&(chkSyncNewContent.checked=job.SyncNewContent);var txtItemLimit=context.querySelector("#txtItemLimit");txtItemLimit&&(txtItemLimit.value=job.ItemLimit);var txtBitrate=context.querySelector("#txtBitrate");job.Bitrate?txtBitrate.value=job.Bitrate/1e6:txtBitrate.value="";var target=editOptions.Targets.filter(function(t){return t.Id===job.TargetId})[0],targetName=target?target.Name:"",selectSyncTarget=context.querySelector("#selectSyncTarget");selectSyncTarget&&(selectSyncTarget.value=targetName)}function loadJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){apiClient.getJSON(apiClient.getUrl("Sync/Options",{UserId:job.UserId,ItemIds:job.RequestedItemIds&&job.RequestedItemIds.length?job.RequestedItemIds.join(""):null,ParentId:job.ParentId,Category:job.Category,TargetId:job.TargetId})).then(function(options){_jobOptions=options,renderJob(context,job,options),loading.hide()})}),apiClient.getJSON(apiClient.getUrl("Sync/JobItems",{JobId:id,AddMetadata:!0})).then(function(result){renderJobItems(context,result.Items,apiClient),loading.hide()})}function loadJobInfo(context,job,jobItems,apiClient){renderJobItems(context,jobItems,apiClient),loading.hide()}function saveJob(context,id,apiClient){loading.show(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs/"+id)).then(function(job){require(["syncDialog"],function(syncDialog){syncDialog.setJobValues(job,context),apiClient.ajax({url:apiClient.getUrl("Sync/Jobs/"+id),type:"POST",data:JSON.stringify(job),contentType:"application/json"}).then(function(){loading.hide(),dialogHelper.close(context)})})})}function startListening(apiClient,jobId){var startParams="0,1500";startParams+=","+jobId,apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobStart",startParams)}function stopListening(apiClient){apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobStop","")}function bindEvents(context,jobId,apiClient){context.querySelector(".jobItems").addEventListener("click",function(e){var btnJobItemMenu=dom.parentWithClass(e.target,"btnJobItemMenu");btnJobItemMenu&&showJobItemMenu(btnJobItemMenu,jobId,apiClient)})}function showEditor(options){function onSyncJobMessage(e,apiClient,msg){loadJobInfo(dlg,msg.Job,msg.JobItems,apiClient)}var apiClient=connectionManager.getApiClient(options.serverId),id=options.jobId,dlgElementOptions={removeOnClose:!0,scrollY:!1,autoFocus:!1};layoutManager.tv?dlgElementOptions.size="fullscreen":dlgElementOptions.size="medium";var dlg=dialogHelper.createDialog(dlgElementOptions);dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=globalize.translate("sharedcomponents#Sync"),html+="

    ",html+='info'+globalize.translate("sharedcomponents#Help")+"",html+="
    ",html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",dlg.innerHTML=html;var submitted=!1;dlg.querySelector("form").addEventListener("submit",function(e){return saveJob(dlg,id,apiClient),e.preventDefault(),!1}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),loadJob(dlg,id,apiClient),bindEvents(dlg,id,apiClient);var promise=dialogHelper.open(dlg);return startListening(apiClient,id),events.on(serverNotifications,"SyncJob",onSyncJobMessage),promise.then(function(){return stopListening(apiClient),events.off(serverNotifications,"SyncJob",onSyncJobMessage),layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),submitted?Promise.resolve():Promise.reject()})}var _jobOptions;return{show:showEditor}}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js b/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js index dc63af487b..f482fb5398 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js +++ b/dashboard-ui/bower_components/emby-webcomponents/sync/syncjoblist.js @@ -1 +1 @@ -define(["serverNotifications","events","loading","connectionManager","imageLoader","dom","globalize","registrationServices","layoutManager","listViewStyle"],function(serverNotifications,events,loading,connectionManager,imageLoader,dom,globalize,registrationServices,layoutManager){"use strict";function onSyncJobsUpdated(e,apiClient,data){var listInstance=this;renderList(listInstance,data,apiClient)}function refreshList(listInstance,jobs){for(var i=0,length=jobs.length;i0&&progress<100&&(progress=progress.toFixed(1)),html+=progress+"%"}return html}function getSyncJobHtml(listInstance,job,apiClient){var html="",tagName=layoutManager.tv?"button":"div",typeAttribute="button"===tagName?' type="button"':"",listItemClass="listItem listItem-shaded";layoutManager.tv&&(listItemClass+=" listItem-button listItem-focusscale",listItemClass+=" btnJobMenu"),html+="<"+tagName+typeAttribute+' class="'+listItemClass+'" data-id="'+job.Id+'" data-status="'+job.Status+'">';var imgUrl;job.PrimaryImageItemId&&(imgUrl=apiClient.getImageUrl(job.PrimaryImageItemId,{type:"Primary",width:80,tag:job.PrimaryImageTag,minScale:1.5})),imgUrl?(html+='
    ',html+="
    "):html+='file_download';var textLines=[],name=job.Name;job.ParentName&&(name+=" - "+job.ParentName),textLines.push(name),1===job.ItemCount||textLines.push(globalize.translate("sharedcomponents#ItemCount",job.ItemCount)),html+='
    ';for(var i=0,length=textLines.length;i',html+=textLines[i],html+=""):(html+='
    ',html+=textLines[i],html+="
    ");return html+='
    ',html+=getProgressText(job),html+="
    ",html+="
    ",layoutManager.tv||(html+=''),html+=""}function renderList(listInstance,jobs,apiClient){if((new Date).getTime()-listInstance.lastDataLoad<6e4)return void refreshList(listInstance,jobs);listInstance.lastDataLoad=(new Date).getTime();for(var html="",lastTargetName="",isLocalSync=listInstance.options.isLocalSync,showTargetName=!isLocalSync,hasOpenSection=!1,i=0,length=jobs.length;i",html+="
    ",hasOpenSection=!1),lastTargetName=targetName,html+='
    ',html+="

    "+targetName+"

    ",html+="
    ",html+='
    ',hasOpenSection=!0)}html+=getSyncJobHtml(listInstance,job,apiClient)}hasOpenSection&&(html+="
    ");var elem=listInstance.options.element.querySelector(".syncJobListContent");html||(html=isLocalSync?'
    '+globalize.translate("sharedcomponents#MessageNoDownloadsFound")+"
    ":'
    '+globalize.translate("sharedcomponents#MessageNoSyncJobsFound")+"
    "),elem.innerHTML=html,imageLoader.lazyChildren(elem)}function fetchData(listInstance){listInstance.lastDataLoad=0,loading.show();var options={},apiClient=getApiClient(listInstance);return listInstance.options.userId&&(options.UserId=listInstance.options.userId),listInstance.options.isLocalSync?options.TargetId=apiClient.deviceId():options.ExcludeTargetIds=apiClient.deviceId(),apiClient.getJSON(apiClient.getUrl("Sync/Jobs",options)).then(function(response){renderList(listInstance,response.Items,apiClient),loading.hide()})}function startListening(listInstance){var startParams="0,1500",apiClient=getApiClient(listInstance);listInstance.options.userId&&(startParams+=","+listInstance.options.userId),listInstance.options.isLocalSync&&(startParams+=","+apiClient.deviceId()),apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobsStart",startParams)}function stopListening(listInstance){var apiClient=getApiClient(listInstance);apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobsStop","")}function getApiClient(listInstance){return connectionManager.getApiClient(listInstance.options.serverId)}function showJobMenu(listInstance,elem){var item=dom.parentWithClass(elem,"listItem"),jobId=item.getAttribute("data-id"),status=item.getAttribute("data-status"),menuItems=[];if("Cancelled"===status)menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete"});else{menuItems.push({name:globalize.translate("sharedcomponents#Edit"),id:"edit"});var txt=listInstance.options.isLocalSync?globalize.translate("sharedcomponents#RemoveDownload"):globalize.translate("sharedcomponents#ButtonCancelSyncJob");menuItems.push({name:txt,id:"cancel"})}require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"delete":cancelJob(listInstance,jobId);break;case"cancel":cancelJob(listInstance,jobId);break;case"edit":showJobEditor(listInstance,elem)}}})})}function onElementClick(e){var listInstance=this,btnJobMenu=dom.parentWithClass(e.target,"btnJobMenu");return btnJobMenu?void showJobMenu(this,btnJobMenu):void showJobEditor(listInstance,e.target)}function showJobEditor(listInstance,elem){var listItem=dom.parentWithClass(elem,"listItem");if(listItem){var jobId=listItem.getAttribute("data-id");require(["syncJobEditor"],function(syncJobEditor){syncJobEditor.show({serverId:listInstance.options.serverId,jobId:jobId}).then(function(){fetchData(listInstance)})})}}function syncJobList(options){this.options=options;var onSyncJobsUpdatedHandler=onSyncJobsUpdated.bind(this);this.onSyncJobsUpdatedHandler=onSyncJobsUpdatedHandler,events.on(serverNotifications,"SyncJobs",onSyncJobsUpdatedHandler);var onClickHandler=onElementClick.bind(this);options.element.addEventListener("click",onClickHandler),this.onClickHandler=onClickHandler,options.element.innerHTML='
    ',fetchData(this),startListening(this),initSupporterInfo(options.element,getApiClient(this))}function showSupporterInfo(context){var html=''),html+=""}function renderList(listInstance,jobs,apiClient){if((new Date).getTime()-listInstance.lastDataLoad<6e4)return void refreshList(listInstance,jobs);listInstance.lastDataLoad=(new Date).getTime();for(var html="",lastTargetName="",isLocalSync=listInstance.options.isLocalSync,showTargetName=!isLocalSync,hasOpenSection=!1,i=0,length=jobs.length;i",html+="
    ",hasOpenSection=!1),lastTargetName=targetName,html+='
    ',html+="

    "+targetName+"

    ",html+="
    ",html+='
    ',hasOpenSection=!0)}html+=getSyncJobHtml(listInstance,job,apiClient)}hasOpenSection&&(html+="
    ");var elem=listInstance.options.element.querySelector(".syncJobListContent");html||(html=isLocalSync?'
    '+globalize.translate("sharedcomponents#MessageNoDownloadsFound")+"
    ":'
    '+globalize.translate("sharedcomponents#MessageNoSyncJobsFound")+"
    "),elem.innerHTML=html,imageLoader.lazyChildren(elem)}function fetchData(listInstance){listInstance.lastDataLoad=0,loading.show();var options={},apiClient=getApiClient(listInstance);return listInstance.options.userId&&(options.UserId=listInstance.options.userId),listInstance.options.isLocalSync&&(options.TargetId=apiClient.deviceId()),apiClient.getJSON(apiClient.getUrl("Sync/Jobs",options)).then(function(response){renderList(listInstance,response.Items,apiClient),loading.hide()})}function startListening(listInstance){var startParams="0,1500",apiClient=getApiClient(listInstance);listInstance.options.userId&&(startParams+=","+listInstance.options.userId),listInstance.options.isLocalSync&&(startParams+=","+apiClient.deviceId()),apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobsStart",startParams)}function stopListening(listInstance){var apiClient=getApiClient(listInstance);apiClient.isWebSocketOpen()&&apiClient.sendWebSocketMessage("SyncJobsStop","")}function getApiClient(listInstance){return connectionManager.getApiClient(listInstance.options.serverId)}function showJobMenu(listInstance,elem){var item=dom.parentWithClass(elem,"listItem"),jobId=item.getAttribute("data-id"),status=item.getAttribute("data-status"),menuItems=[];if("Cancelled"===status)menuItems.push({name:globalize.translate("sharedcomponents#Delete"),id:"delete"});else{menuItems.push({name:globalize.translate("sharedcomponents#Edit"),id:"edit"});var txt=listInstance.options.isLocalSync?globalize.translate("sharedcomponents#RemoveDownload"):globalize.translate("sharedcomponents#ButtonCancelSyncJob");menuItems.push({name:txt,id:"cancel"})}require(["actionsheet"],function(actionsheet){actionsheet.show({items:menuItems,positionTo:elem,callback:function(id){switch(id){case"delete":cancelJob(listInstance,jobId);break;case"cancel":cancelJob(listInstance,jobId);break;case"edit":showJobEditor(listInstance,elem)}}})})}function onElementClick(e){var listInstance=this,btnJobMenu=dom.parentWithClass(e.target,"btnJobMenu");return btnJobMenu?void showJobMenu(this,btnJobMenu):void showJobEditor(listInstance,e.target)}function showJobEditor(listInstance,elem){var listItem=dom.parentWithClass(elem,"listItem");if(listItem){var jobId=listItem.getAttribute("data-id");require(["syncJobEditor"],function(syncJobEditor){syncJobEditor.show({serverId:listInstance.options.serverId,jobId:jobId}).then(function(){fetchData(listInstance)})})}}function syncJobList(options){this.options=options;var onSyncJobsUpdatedHandler=onSyncJobsUpdated.bind(this);this.onSyncJobsUpdatedHandler=onSyncJobsUpdatedHandler,events.on(serverNotifications,"SyncJobs",onSyncJobsUpdatedHandler);var onClickHandler=onElementClick.bind(this);options.element.addEventListener("click",onClickHandler),this.onClickHandler=onClickHandler,options.element.innerHTML='
    ',fetchData(this),startListening(this),initSupporterInfo(options.element,getApiClient(this))}function showSupporterInfo(context){var html='
    ';var videoElement=dlg.querySelector("#player");document.body.insertBefore(dlg,document.body.firstChild),videoDialog=dlg,options.fullscreen&&dlg.animate&&!browser.slow?zoomIn(dlg,1).onfinish=function(){resolve(videoElement)}:resolve(videoElement)})})}var self=this;self.name="Youtube Player",self.type="mediaplayer",self.id="youtubeplayer",self.priority=1;var videoDialog,currentSrc,currentYoutubePlayer,timeUpdateInterval,started=!1;self.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},self.canPlayItem=function(item){return!1},self.canPlayUrl=function(url){return url.toLowerCase().indexOf("youtube.com")!==-1},self.getDeviceProfile=function(){return Promise.resolve({})},self.currentSrc=function(){return currentSrc},self.play=function(options){return started=!1,createMediaElement(options).then(function(elem){return setCurrentSrc(elem,options)})},self.setSubtitleStreamIndex=function(index){},self.canSetAudioStreamIndex=function(){return!1},self.setAudioStreamIndex=function(index){},self.currentTime=function(val){if(currentYoutubePlayer)return null!=val?void currentYoutubePlayer.seekTo(val/1e3,!0):1e3*currentYoutubePlayer.getCurrentTime()},self.duration=function(val){return currentYoutubePlayer?1e3*currentYoutubePlayer.getDuration():null},self.stop=function(destroyPlayer,reportEnded){var src=currentSrc;return src&&(currentYoutubePlayer&¤tYoutubePlayer.stopVideo(),onEndedInternal(reportEnded),destroyPlayer&&self.destroy()),Promise.resolve()},self.destroy=function(){embyRouter.setTransparency("none");var dlg=videoDialog;dlg&&(videoDialog=null,dlg.parentNode.removeChild(dlg))},self.pause=function(){currentYoutubePlayer&&(currentYoutubePlayer.pauseVideo(),setTimeout(onPause,200))},self.unpause=function(){currentYoutubePlayer&&(currentYoutubePlayer.playVideo(),setTimeout(onPlaying,200))},self.paused=function(){return!!currentYoutubePlayer&&(console.log(currentYoutubePlayer.getPlayerState()),2===currentYoutubePlayer.getPlayerState())},self.volume=function(val){return null!=val?self.setVolume(val):self.getVolume()},self.setVolume=function(val){currentYoutubePlayer&&null!=val&¤tYoutubePlayer.setVolume(val)},self.getVolume=function(){if(currentYoutubePlayer)return currentYoutubePlayer.getVolume()},self.setMute=function(mute){mute?currentYoutubePlayer&¤tYoutubePlayer.mute():currentYoutubePlayer&¤tYoutubePlayer.unMute()},self.isMuted=function(){currentYoutubePlayer&¤tYoutubePlayer.isMuted()}}}); \ No newline at end of file +define(["require","events","browser","embyRouter","loading"],function(require,events,browser,embyRouter,loading){"use strict";function zoomIn(elem,iterations){var keyframes=[{transform:"scale3d(.2, .2, .2) ",opacity:".6",offset:0},{transform:"none",opacity:"1",offset:1}],timing={duration:240,iterations:iterations};return elem.animate(keyframes,timing)}function createMediaElement(instance,options){return new Promise(function(resolve,reject){var dlg=document.querySelector(".youtubePlayerContainer");dlg?resolve(dlg.querySelector("#player")):require(["css!./style"],function(){loading.show();var dlg=document.createElement("div");dlg.classList.add("youtubePlayerContainer"),options.fullscreen&&dlg.classList.add("onTop"),dlg.innerHTML='
    ';var videoElement=dlg.querySelector("#player");document.body.insertBefore(dlg,document.body.firstChild),instance.videoDialog=dlg,options.fullscreen&&dlg.animate&&!browser.slow?zoomIn(dlg,1).onfinish=function(){resolve(videoElement)}:resolve(videoElement)})})}function onVideoResize(){var instance=this,player=instance.currentYoutubePlayer,dlg=instance.videoDialog;player&&dlg&&player.setSize(dlg.offsetWidth,dlg.offsetHeight)}function clearTimeUpdateInterval(instance){instance.timeUpdateInterval&&clearInterval(instance.timeUpdateInterval),instance.timeUpdateInterval=null}function onEndedInternal(instance,triggerEnded){clearTimeUpdateInterval(instance);var resizeListener=instance.resizeListener;if(resizeListener&&(window.removeEventListener("resize",resizeListener),window.removeEventListener("orientationChange",resizeListener),instance.resizeListener=null),triggerEnded){var stopInfo={src:instance._currentSrc};events.trigger(instance,"stopped",[stopInfo])}instance._currentSrc=null,instance.currentYoutubePlayer&&instance.currentYoutubePlayer.destroy(),instance.currentYoutubePlayer=null}function onPlayerReady(event){event.target.playVideo()}function onTimeUpdate(e){events.trigger(this,"timeupdate")}function onPlaying(instance,playOptions,resolve){instance.started||(instance.started=!0,resolve(),clearTimeUpdateInterval(instance),instance.timeUpdateInterval=setInterval(onTimeUpdate.bind(instance),500),playOptions.fullscreen?embyRouter.showVideoOsd().then(function(){instance.videoDialog.classList.remove("onTop")}):(embyRouter.setTransparency("backdrop"),instance.videoDialog.classList.remove("onTop")),require(["loading"],function(loading){loading.hide()})),events.trigger(instance,"playing")}function setCurrentSrc(instance,elem,options){return new Promise(function(resolve,reject){require(["queryString"],function(queryString){instance._currentSrc=options.url;var params=queryString.parse(options.url.split("?")[1]);if(window.onYouTubeIframeAPIReady=function(){instance.currentYoutubePlayer=new YT.Player("player",{height:instance.videoDialog.offsetHeight,width:instance.videoDialog.offsetWidth,videoId:params.v,events:{onReady:onPlayerReady,onStateChange:function(event){event.data===YT.PlayerState.PLAYING?onPlaying(instance,options,resolve):event.data===YT.PlayerState.ENDED?onEndedInternal(instance):event.data===YT.PlayerState.PAUSED&&events.trigger(instance,"pause")}},playerVars:{controls:0,enablejsapi:1,modestbranding:1,rel:0,showinfo:0,fs:0,playsinline:1}});var resizeListener=instance.resizeListener;resizeListener?(window.removeEventListener("resize",resizeListener),window.addEventListener("resize",resizeListener)):resizeListener=instance.resizeListener=onVideoResize.bind(instance),window.removeEventListener("orientationChange",resizeListener),window.addEventListener("orientationChange",resizeListener)},window.YT)window.onYouTubeIframeAPIReady();else{var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}})})}function YoutubePlayer(){this.name="Youtube Player",this.type="mediaplayer",this.id="youtubeplayer",this.priority=1}return YoutubePlayer.prototype.play=function(options){this.started=!1;var instance=this;return createMediaElement(this,options).then(function(elem){return setCurrentSrc(instance,elem,options)})},YoutubePlayer.prototype.stop=function(destroyPlayer,reportEnded){var src=this._currentSrc;return src&&(this.currentYoutubePlayer&&this.currentYoutubePlayer.stopVideo(),onEndedInternal(this,reportEnded),destroyPlayer&&this.destroy()),Promise.resolve()},YoutubePlayer.prototype.destroy=function(){embyRouter.setTransparency("none");var dlg=this.videoDialog;dlg&&(this.videoDialog=null,dlg.parentNode.removeChild(dlg))},YoutubePlayer.prototype.canPlayMediaType=function(mediaType){return mediaType=(mediaType||"").toLowerCase(),"audio"===mediaType||"video"===mediaType},YoutubePlayer.prototype.canPlayItem=function(item){return!1},YoutubePlayer.prototype.canPlayUrl=function(url){return url.toLowerCase().indexOf("youtube.com")!==-1},YoutubePlayer.prototype.getDeviceProfile=function(){return Promise.resolve({})},YoutubePlayer.prototype.currentSrc=function(){return this._currentSrc},YoutubePlayer.prototype.setSubtitleStreamIndex=function(index){},YoutubePlayer.prototype.canSetAudioStreamIndex=function(){return!1},YoutubePlayer.prototype.setAudioStreamIndex=function(index){},YoutubePlayer.prototype.currentTime=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return null!=val?void currentYoutubePlayer.seekTo(val/1e3,!0):1e3*currentYoutubePlayer.getCurrentTime()},YoutubePlayer.prototype.duration=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;return currentYoutubePlayer?1e3*currentYoutubePlayer.getDuration():null},YoutubePlayer.prototype.pause=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer){currentYoutubePlayer.pauseVideo();var instance=this;setTimeout(function(){events.trigger(instance,"pause")},200)}},YoutubePlayer.prototype.unpause=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer){currentYoutubePlayer.playVideo();var instance=this;setTimeout(function(){onPlaying(instance)},200)}},YoutubePlayer.prototype.paused=function(){var currentYoutubePlayer=this.currentYoutubePlayer;return!!currentYoutubePlayer&&(console.log(currentYoutubePlayer.getPlayerState()),2===currentYoutubePlayer.getPlayerState())},YoutubePlayer.prototype.volume=function(val){return null!=val?this.setVolume(val):this.getVolume()},YoutubePlayer.prototype.setVolume=function(val){var currentYoutubePlayer=this.currentYoutubePlayer;currentYoutubePlayer&&null!=val&¤tYoutubePlayer.setVolume(val)},YoutubePlayer.prototype.getVolume=function(){var currentYoutubePlayer=this.currentYoutubePlayer;if(currentYoutubePlayer)return currentYoutubePlayer.getVolume()},YoutubePlayer.prototype.setMute=function(mute){var currentYoutubePlayer=this.currentYoutubePlayer;mute?currentYoutubePlayer&¤tYoutubePlayer.mute():currentYoutubePlayer&¤tYoutubePlayer.unMute()},YoutubePlayer.prototype.isMuted=function(){var currentYoutubePlayer=this.currentYoutubePlayer;currentYoutubePlayer&¤tYoutubePlayer.isMuted()},YoutubePlayer}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/hlsjs/dist/hls.min.js b/dashboard-ui/bower_components/hlsjs/dist/hls.min.js index 3a95d08e8d..77d12c2df3 100644 --- a/dashboard-ui/bower_components/hlsjs/dist/hls.min.js +++ b/dashboard-ui/bower_components/hlsjs/dist/hls.min.js @@ -1,7 +1,8 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Hls=e()}}(function(){var e;return function e(t,r,i){function a(s,o){if(!r[s]){if(!t[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(n)return n(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var d=r[s]={exports:{}};t[s][0].call(d.exports,function(e){var r=t[s][1][e];return a(r?r:e)},d,d.exports,e,t,r,i)}return r[s].exports}for(var n="function"==typeof require&&require,s=0;s0&&this._events[e].length>r&&(this._events[e].warned=!0,console.trace),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],n=r.length,i=-1,r===t||a(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(o=n;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],a(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(t,r,i){!function(t){var a=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/;?#]*)(.*)$/,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var a=this.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=n.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var d=o.path,f=d.substring(0,d.lastIndexOf("/")+1)+a.path;u.path=s.normalizePath(f)}else u.path=o.path,a.params||(u.params=o.params,a.query||(u.query=o.query));return null===u.path&&(u.path=r.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(u)},parseURL:function(e){var t=a.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(/(?:\/|^)\.(?=\/)/g,"");e.length!==(e=e.replace(/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};"object"==typeof i&&"object"==typeof r?r.exports=s:"function"==typeof e&&e.amd?e([],function(){return s}):"object"==typeof i?i.URLToolkit=s:t.URLToolkit=s}(this)},{}],3:[function(e,t,r){var i=arguments[3],a=arguments[4],n=arguments[5],s=JSON.stringify;t.exports=function(e,t){function r(e){p[e]=!0;for(var t in a[e][1]){var i=a[e][1][t];p[i]||r(i)}}for(var o,l=Object.keys(n),u=0,d=l.length;u500*r.duration/o){var l=e.levels,d=Math.max(1,n.bw?n.bw/8:1e3*n.loaded/s),f=l[r.level],c=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,g=n.total?n.total:Math.max(n.loaded,Math.round(r.duration*c/8)),p=t.currentTime,y=(g-n.loaded)/d,m=(h.default.bufferInfo(t,p,e.config.maxBufferHole).end-p)/o;if(m<2*r.duration/o&&y>m){var E=void 0,b=void 0;for(b=r.level-1;b>a;b--){var T=l[b].realBitrate?Math.max(l[b].realBitrate,l[b].bitrate):l[b].bitrate;if((E=r.duration*T/(6.4*d))=i;u--){var d=l[u],f=d.details,c=f?f.totalduration/f.fragments.length:t,h=!!f&&f.live,g=void 0;g=u<=e?s*r:o*r;var p=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,y=p*c/g;if(v.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(g)+"/"+p+"/"+c+"/"+n+"/"+y),g>p&&(!y||h||y=0)return c;v.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,y=i.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){g=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-m,v.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),p=y=1}}return c=this._findBestLevel(s,o,d,a,t,f+g,p,y,r),Math.max(c,0)}}]),t}(f.default);r.default=m},{30:30,31:31,32:32,34:34,48:48,50:50}],6:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&e===-1?(k.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=R.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=R.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=R.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=R.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var e,t,r,i=this.hls,a=i.config;switch(this.state){case R.ERROR:case R.PAUSED:case R.BUFFER_FLUSHING:break;case R.STARTING:this.state=R.WAITING_TRACK,this.loadedmetadata=!1;break;case R.IDLE:var n=this.tracks;if(!n)break;if(!this.media&&(this.startFragRequested||!a.startFragPrefetch))break;e=this.loadedmetadata?this.media.currentTime:this.nextLoadPosition;var s=this.mediaBuffer?this.mediaBuffer:this.media,o=f.default.bufferInfo(s,e,a.maxBufferHole),l=o.len,d=o.end,c=this.fragPrevious,h=a.maxMaxBufferLength,g=this.audioSwitch,p=this.trackId;if((lE||o.nextStart))return;k.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=E+.05}if(r.initSegment&&!r.initSegment.data)T=r.initSegment;else if(d<=E){if(T=y[0],r.live&&T.loadIdx&&T.loadIdx===this.fragLoadIdx){var A=o.nextStart?o.nextStart:E;return k.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(A+.05)),void(this.media.currentTime=A+.05)}}else{var S=void 0,L=a.maxFragLookUpTolerance,w=c?y[c.sn-y[0].sn+1]:void 0,D=function(e){var t=Math.min(L,e.duration);return e.start+e.duration-t<=d?1:e.start-t>d&&e.start?-1:0};db-L&&(L=0),S=w&&!D(w)?w:u.default.search(y,D)):S=y[m-1],S&&(T=S,E=S.start,c&&T.level===c.level&&T.sn===c.sn&&(T.snO&&Math.abs(this.fragLoadIdx-T.loadIdx)=P||C)&&(k.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=R.IDLE);break;case R.WAITING_INIT_PTS:case R.STOPPED:case R.FRAG_LOADING:case R.PARSING:case R.PARSED:case R.ENDED:}}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===R.ENDED&&(this.state=R.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(e){k.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.state=R.IDLE,this.fragCurrent=null,this.state=R.PAUSED,this.waitingFragment=null,t?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=R.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,r=e.id,i=this.tracks[r],a=t.totalduration,n=0;if(k.logger.log("track "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var s=i.details;s&&t.fragments.length>0?(E.default.mergeDetails(s,t),n=t.fragments[0].start,t.PTSKnown?k.logger.log("live audio playlist sliding:"+n.toFixed(3)):k.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,k.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,!this.startFragRequested){if(this.startPosition===-1){var o=t.startTimeOffset;isNaN(o)?this.startPosition=0:(k.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o)}this.nextLoadPosition=this.startPosition}this.state===R.WAITING_TRACK&&(this.state=R.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===R.KEY_LOADING&&(this.state=R.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===R.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var i=this.tracks[this.trackId],a=i.details,n=a.totalduration,s=t.level,o=t.sn,l=t.cc,u=this.config.defaultAudioCodec||i.audioCodec||"mp4a.40.2",d=this.stats=e.stats;if("initSegment"===o)this.state=R.IDLE,d.tparsed=d.tbuffered=performance.now(),a.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:d,frag:t,id:"audio"}),this.tick();else{this.state=R.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new h.default(this.hls,"audio"));var f=this.initPTS[l],c=a.initSegment?a.initSegment.data:[];if(c||void 0!==f){this.pendingBuffering=!0,k.logger.log("Demuxing "+o+" of ["+a.startSN+" ,"+a.endSN+"],track "+s);this.demuxer.push(e.payload,c,u,null,t,n,!1,f)}else k.logger.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+o+" of ["+a.startSN+" ,"+a.endSN+"],track "+s),this.waitingFragment=e,this.state=R.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING){var i=e.tracks,a=void 0;if(i.video&&delete i.video,a=i.audio){a.levelCodec="mp4a.40.2",a.id=e.id,this.hls.trigger(v.default.BUFFER_CODECS,i),k.logger.log("audio track:audio,container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var n=a.initSegment;if(n){var s={type:"audio",data:n,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[s]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,s))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,i=e.frag;if(r&&"audio"===e.id&&"audio"===e.type&&i.sn===r.sn&&i.level===r.level&&this.state===R.PARSING){var a=this.trackId,n=this.tracks[a],s=this.hls;isNaN(e.endPTS)&&(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),k.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),E.default.updateFragPTSDTS(n.details,r.sn,e.startPTS,e.endPTS);var o=this.audioSwitch,l=this.media,u=!1;if(o&&l)if(l.readyState){var d=l.currentTime;k.logger.log("switching audio track : currentTime:"+d),d>=e.startPTS&&(k.logger.log("switching audio track : flushing all audio"),this.state=R.BUFFER_FLUSHING,s.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,s.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:a}))}else this.audioSwitch=!1,s.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:a});var f=this.pendingData;this.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&t.length&&f.push({type:e.type,data:t,parent:"audio",content:"data"})}),!u&&f.length&&(f.forEach(function(e){t.state===R.PARSING&&(t.pendingBuffering=!0,t.hls.trigger(v.default.BUFFER_APPENDING,e))}),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING&&(this.stats.tparsed=performance.now(),this.state=R.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==R.PARSING&&t!==R.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==R.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=performance.now(),r.trigger(v.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("audio buffered : "+T.default.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=R.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!e.fatal){var r=this.fragLoadError;r?r++:r=1;var i=this.config;if(r<=i.fragLoadingMaxRetry){this.fragLoadError=r,t.loadCounter=0;var a=Math.min(Math.pow(2,r-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);k.logger.warn("audioStreamController: frag loading failed, retry in "+a+" ms"),this.retryDate=performance.now()+a,this.state=R.FRAG_LOADING_WAITING_RETRY}else k.logger.error("audioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=R.ERROR}break;case _.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case _.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case _.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==R.ERROR&&(this.state=e.fatal?R.ERROR:R.IDLE,k.logger.warn("audioStreamController: "+e.details+" while loading frag,switch to "+this.state+" state ..."));break;case _.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===R.PARSING||this.state===R.PARSED)){var n=this.mediaBuffer,s=this.media.currentTime;if(n&&f.default.isBuffered(n,s)&&f.default.isBuffered(n,s+.5)){var o=this.config;o.maxMaxBufferLength>=o.maxBufferLength&&(o.maxMaxBufferLength/=2,k.logger.warn("audio:reduce max buffer length to "+o.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*o.fragLoadingLoopThreshold),this.state=R.IDLE}else k.logger.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=R.BUFFER_FLUSHING,this.hls.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(k.logger.log("appending pending audio data on Buffer Flushed"),t.forEach(function(t){e.hls.trigger(v.default.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=R.PARSED):(this.state=R.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,k.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(y.default);r.default=A},{24:24,30:30,31:31,32:32,34:34,35:35,45:45,50:50,51:51}],7:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){this.updateTrack(this.trackId)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(e){var t=this,r=e.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:r});var a=0;r.forEach(function(e){if(e.default)return t.audioTrack=a,void(i=!0);a++}),i===!1&&r.length&&(c.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id=0&&e=0&&e.1){var a=i.updating;try{i.abort()}catch(e){a=!0,c.logger.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(c.logger.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+e.start),i.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,r=e.video,i=0;e.altAudio&&(t||r)&&(i=(t?1:0)+(r?1:0),c.logger.log(i+" sourceBuffer(s) expected")),this.sourceBufferNb=i}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){c.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){c.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){c.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){c.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){c.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;c.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce(function(e,r){return r.parent===t?e+1:e},0);this.hls.trigger(u.default.BUFFER_APPENDED,{parent:t,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){c.logger.error("sourceBuffer error:",e),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var i in e)if(!t[i]){var a=e[i],n=a.levelCodec||a.codec,s=a.container+";codecs="+n;c.logger.log("creating sourceBuffer("+s+")");try{var o=t[i]=r.addSourceBuffer(s);o.addEventListener("updateend",this.onsbue),o.addEventListener("error",this.onsbe),this.tracks[i]={codec:n,container:a.container},a.buffer=o}catch(e){c.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:s})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){c.logger.error("sourceBuffer error:",e.event),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var i in t)r&&i!==r||t[i].ended||(t[i].ended=!0,c.logger.log(i+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(!t||"open"!==t.readyState)return void(this._needsEos=!1);for(var r in e){var i=e[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}c.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){c.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,r=this.sourceBuffer,i=this._levelDuration;if(null!==i&&e&&t&&r&&0!==e.readyState&&"open"===t.readyState){for(var a in r)if(r[a].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var n=e.duration;(i>this._msDuration&&i>n||n===1/0||isNaN(n))&&(c.logger.log("Updating mediasource duration to "+i.toFixed(3)),this._msDuration=t.duration=i)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var i in r)t+=r[i].buffered.length}catch(e){c.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(u.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void c.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var i=r.shift();try{var a=i.type,n=t[a];n?n.updating?r.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){c.logger.error("error while trying to append buffer:"+t.message),r.unshift(i);var s={type:h.ErrorTypes.MEDIA_ERROR,parent:i.parent};if(22===t.code)return this.segments=[],s.details=h.ErrorDetails.BUFFER_FULL_ERROR,s.fatal=!1,void e.trigger(u.default.ERROR,s);if(this.appendError?this.appendError++:this.appendError=1,s.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry)return c.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],s.fatal=!0,void e.trigger(u.default.ERROR,s);s.fatal=!1,e.trigger(u.default.ERROR,s)}}}}},{key:"flushBuffer",value:function(e,t,r){var i,a,n,s,o,l,u=this.sourceBuffer;if(Object.keys(u).length){if(c.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter.5)return this.flushBufferCounter++,c.logger.log("flush "+d+" ["+o+","+l+"], of ["+n+","+s+"], pos:"+this.media.currentTime),i.remove(o,l),!1}catch(e){c.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else c.logger.warn("abort flushing too many retries");c.logger.log("buffer flushed")}return!0}}]),t}(f.default);r.default=g},{30:30,31:31,32:32,50:50}],9:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;rthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var t=0,r=void 0,i=void 0,a=this.mediaWidth,n=this.mediaHeight,s=0,o=0;for(r=0;r<=e&&(i=this.levels[r],!this.isLevelRestricted(r))&&(t=r,s=i.width,o=i.height,!(a<=s||n<=o));r++);return t}},{key:"isLevelRestricted",value:function(e){return!(!this.restrictedLevels||this.restrictedLevels.indexOf(e)===-1)}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}},{key:"mediaWidth",get:function(){var e=void 0,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=this.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=this.contentScaleFactor),e}}]),t}(f.default);r.default=c},{31:31,32:32}],10:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&n>l.config.fpsDroppedMonitoringThreshold*s){var d=l.currentLevel;c.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=d)&&(d-=1,l.trigger(u.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,l.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(f.default);r.default=h},{31:31,32:32,50:50}],11:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0})}else o.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:o.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels,r=this.hls;if(e>=0&&e1&&a.loadErrore&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),e!==-1&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return this._manualLevel!==-1?this._manualLevel:this.hls.nextAutoLevel},set:function(e){this.level=e,this._manualLevel===-1&&(this.hls.nextAutoLevel=e)}}]),t}(f.default);r.default=p},{30:30,31:31,32:32,34:34,50:50}],12:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&e===-1&&(k.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=R.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=R.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=R.STOPPED,this.forceStartLoad=!1}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case R.ERROR:break;case R.BUFFER_FLUSHING:this.fragLoadError=0;break;case R.IDLE:if(!this._doTickIdle())return;break;case R.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=R.IDLE);break;case R.FRAG_LOADING_WAITING_RETRY:var t=performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(k.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=R.IDLE);break;case R.ERROR:case R.STOPPED:case R.FRAG_LOADING:case R.PARSING:case R.PARSED:case R.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&!r&&(this.startFragRequested||!t.startFragPrefetch))return!0;var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,n=this.levels[a],s=n.bitrate,o=void 0;o=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,o=Math.min(o,t.maxMaxBufferLength);var l=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,t.maxBufferHole),u=l.len;if(u>=o)return!0;k.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+o.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var d=n.details;if(void 0===d||d.live&&this.levelLastLoaded!==a)return this.state=R.WAITING_LEVEL,!0;var c=this.fragPrevious;if(!d.live&&c&&c.sn===d.endSN){if(Math.min(r.duration,c.start+c.duration)-Math.max(l.end,c.start)<=Math.max(.2,c.duration/2)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(v.default.BUFFER_EOS,h),this.state=R.ENDED,!0}}return this._fetchPayloadOrEos(i,l,d)}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var i=this.fragPrevious,a=this.level,n=r.fragments,s=n.length;if(0===s)return!1;var o=n[0].start,l=n[s-1].start+n[s-1].duration,u=t.end,d=void 0;if(r.initSegment&&!r.initSegment.data)d=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(sf&&(l.currentTime=f)}if(e.PTSKnown&&t>i&&l&&l.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a){var c=a.sn+1;c>=e.startSN&&c<=e.endSN&&(u=n[c-e.startSN],k.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=n[Math.min(s-1,Math.round(s/2))],k.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u}},{key:"_findFragment",value:function(e,t,r,i,a,n,s){var o=this.hls.config,l=void 0,d=void 0,f=o.maxFragLookUpTolerance,c=t?i[t.sn-i[0].sn+1]:void 0,h=function(e){var t=Math.min(f,e.duration);return e.start+e.duration-t<=a?1:e.start-t>a&&e.start?-1:0};if(an-f&&(f=0),d=c&&!h(c)?c:u.default.search(i,h)):d=i[r-1],d){l=d;var g=l.sn-s.startSN,v=t&&l.level===t.level,p=i[g-1],y=i[g+1];if(v&&l.sn===t.sn)if(l.sno.maxBufferHole&&t.dropped&&g?(l=p,k.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),t.loadCounter--):(l=y,k.logger.log("SN just loaded, load next one: "+l.sn)) -}else l=null;else l.dropped&&!v&&(y&&y.backtracked?(k.logger.warn("Already backtracked from fragment "+(g+1)+", will not backtrack to fragment "+g+". Loading fragment "+(g+1)),l=y):(k.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,p?(p.loadCounter&&p.loadCounter--,l=p):l=null))}return l}},{key:"_loadFragmentOrKey",value:function(e,t,r,i,a){var n=this.hls,s=n.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(k.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+i.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var o=s.fragLoadingLoopThreshold;if(e.loadCounter>o&&Math.abs(this.fragLoadIdx-e.loadIdx)t.endPTS?1:0})}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,r=this.media;if(r&&r.readyState&&r.seeking===!1&&(t=r.currentTime,t>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),f.default.isBuffered(r,t)?e=this.getBufferedFrag(t):f.default.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var i=e;if(i!==this.fragPlaying){this.hls.trigger(v.default.FRAG_CHANGED,{frag:i});var a=i.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(v.default.LEVEL_SWITCHED,{level:a}),this.fragPlaying=i}}}},{key:"immediateLevelSwitch",value:function(){if(k.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,r=void 0,i=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,r=this.getBufferedFrag(e.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),e.paused)t=0;else{var a=this.hls.nextLoadLevel,n=this.levels[a],s=this.fragLastKbps;t=s&&this.fragCurrent?this.fragCurrent.duration*n.bitrate/(1e3*s)+1:0}if((i=this.getBufferedFrag(e.currentTime+t))&&(i=this.followingBufferedFrag(i))){var o=this.fragCurrent;o&&o.loader&&o.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.startPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=R.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0,e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;if(k.logger.log("media seeking to "+t.toFixed(3)),this.state===R.FRAG_LOADING){var i=this.mediaBuffer?this.mediaBuffer:e,a=f.default.bufferInfo(i,t,this.config.maxBufferHole),n=this.fragCurrent;if(0===a.len&&n){var s=r.maxFragLookUpTolerance,o=n.start-s,l=n.start+n.duration+s;tl?(n.loader&&(k.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE):k.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===R.ENDED&&(this.state=R.IDLE);e&&(this.lastCurrentTime=t),this.state!==R.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){k.logger.log("media seeked to "+this.media.currentTime.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){k.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){k.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,r=!1,i=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(t.indexOf("mp4a.40.2")!==-1&&(r=!0),t.indexOf("mp4a.40.5")!==-1&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&k.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,i=this.levels[r],a=t.totalduration,n=0;if(k.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),this.levelLastLoaded=r,t.live){var s=i.details;s&&t.fragments.length>0?(E.default.mergeDetails(s,t),n=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(n,s),t.PTSKnown?k.logger.log("live playlist sliding:"+n.toFixed(3)):k.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,k.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,this.hls.trigger(v.default.LEVEL_UPDATED,{details:t,level:r}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var o=t.startTimeOffset;isNaN(o)?t.live?(this.startPosition=this.computeLivePosition(n,t),k.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(o<0&&(k.logger.log("negative start time offset "+o+", count from end of last fragment"),o=n+a+o),k.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===R.WAITING_LEVEL&&(this.state=R.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===R.KEY_LOADING&&(this.state=R.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===R.FRAG_LOADING&&t&&"main"===r.type&&r.level===t.level&&r.sn===t.sn){var i=e.stats,a=this.levels[t.level],n=a.details;if(k.logger.log("Loaded "+t.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t.level),this.bitrateTest=!1,this.stats=i,r.bitrateTest===!0&&this.hls.nextLoadLevel)this.state=R.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=performance.now(),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=R.IDLE,i.tparsed=i.tbuffered=performance.now(),n.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.tick();else{this.state=R.PARSING;var s=n.totalduration,o=t.level,l=t.sn,u=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(k.logger.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=u.indexOf("mp4a.40.5")!==-1?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,k.logger.log("Parsing "+l+" of ["+n.startSN+" ,"+n.endSN+"],level "+o+", cc "+t.cc);var d=this.demuxer;d||(d=this.demuxer=new h.default(this.hls,"main"));var f=this.media,c=f&&f.seeking,g=!c&&(n.PTSKnown||!n.live),p=n.initSegment?n.initSegment.data:[];d.push(e.payload,p,u,a.videoCodec,t,s,g,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING){var i,a,n=e.tracks;if(n.audio&&this.altAudio&&delete n.audio,a=n.audio){var s=this.levels[this.level].audioCodec,o=navigator.userAgent.toLowerCase();s&&this.audioCodecSwap&&(k.logger.log("swapping playlist audio codec"),s=s.indexOf("mp4a.40.5")!==-1?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&o.indexOf("firefox")===-1&&(s="mp4a.40.5"),o.indexOf("android")!==-1&&"audio/mpeg"!==a.container&&(s="mp4a.40.2",k.logger.log("Android: force audio codec to "+s)),a.levelCodec=s,a.id=e.id}a=n.video,a&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=e.id),this.hls.trigger(v.default.BUFFER_CODECS,n);for(i in n){a=n[i],k.logger.log("main track:"+i+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var l=a.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:i,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,i=e.frag;if(r&&"main"===e.id&&i.sn===r.sn&&i.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===R.PARSING){var a=this.levels[this.level],n=r;if(isNaN(e.endPTS)&&(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),k.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(n.dropped=e.dropped,n.dropped){if(!n.backtracked)return n.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=R.IDLE,void this.tick();k.logger.warn("Already backtracked on this fragment, appending with the gap")}else n.backtracked=!1;var s=E.default.updateFragPTSDTS(a.details,n.sn,e.startPTS,e.endPTS,e.startDTS,e.endDTS),o=this.hls;o.trigger(v.default.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:s,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(r){r&&r.length&&t.state===R.PARSING&&(t.appended=!0,t.pendingBuffering=!0,o.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING&&(this.stats.tparsed=performance.now(),this.state=R.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){k.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(k.logger.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=R.IDLE}var a=this.hls;a.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(k.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,i=void 0,a=!1;for(var n in t){var s=t[n];"main"===s.id?(i=n,r=s,"video"===n&&(this.videoBuffer=t[n].buffer)):a=!0}a&&r?(k.logger.log("alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==R.PARSING&&t!==R.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==R.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("main buffered : "+T.default.toString(t.buffered));var r=this._bufferedFrags.filter(function(e){return f.default.isBuffered(t,(e.startPTS+e.endPTS)/2)});r.push(e),this._bufferedFrags=r.sort(function(e,t){return e.startPTS-t.startPTS}),this.fragPrevious=e;var i=this.stats;i.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*i.total/(i.tbuffered-i.tfirst)),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:e,id:"main"}),this.state=R.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=this.media,i=r&&f.default.isBuffered(r,r.currentTime)&&f.default.isBuffered(r,r.currentTime+.5);switch(e.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal){var a=this.fragLoadError;a?a++:a=1;var n=this.config;if(a<=n.fragLoadingMaxRetry||i||t.autoLevel&&t.level){this.fragLoadError=a,t.loadCounter=0;var s=Math.min(Math.pow(2,a-1)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);k.logger.warn("mediaController: frag loading failed, retry in "+s+" ms"),this.retryDate=performance.now()+s,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=R.FRAG_LOADING_WAITING_RETRY}else k.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=R.ERROR}break;case _.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(i?(this._reduceMaxBufferLength(t.duration),this.state=R.IDLE):t.autoLevel&&0!==t.level||(e.fatal=!0,this.state=R.ERROR));break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==R.ERROR&&(e.fatal?(this.state=R.ERROR,k.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):this.state===R.WAITING_LEVEL&&(this.state=R.IDLE));break;case _.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==R.PARSING&&this.state!==R.PARSED||(i?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=R.IDLE):(k.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,k.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&e.readyState){var t=e.currentTime,r=this.mediaBuffer?this.mediaBuffer:e,i=r.buffered;if(!this.loadedmetadata&&i.length){this.loadedmetadata=!0;var a=e.seeking?t:this.startPosition,n=f.default.isBuffered(r,a);t===a&&n||(k.logger.log("target start position:"+a),n||(a=i.start(0),k.logger.log("target start position not buffered, seek to buffered.start(0) "+a)),k.logger.log("adjust currentTime from "+t+" to "+a),e.currentTime=a)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var s=f.default.bufferInfo(e,t,0),o=!(e.paused||e.ended||0===e.buffered.length),l=t!==this.lastCurrentTime,u=this.config;if(l)this.stallReported&&(k.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(o){var d=performance.now(),c=this.hls;if(this.stalled){var h=d-this.stalled,g=s.len,p=this.nudgeRetry||0;if(g<=.5&&h>1e3*u.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,k.logger.warn("playback stalling in low buffer @"+t),c.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}));var y=s.nextStart,m=y-t;if(y&&m0){this.nudgeRetry=++p;var E=p*u.nudgeOffset;k.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+y+" + nudge "+E),e.currentTime=y+E,this.stalled=void 0,c.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:y+E-t})}}else if(g>.5&&h>1e3*u.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,k.logger.warn("playback stalling in high buffer @"+t),c.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g})),this.stalled=void 0,this.nudgeRetry=++p,p"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(y.default);r.default=A},{24:24,30:30,31:31,32:32,34:34,35:35,45:45,50:50,51:51}],13:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r-1&&this.vttFragQueues[this.currentTrackId].length){var e=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.hls.trigger(u.default.FRAG_LOADING,{frag:e})}}},{key:"onSubtitleFragProcessed",value:function(e){e.success&&this.vttFragSNsProcessed[e.frag.trackId].push(e.frag.sn),this.currentlyProcessing=null,this.nextFrag()}},{key:"onError",value:function(e){var t=e.frag;t&&"subtitle"!==t.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())}},{key:"onSubtitleTracksUpdated",value:function(e){var t=this;c.logger.log("subtitle tracks updated"),this.tracks=e.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(e){t.vttFragSNsProcessed[e.id]=[]})}},{key:"onSubtitleTrackSwitch",value:function(e){this.currentTrackId=e.id,this.clearVttFragQueues()}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this.vttFragSNsProcessed[e.id],r=this.vttFragQueues[e.id],i=this.currentlyProcessing?this.currentlyProcessing.sn:-1,a=function(e){return t.indexOf(e.sn)>-1},n=function(e){return r.some(function(t){return t.sn===e.sn})};e.details.fragments.forEach(function(t){a(t)||t.sn===i||n(t)||(t.trackId=e.id,r.push(t))}),this.nextFrag()}}]),t}(f.default);r.default=h},{31:31,32:32,50:50}],14:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r=0&&e0;)e.removeCue(e.cues[0])}function l(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}function u(e,t,r,i){return Math.min(t,i)-Math.max(e,r)}Object.defineProperty(r,"__esModule",{value:!0});var d=function(){function e(e,t){for(var r=0;r=0&&(o[0]=Math.min(o[0],t),o[1]=Math.max(o[1],r),n=!0,l/(r-t)>.5))return}n||a.push([t,r]),this.Cues.newCue(this[e],t,r,i)}},{key:"onInitPtsFound",value:function(e){var t=this;void 0===this.initPTS&&(this.initPTS=e.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(e){t.onFragLoaded(e)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var r=0;r>>8^255&p^99,e[h]=p,t[p]=h;var y=c[h],m=c[y],E=c[m],b=257*c[p]^16843008*p;i[h]=b<<24|b>>>8,a[h]=b<<16|b>>>16,n[h]=b<<8|b>>>24,s[h]=b,b=16843009*E^65537*m^257*y^16843008*h,l[p]=b<<24|b>>>8,u[p]=b<<16|b>>>16,d[p]=b<<8|b>>>24,f[p]=b,h?(h=y^c[c[c[E^y]]],g^=c[c[g]]):h=g=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,i=0;i>8|e>>>24}},{key:"decrypt",value:function(e,t,r){for(var i,a,n=this.keySize+6,s=this.invKeySchedule,o=this.invSBox,l=this.invSubMix,u=l[0],d=l[1],f=l[2],c=l[3],h=this.uint8ArrayToUint32Array_(r),g=h[0],v=h[1],p=h[2],y=h[3],m=new Int32Array(e),E=new Int32Array(m.length),b=void 0,T=void 0,_=void 0,k=void 0,R=void 0,A=void 0,S=void 0,L=void 0,w=void 0,D=void 0,O=void 0,I=void 0,P=this.networkToHostOrderSwap;t>>24]^d[A>>16&255]^f[S>>8&255]^c[255&L]^s[i],T=u[A>>>24]^d[S>>16&255]^f[L>>8&255]^c[255&R]^s[i+1],_=u[S>>>24]^d[L>>16&255]^f[R>>8&255]^c[255&A]^s[i+2],k=u[L>>>24]^d[R>>16&255]^f[A>>8&255]^c[255&S]^s[i+3],R=b,A=T,S=_,L=k,i+=4;b=o[R>>>24]<<24^o[A>>16&255]<<16^o[S>>8&255]<<8^o[255&L]^s[i],T=o[A>>>24]<<24^o[S>>16&255]<<16^o[L>>8&255]<<8^o[255&R]^s[i+1],_=o[S>>>24]<<24^o[L>>16&255]<<16^o[R>>8&255]<<8^o[255&A]^s[i+2],k=o[L>>>24]<<24^o[R>>16&255]<<16^o[A>>8&255]<<8^o[255&S]^s[i+3],i+=3,E[t]=P(b^g),E[t+1]=P(k^v),E[t+2]=P(_^p),E[t+3]=P(T^y),g=w,v=D,p=O,y=I,t+=4}return E.buffer}},{key:"destroy",value:function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0}}]),e}();r.default=n},{}],18:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>>5,(s-=h)>0&&c+h+s<=v);)for(g=m+f*u,p={unit:e.subarray(c+h,c+h+s),pts:g,dts:g},a.samples.push(p),a.len+=s,c+=s+h,f++;c>>6),(o=(60&t[r+2])>>>2)>h.length-1?void e.trigger(Event.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+o}):(u=(1&t[r+2])<<2,u|=(192&t[r+3])>>>6,i.logger.log("manifest codec:"+n+",ADTS data:type:"+s+",sampleingIndex:"+o+"["+h[o]+"Hz],channelConfig:"+u),/firefox/i.test(f)?o>=6?(s=5,d=new Array(4),l=o-3):(s=2,d=new Array(2),l=o):f.indexOf("android")!==-1?(s=2,d=new Array(2),l=o):(s=5,d=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&o>=6?l=o-3:((n&&n.indexOf("mp4a.40.2")!==-1&&o>=6&&1===u||!n&&1===u)&&(s=2,d=new Array(2)),l=o)),d[0]=s<<3,d[0]|=(14&o)>>1,d[1]|=(1&o)<<7,d[1]|=u<<3,5===s&&(d[1]|=(14&l)>>1,d[2]=(1&l)<<7,d[2]|=8,d[3]=0),{config:d,samplerate:h[o],channelCount:u,codec:"mp4a.40."+s,manifestCodec:c})}};t.exports=n},{30:30,50:50}],22:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&null!=t&&null!=t.key&&"AES-128"===t.method){var g=this.decrypter;null==g&&(g=this.decrypter=new d.default(this.observer,this.config));var v,p=this;try{v=performance.now()}catch(e){v=Date.now()}g.decrypt(e,t.key.buffer,t.iv.buffer,function(e){var d;try{d=performance.now()}catch(e){d=Date.now()}p.observer.trigger(o.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:d}}),p.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),i,a,n,s,l,u,f,c,h)})}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),i,a,n,s,l,u,f,c,h)}},{key:"pushDecrypted",value:function(e,t,r,i,a,n,s,u,d,f,h,v){var y=this.demuxer;if(!y||s&&!this.probe(e)){var E=this.observer,T=this.typeSupported,_=this.config,k=[{demux:p.default,remux:m.default},{demux:c.default,remux:m.default},{demux:g.default,remux:b.default}];for(var R in k){var A=k[R],S=A.demux.probe;if(S(e)){var L=this.remuxer=new A.remux(E,_,T,this.vendor);y=new A.demux(E,L,_,T),this.probe=S;break}}if(!y)return void E.trigger(o.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=y}var w=this.remuxer;(s||u)&&(y.resetInitSegment(r,i,a,f),w.resetInitSegment()),s&&(y.resetTimeStamp(),w.resetTimeStamp(v)),"function"==typeof y.setDecryptData&&y.setDecryptData(t),y.append(e,n,d,h)}}]),e}();r.default=T},{18:18,20:20,27:27,29:29,30:30,32:32,42:42,43:43}],23:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=e(22),n=i(a),s=e(32),o=i(s),l=e(50),u=e(1),d=i(u),f=function(e){var t=new d.default;t.trigger=function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a1?r-1:0),a=1;a1?t-1:0),i=1;i1?t-1:0),i=1;ie?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,r,i=8,a=8;for(t=0;t=8){var r=e.bin2str(t.subarray(4,8));return["moof","ftyp","styp"].indexOf(r)>=0}return!1}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"findBox",value:function(t,r){var i,a,n,s,o,l=[];if(!r.length)return null;for(i=0;i1?i+a:t.byteLength,n===r[0]&&(1===r.length?l.push(t.subarray(i+8,s)):(o=e.findBox(t.subarray(i+8,s),r.slice(1)),o.length&&(l=l.concat(o)))),i=s;return l}},{key:"parseInitSegment",value:function(t){var r=[];return e.findBox(t,["moov","trak"]).forEach(function(t){var i=e.findBox(t,["tkhd"])[0];if(i){var a=i[0],n=0===a?12:20,s=i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3];s=s<0?4294967296+s:s;var o=e.findBox(t,["mdia","mdhd"])[0];if(o){a=o[0],n=0===a?12:20;var l=o[n]<<24|o[n+1]<<16|o[n+2]<<8|o[n+3],u=e.findBox(t,["mdia","hdlr"])[0];if(u){var d=e.bin2str(u.subarray(8,12)),f={soun:"audio",vide:"video"}[d];f&&(r[s]={timescale:l,type:f},r[f]={timescale:l,id:s})}}}}),r}},{key:"startDTS",value:function(t,r){var i,a,n;return i=e.findBox(r,["moof","traf"]),a=[].concat.apply([],i.map(function(r){return e.findBox(r,["tfhd"]).map(function(i){var a,n,s;return a=i[4]<<24|i[5]<<16|i[6]<<8|i[7],n=t[a].timescale||9e4,s=e.findBox(r,["tfdt"]).map(function(e){var t,r;return t=e[0],r=e[4]<<24|e[5]<<16|e[6]<<8|e[7],1===t&&(r*=Math.pow(2,32),r+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),r})[0],(s=s||1/0)/n})})),n=Math.min.apply(null,a),isFinite(n)?n:0}}]),e}();r.default=o},{32:32}],28:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=e.length)return void r();if(!(e[t].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,i),!i)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),i=0,a=32;a<=e.length-16;a+=160,i+=16)r.set(e.subarray(a,a+16),i);return r}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var r=0,i=32;i<=e.length-16;i+=160,r+=16)e.set(t.subarray(r,r+16),i);return e}},{key:"decryptAvcSample",value:function(e,t,r,i,a,n){var s=this.discardEPB(a.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,function(o){a.data=l.getAvcDecryptedUnit(s,o),n||l.decryptAvcSamples(e,t,r+1,i)})}},{key:"decryptAvcSamples",value:function(e,t,r,i){for(;;t++,r=0){if(t>=e.length)return void i();for(var a=e[t].units;!(r>=a.length);r++){var n=a[r];if(!(n.length<=48||1!==n.type&&5!==n.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,i,n,s),!s)return}}}}}]),e}();r.default=o},{18:18}],29:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>4>1){if((o=a+5+e[a+4])===a+188)continue}else o=a+4;switch(s){case m:n&&(_&&(l=L(_))&&w(l,!1),_={data:[],size:0}),_&&(_.data.push(e.subarray(o,a+188)),_.size+=a+188-o);break;case E:n&&(k&&(l=L(k))&&(p.isAAC?D(l):O(l)),k={data:[],size:0}),k&&(k.data.push(e.subarray(o,a+188)),k.size+=a+188-o);break;case b:n&&(R&&(l=L(R))&&I(l),R={data:[],size:0}),R&&(R.data.push(e.subarray(o,a+188)),R.size+=a+188-o);break;case 0:n&&(o+=e[o]+1),T=this._pmtId=A(e,o);break;case T:n&&(o+=e[o]+1);var P=S(e,o,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,null!=this.sampleAes);m=P.avc,m>0&&(h.id=m),E=P.audio,E>0&&(p.id=E,p.isAAC=P.isAAC),b=P.id3,b>0&&(y.id=b),f&&!c&&(g.logger.log("reparse from beginning"),f=!1,a=-188),c=this.pmtParsed=!0;break;case 17:case 8191:break;default:f=!0}}else this.observer.trigger(u.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_&&(l=L(_))?(w(l,!0),h.pesData=null):h.pesData=_,k&&(l=L(k))?(p.isAAC?D(l):O(l),p.pesData=null):(k&&k.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=k),R&&(l=L(R))?(I(l),y.pesData=null):y.pesData=R,null==this.sampleAes?this.remuxer.remux(p,h,y,this._txtTrack,t,r,i):this.decryptAndRemux(p,h,y,this._txtTrack,t,r,i)}},{key:"decryptAndRemux",value:function(e,t,r,i,a,n,s){if(e.samples&&e.isAAC){var o=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){o.decryptAndRemuxAvc(e,t,r,i,a,n,s)})}else this.decryptAndRemuxAvc(e,t,r,i,a,n,s)}},{key:"decryptAndRemuxAvc",value:function(e,t,r,i,a,n,s){if(t.samples){var o=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){o.remuxer.remux(e,t,r,i,a,n,s)})}else this.remuxer.remux(e,t,r,i,a,n,s)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,r,i){var a,n,s,o,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=(15&e[t+1])<<8|e[t+2],n=t+3+a-4,s=(15&e[t+10])<<8|e[t+11],t+=12+s;t1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(t=d[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if((i=(t[4]<<8)+t[5])&&i>e.size-6)return null;r=t[7],192&r&&(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2, -s>4294967295&&(s-=8589934592),64&r?(o=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,o>4294967295&&(o-=8589934592),s-o>54e5&&(g.logger.warn(Math.round((s-o)/9e4)+"s delta between PTS and DTS, align them"),s=o)):o=s),a=t[8],l=a+9,e.size-=l,n=new Uint8Array(e.size);for(var c=0,h=d.length;cv){l-=v;continue}t=t.subarray(l),v-=l,l=0}n.set(t,u),u+=v}return i&&(i-=a+3),{data:n,pts:s,dts:o,len:i}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var r=t.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||e.key===!0||t.sps&&(i||this.contiguous)?(e.id=i,r.push(e)):t.dropped++}e.debug.length&&g.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var r,i,a,n=this,s=this._avcTrack,o=this._parseAVCNALu(e.data),l=this.avcSample;e.data=null,o.forEach(function(t){switch(t.type){case 1:i=!0,l.frame=!0;var o=t.data;if(o.length>4){var u=new f.default(o).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:i=!0,l||(l=n.avcSample=n._createAVCSample(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,r=new f.default(n.discardEPB(t.data)),r.readUByte();for(var d=0,c=0,h=!1,g=0;!h&&r.bytesAvailable>1;){d=0;do{g=r.readUByte(),d+=g}while(255===g);c=0;do{g=r.readUByte(),c+=g}while(255===g);if(4===d&&0!==r.bytesAvailable){h=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var v=r.readUByte(),p=r.readUByte(),y=31&v,m=[v,p];for(a=0;a0){if(t.pts>=e[r-1].pts)e.push(t);else for(var i=r-1;i>=0;i--)if(t.pts=0)i={data:e.subarray(c,s-u-1),type:n},f.push(i);else{var h=this._getLastNalUnit();if(h&&(d&&s<=4-d&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-d)),(r=s-u-1)>0)){var g=new Uint8Array(h.data.byteLength+r);g.set(h.data,0),g.set(e.subarray(0,r),h.data.byteLength),h.data=g}}s=0&&u>=0&&(i={data:e.subarray(c,o),type:n,state:u},f.push(i)),0===f.length){var v=this._getLastNalUnit();if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return l.naluState=u,f}},{key:"discardEPB",value:function(e){for(var t,r,i=e.byteLength,a=[],n=1;n1&&(g.logger.log("AAC: align PTS for overlapping frames by "+Math.round((k-p)/90)),p=k)}for(;n+5>>5,(r-=s)>0&&n+s+r<=d);)for(l=p+a*i,f={unit:h.subarray(n+s,n+s+r),pts:l,dts:l},c.samples.push(f),c.len+=r,n+=r+s,a++;n0;)s+=t}},{key:"_onMpegFrame",value:function(e,t,r,i,a,n){var s=1152/r*1e3,o=n+a*s,l=this._audioTrack;l.config=[],l.channelCount=i,l.samplerate=r,l.duration=this._duration,l.samples.push({unit:e,pts:o,dts:o}),l.len+=e.length}},{key:"_onMpegNoise",value:function(e){g.logger.warn("mpeg audio has noise: "+e.length+" bytes")}},{key:"_parseMpeg",value:function(e,t,r,i,a){var n=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3];if(t+2>r)return-1;if(255===e[t]||224==(224&e[t+1])){if(t+24>r)return-1;var o=e[t+1]>>3&3,l=e[t+1]>>1&3,u=e[t+2]>>4&15,d=e[t+2]>>2&3,f=!!(2&e[t+2]);if(1!==o&&0!==u&&15!==u&&3!==d){var c=3===o?3-l:3===l?3:4,h=1e3*n[14*c+u-1],g=3===o?0:2===o?1:2,v=s[3*g+d],p=f?1:0,y=e[t+3]>>6==3?1:2,m=3===l?(3===o?12:6)*h/v+p<<2:(3===o?144:72)*h/v+p|0;return t+m>r?-1:(this._onMpegFrame&&this._onMpegFrame(e.subarray(t,t+m),h,v,y,i,a),m)}}for(var E=t+2;E=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();r.default=p},{21:21,25:25,28:28,30:30,32:32,50:50}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},{}],31:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var r=0;r1?r-1:0),n=1;n=r.start(i)&&t<=r.end(i))return!0;return!1},bufferInfo:function(e,t,r){if(e){var i,a=e.buffered,n=[];for(i=0;id&&(l[u-1].end=e[o].end):l.push(e[o])}else l.push(e[o])}for(o=0,i=0,a=n=t;o=f&&t=0&&oe.endSN)return 0;if(o=t-e.startSN,l=e.fragments,u=l[o],!isNaN(u.startPTS)){var f=Math.abs(u.startPTS-r);isNaN(u.deltaPTS)?u.deltaPTS=f:u.deltaPTS=Math.max(f,u.deltaPTS),r=Math.min(r,u.startPTS),i=Math.max(i,u.endPTS),n=Math.min(n,u.startDTS),s=Math.max(s,u.endDTS)}var c=r-u.start;for(u.start=u.startPTS=r,u.endPTS=i,u.startDTS=n,u.endDTS=s,u.duration=i-r,d=o;d>0;d--)a.updatePTS(l,d,d-1);for(d=o;dt?a.start+a.duration:a.start-n.duration:r>t?(a.duration=s-a.start,a.duration<0&&i.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):(n.duration=a.start-s,n.duration<0&&i.logger.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!"))}};t.exports=a},{50:50}],36:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var i=e.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var n in i)n in r||(r[n]=i[n]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,T.enableLogs)(r.debug),this.config=r,this._autoLevelCapping=-1;var s=this.observer=new k.default;s.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:-1;T.logger.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})}},{key:"stopLoad",value:function(){T.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})}},{key:"swapAudioCodec",value:function(){T.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){T.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){T.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){T.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){T.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){T.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){T.logger.log("set startLevel:"+e);var t=this;e!==-1&&(e=Math.max(e,t.minAutoLevel)),t.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){T.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this,t=e.levels,r=e.config.minAutoBitrate,i=t?t.length:0,a=0;ar)return a}return 0}},{key:"maxAutoLevel",get:function(){var e=this,t=e.levels,r=e.autoLevelCapping;return r===-1&&t&&t.length?t.length-1:r}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){var t=this;t.abrController.nextAutoLevel=Math.max(t.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}]),e}();r.default=A},{1:1,11:11,12:12,2:2,30:30,32:32,38:38,39:39,4:4,40:40,50:50}],37:[function(e,t,r){"use strict";t.exports=e(36).default},{36:36}],38:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&(r=new T,r.method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=u.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var e=this._byteRange=[] -;if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r?r:0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),e}(),k=function(e){function t(e){s(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING,f.default.SUBTITLE_TRACK_LOADING));return r.loaders={},r}return n(t,e),o(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},h.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:"subtitleTrack",id:e.id})}},{key:"load",value:function(e,t){var r=this.loaders[t.type];if(r){var i=r.context;if(i&&i.url===e)return void y.logger.trace("playlist request ongoing");y.logger.warn("abort previous loader for type:"+t.type),r.abort()}var a=this.hls.config,n=void 0,s=void 0,o=void 0,l=void 0;"manifest"===t.type?(n=a.manifestLoadingMaxRetry,s=a.manifestLoadingTimeOut,o=a.manifestLoadingRetryDelay,l=a.manifestLoadingMaxRetryTimeout):(n=a.levelLoadingMaxRetry,s=a.levelLoadingTimeOut,o=a.levelLoadingRetryDelay,l=a.levelLoadingMaxRetryTimeout,y.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),r=this.loaders[t.type]=t.loader=void 0!==a.pLoader?new a.pLoader(a):new a.loader(a),t.url=e,t.responseType="";var u=void 0,d=void 0;u={timeout:s,maxRetry:n,retryDelay:o,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(t,u,d)}},{key:"resolve",value:function(e,t){return u.default.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(e,t){var r=[],i=void 0;for(m.lastIndex=0;null!=(i=m.exec(e));){var a={},n=a.attrs=new p.default(i[1]);a.url=this.resolve(i[2],t);var s=n.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=n.decimalInteger("AVERAGE-BANDWIDTH")||n.decimalInteger("BANDWIDTH"),a.name=n.NAME;var o=n.CODECS;if(o){o=o.split(/[ ,]+/);for(var l=0;l2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,r,i){var a,n,s=0,o=0,l={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},u=new T,d=0,f=null,c=new _;for(b.lastIndex=0;null!==(a=b.exec(e));){var h=a[1];if(h){c.duration=parseFloat(h);var g=(" "+a[2]).slice(1);c.title=g?g:null,c.tagList.push(g?["INF",h,g]:["INF",h])}else if(a[3]){if(!isNaN(c.duration)){var v=s++;c.type=i,c.start=o,c.levelkey=u,c.sn=v,c.level=r,c.cc=d,c.baseurl=t,c.relurl=(" "+a[3]).slice(1),l.fragments.push(c),f=c,o+=c.duration,c=new _}}else if(a[4]){if(c.rawByteRange=(" "+a[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(c.lastByteRangeEndOffset=m)}}else if(a[5])c.rawProgramDateTime=(" "+a[5]).slice(1),c.tagList.push(["PROGRAM-DATE-TIME",c.rawProgramDateTime]);else{for(a=a[0].match(/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)(.*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/),n=1;n=0&&(u.method=S,u.baseuri=t,u.reluri=L,u.key=null,u.iv=w));break;case"START":var D=E,O=new p.default(D),I=O.decimalFloatingPoint("TIME-OFFSET");isNaN(I)||(l.startTimeOffset=I);break;case"MAP":var P=new p.default(E);c.relurl=P.URI,c.rawByteRange=P.BYTERANGE,c.baseurl=t,c.level=r,c.type=i,c.sn="initSegment",l.initSegment=c,c=new _;break;default:y.logger.warn("line parsed but not handled: "+a)}}}return c=f,c&&!c.relurl&&(l.fragments.pop(),o-=c.duration),l.totalduration=o,l.averagetargetduration=o/l.fragments.length,l.endSN=s-1,l}},{key:"loadsuccess",value:function(e,t,r){var i=e.data,a=e.url,n=r.type,s=r.id,o=r.level,l=this.hls;if(this.loaders[n]=void 0,void 0!==a&&0!==a.indexOf("data:")||(a=r.url),t.tload=performance.now(),0===i.indexOf("#EXTM3U"))if(i.indexOf("#EXTINF:")>0){var u="audioTrack"!==n&&"subtitleTrack"!==n,d=isNaN(o)?isNaN(s)?0:s:o,c=this.parseLevelPlaylist(i,a,d,"audioTrack"===n?"audio":"subtitleTrack"===n?"subtitle":"main");c.tload=t.tload,"manifest"===n&&l.trigger(f.default.MANIFEST_LOADED,{levels:[{url:a,details:c}],audioTracks:[],url:a,stats:t}),t.tparsed=performance.now(),c.targetduration?u?l.trigger(f.default.LEVEL_LOADED,{details:c,level:o||0,id:s||0,stats:t}):"audioTrack"===n?l.trigger(f.default.AUDIO_TRACK_LOADED,{details:c,id:s,stats:t}):"subtitleTrack"===n&&l.trigger(f.default.SUBTITLE_TRACK_LOADED,{details:c,id:s,stats:t}):l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(i,a);if(h.length){var v=this.parseMasterPlaylistMedia(i,a,"AUDIO"),p=this.parseMasterPlaylistMedia(i,a,"SUBTITLES");if(v.length){var m=!1;v.forEach(function(e){e.url||(m=!0)}),m===!1&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(y.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main"}))}l.trigger(f.default.MANIFEST_LOADED,{levels:h,audioTracks:v,subtitles:p,url:a,stats:t})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest"})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,response:e,context:t})}},{key:"loadtimeout",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_TIMEOUT,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_TIMEOUT,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,context:t})}}]),t}(h.default);r.default=k},{2:2,30:30,31:31,32:32,44:44,50:50}],41:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=255&i,t.set(e,4),a=0,i=8;a>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))}},{key:"moov",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(i))}},{key:"mvhd",value:function(t,r){r*=t;var i=Math.floor(r/(n+1)),a=Math.floor(r%(n+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,s)}},{key:"sdtp",value:function(t){var r,i,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),s.push(255&a),s=s.concat(Array.prototype.slice.call(i));var o=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(s))),l=t.width,u=t.height,d=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,i=t.duration*t.timescale,a=t.width,s=t.height,o=Math.floor(i/(n+1)),l=Math.floor(i%(n+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,s>>8&255,255&s,0,0]))}},{key:"traf",value:function(t,r){var i=e.sdtp(t),a=t.id,s=Math.floor(r/(n+1)),o=Math.floor(r%(n+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),e.trun(t,i.length+16+20+8+16+8+8),i)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var i,a,n,s,o,l,u=t.samples||[],d=u.length,f=12+16*d,c=new Uint8Array(f);for(r+=8+f,c.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,c)}},{key:"initSegment",value:function(t){e.types||e.init();var r,i=e.moov(t);return r=new Uint8Array(e.FTYP.byteLength+i.byteLength),r.set(e.FTYP),r.set(i,e.FTYP.byteLength),r}}]),e}();r.default=s},{}],42:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r-1&&s&&!s.match("CriOS"),this.ISGenerated=!1}return n(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,r,i,a,n,s){if(this.ISGenerated||this.generateIS(e,t,a),this.ISGenerated)if(e.samples.length){var o=this.remuxAudio(e,a,n,s);if(t.samples.length){var l=void 0;o&&(l=o.endPTS-o.startPTS),this.remuxVideo(t,a,n,l)}}else{var d=void 0;t.samples.length&&(d=this.remuxVideo(t,a,n)),d&&e.codec&&this.remuxEmptyAudio(e,a,n,d)}r.samples.length&&this.remuxID3(r,a),i.samples.length&&this.remuxText(i,a),this.observer.trigger(u.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,r){var i,a,n=this.observer,s=e.samples,o=t.samples,l=this.typeSupported,f="audio/mp4",g={},v={tracks:g},p=void 0===this._initPTS;if(p&&(i=a=1/0),e.config&&s.length&&(e.timescale=e.samplerate,d.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(l.mpeg?(f="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3")),g.audio={container:f,codec:e.codec,initSegment:!e.isAAC&&l.mpeg?new Uint8Array:c.default.initSegment([e]),metadata:{channelCount:e.channelCount}},p&&(i=a=s[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&o.length){var y=t.inputTimeScale;t.timescale=y,g.video={container:"video/mp4",codec:t.codec,initSegment:c.default.initSegment([t]),metadata:{width:t.width,height:t.height}},p&&(i=Math.min(i,o[0].pts-y*r),a=Math.min(a,o[0].dts-y*r),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:i}))}Object.keys(g).length?(n.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,v),this.ISGenerated=!0,p&&(this._initPTS=i,this._initDTS=a)):n.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,i){var a,n,s,o,l,f,g,v=8,p=e.timescale,y=e.samples,m=[],E=y.length,b=this._PTSNormalize,T=this._initDTS;y.sort(function(e,t){var r=e.dts-t.dts,i=e.pts-t.pts;return r?r:i?i:e.id-t.id});var _=y.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(_<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(_/90)+" ms to overcome this issue");for(var k=0;k1?d.logger.log("AVC:"+S+" ms hole between fragments detected,filling it"):S<-1&&d.logger.log("AVC:"+-S+" ms overlapping between fragments detected"),l=R,y[0].dts=l+T,o=Math.max(o-S,R),y[0].pts=o+T,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(o/90)+"/"+Math.round(l/90)+",delta:"+S+" ms")),A=y[y.length-1],g=Math.max(b(A.dts-T,R),0),f=Math.max(b(A.pts-T,R),0),f=Math.max(f,g);var L=this.isSafari;L&&(a=Math.round((g-l)/(y.length-1)));for(var w=0,D=0,O=0;O0?U-1:U].dts;if(q.stretchShortVideoTrack){var Q=q.maxBufferHole,J=q.maxSeekHole,Z=Math.floor(Math.min(Q,J)*p),$=(i?o+i*p:this.nextAudioPts)-B.pts;$>Z?(a=$-z,a<0&&(a=z),d.logger.log("It is approximately "+$/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=z}else a=z}K=Math.round(B.pts-B.dts)}m.push({size:j,duration:a,cts:K,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:B.key?2:1,isNonSync:B.key?0:1}})}this.nextAvcDts=g+a;var ee=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,m.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var te=m[0].flags;te.dependsOn=2,te.isNonSync=0}e.samples=m,s=c.default.moof(e.sequenceNumber++,l,e),e.samples=[];var re={data1:s,data2:n,startPTS:o/p,endPTS:(f+a)/p,startDTS:l/p,endDTS:this.nextAvcDts/p,type:"video",nb:m.length,dropped:ee};return this.observer.trigger(u.default.FRAG_PARSING_DATA,re),re}},{key:"remuxAudio",value:function(e,t,r,i){var a,n,s,l,f,g,v,p,y,m,E,b,T,_,k,R,A=e.inputTimeScale,S=e.timescale,L=A/S,w=e.isAAC?1024:1152,D=w*L,O=this._PTSNormalize,I=this._initDTS,P=!e.isAAC&&this.typeSupported.mpeg,C=P?0:8,x=[],F=[];if(e.samples.sort(function(e,t){return e.pts-t.pts}),F=e.samples,R=this.nextAudioPts,r|=F.length&&R&&(Math.abs(t-R/A)<.1||Math.abs(F[0].pts-R-I)<20*D),r||(R=t*A),i&&e.isAAC)for(var M=0,N=R;M=D&&N){var j=Math.round(G/D);d.logger.warn("Injecting "+j+" audio frame @ "+(N/A).toFixed(3)+"s due to "+1e3*G/A+" ms gap.");for(var K=0;K0)Y=Math.round((b-R)/D),d.logger.log(V+" ms hole between AAC samples detected,filling it"),Y>0&&(_=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),_||(_=l.subarray()),e.len+=Y*_.length);else if(V<-12){d.logger.log(-V+" ms overlapping between AAC samples detected, drop frame"),e.len-=l.byteLength;continue}b=T=R}if(v=Math.max(0,b),p=Math.max(0,T),!(e.len>0))return;var X=P?e.len:e.len+8;try{f=new Uint8Array(X)}catch(e){return void this.observer.trigger(u.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:X,reason:"fail allocating audio mdat "+X})}P||(a=new DataView(f.buffer),a.setUint32(0,X),f.set(c.default.types.mdat,4));for(var q=0;q=2&&(Q=x[J-2].duration,s.duration=Q),J){this.nextAudioPts=b+L*Q,e.len=0,e.samples=x,g=P?new Uint8Array:c.default.moof(e.sequenceNumber++,p/L,e),e.samples=[];var Z={data1:g,data2:f,startPTS:v/A,endPTS:this.nextAudioPts/A,startDTS:p/A,endDTS:(T+L*Q)/A,type:"audio",nb:J};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Z),Z}return null}},{key:"remuxEmptyAudio",value:function(e,t,r,i){var a=e.inputTimeScale,n=e.samplerate?e.samplerate:a,s=a/n,l=this.nextAudioPts,u=(void 0!==l?l:i.startDTS*a)+this._initDTS,f=i.endDTS*a+this._initDTS,c=1024*s,h=Math.ceil((f-u)/c),g=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(d.logger.warn("remux empty Audio"),!g)return void d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var v=[],p=0;p4294967296;)e+=r;return e}}]),e}();r.default=g},{30:30,32:32,33:33,41:41,50:50}],43:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,r={};for(s.lastIndex=0;null!==(t=s.exec(e));){var i=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}return r}}]),e}();r.default=o},{}],45:[function(e,t,r){"use strict";var i={search:function(e,t){for(var r=0,i=e.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=e[a];var s=t(n);if(s>0)r=a+1;else{if(!(s<0))return n;i=a-1}}return null}};t.exports=i},{}],46:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rl&&(g.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=s(e);if(this.pos>=l)return void g.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(e){var t;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),b=function(){function e(t,r){i(this,e),this.chNr=t,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new E,this.nonDisplayedMemory=new E,this.lastOutputScreen=new E,this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return a(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,g.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}g.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=g.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),T=function(){function e(t,r,a){i(this,e),this.field=t||1,this.outputs=[r,a],this.channels=[new b(1,r),new b(2,a)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return a(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var r,i,a,n=!1;this.lastTime=e,g.setTime(e);for(var s=0;s ("+v([i,a])+")"),r=this.parseCmd(i,a),r||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(n=this.parseChars(i,a)))if(this.currChNr&&this.currChNr>=0){var o=this.channels[this.currChNr-1];o.insertChars(n)}else g.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:n?this.dataCounters.char+=2:(this.dataCounters.other+=2,g.log("WARNING","Couldn't parse cleaned data "+v([i,a])+" orig: "+v([t[s],t[s+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var r=null,i=(20===e||28===e)&&32<=t&&t<=47,a=(23===e||31===e)&&33<=t&&t<=35;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,g.log("DEBUG","Repeated command ("+v([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var n=this.channels[r-1];return 20===e||28===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"parseMidrow",value:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return g.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(t),g.log("DEBUG","MIDROW ("+v([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var r=null,i=null,a=(17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127,n=(16===e||24===e)&&64<=t&&t<=95;if(!a&&!n)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,i=64<=t&&t<=95?1===r?u[e]:f[e]:1===r?d[e]:c[e];var s=this.interpretPAC(i,t);return this.channels[r-1].setPAC(s),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"interpretPAC",value:function(e,t){var r=t,i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i}},{key:"parseChars",value:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var n=t;n=17===a?t+80:18===a?t+112:t+144,g.log("INFO","Special char '"+s(n)+"' in channel "+r),i=[n]}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t]);if(i){var o=v(i);g.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i}},{key:"parseBackgroundAttributes",value:function(e,t){var r,i,a,n,s=(16===e||24===e)&&32<=t&&t<=47,o=(23===e||31===e)&&45<=t&&t<=47;return!(!s&&!o)&&(r={},16===e||24===e?(i=Math.floor((t-32)/2),r.background=h[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),a=e<24?1:2,n=this.channels[a-1],n.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e=16?l--:l++,navigator.userAgent.match(/Firefox\//)?s.line=f+1:s.line=f>7?f-2:f+1,s.align="left",s.position=Math.max(0,Math.min(100,l/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(s)}}};t.exports=a},{53:53}],48:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();r.default=o},{49:49}],49:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r "+t}function n(e){var t=self.console[e];return t?function(){for(var r=arguments.length,i=Array(r),n=0;n1?t-1:0),i=1;i100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},u,{get:function(){return T},set:function(e){var r=t(e);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");T=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},u,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},u,{get:function(){return k},set:function(e){var r=t(e);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");k=r,this.hasBeenReset=!0}})),o.displayState=void 0,l)return o}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var a="auto",n={"":!0,lr:!0,rl:!0},s={start:!0,middle:!0,end:!0,left:!0,right:!0};return i.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},i}()},{}],53:[function(e,t,r){"use strict";function i(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new f,this.regionList=[]}function a(e){function t(e,t,r,i){return 3600*(0|e)+60*(0|t)+(0|r)+(0|i)/1e3}var r=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?t(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?t(r[1],r[2],0,r[4]):t(0,r[1],r[2],r[4]):null}function n(){this.values=Object.create(null)}function s(e,t,r,i){var a=i?e.split(i):[e];for(var n in a)if("string"==typeof a[n]){var s=a[n].split(r);if(2===s.length){var o=s[0],l=s[1];t(o,l)}}}function o(e,t,r){function i(){var t=a(e);if(null===t)throw new Error("Malformed timestamp: "+l);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function o(){e=e.replace(/^\s+/,"")}var l=e;if(o(),t.startTime=i(),o(),"-->"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);e=e.substr(3),o(),t.endTime=i(),o(),function(e,t){var i=new n;s(e,function(e,t){switch(e){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===t){i.set(e,r[a].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var n=t.split(","),s=n[0];i.integer(e,s),i.percent(e,s)&&i.set("snapToLines",!1),i.alt(e,s,["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",h,"end"]);break;case"position":n=t.split(","),i.percent(e,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",h,"end","left","right"])}},/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");var a=i.get("line","auto");"auto"===a&&c.line===-1&&(a=-1),t.line=a,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",h);var o=i.get("position","auto");"auto"===o&&50===c.position&&(o="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=o}(e,t)}function l(e){return e.replace(//gi,"\n")}Object.defineProperty(r,"__esModule",{value:!0}),r.fixLineBreaks=void 0;var u=e(52),d=function(e){return e&&e.__esModule?e:{default:e}}(u),f=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};n.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,r){for(var i=0;i=0&&t<=100)&&(this.set(e,t),!0)}};var c=new d.default(0,0,0),h="middle"===c.align?"middle":"center";i.prototype={parse:function(e){function t(){var e=r.buffer,t=0;for(e=l(e);t")===-1){r.cue.id=i;continue}case"CUE":try{o(i,r.cue,r.regionList)}catch(e){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var u=i.indexOf("-->")!==-1;if(!i||u&&(n=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+="\n"),r.cue.text+=i;continue;case"BADCUE":i||(r.state="ID");continue}}}catch(e){"CUETEXT"===r.state&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state="INITIAL"===r.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new Error("Malformed WebVTT signature.")}catch(e){throw e}return e.onflush&&e.onflush(),this}},r.fixLineBreaks=l,r.default=i},{52:52}],54:[function(e,t,r){"use strict";var i=e(53),a=function(e){return e&&e.__esModule?e:{default:e}}(i),n=function(e){var t=parseInt(e.substr(-3)),r=parseInt(e.substr(-6,2)),i=parseInt(e.substr(-9,2)),a=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;return isNaN(t)||isNaN(r)||isNaN(i)||isNaN(a)?-1:(t+=1e3*r,t+=6e4*i,t+=36e5*a)},s=function(e,t,r){var i=e[t],a=e[i.prevCC];if(!a||!a.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);for(;a&&a.new;)e.ccOffset+=i.start-a.start,i.new=!1,i=a,a=e[i.prevCC];e.presentationOffset=r},o={parse:function(e,t,r,i,o,l){var u=String.fromCharCode.apply(null,new Uint8Array(e)).trim().replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n"),d="00:00.000",f=0,c=0,h=0,g=[],v=void 0,p=!0,y=new a.default;y.oncue=function(e){var t=r[i],a=r.ccOffset;t&&t.new&&(c?a=r.ccOffset=t.start:s(r,i,h)),h&&!c&&(a=h+r.ccOffset-r.presentationOffset),e.startTime+=a-c,e.endTime+=a-c,e.text=decodeURIComponent(escape(e.text)),e.endTime>0&&g.push(e)},y.onparsingerror=function(e){v=e},y.onflush=function(){if(v&&l)return void l(v);o(g)},u.forEach(function(e){if(p){if(e.startsWith("X-TIMESTAMP-MAP=")){p=!1,e.substr(16).split(",").forEach(function(e){e.startsWith("LOCAL:")?d=e.substr(6):e.startsWith("MPEGTS:")&&(f=parseInt(e.substr(7)))});try{t=t<0?t+8589934592:t,f-=t,c=n(d)/1e3,h=f/9e4,c===-1&&(v=new Error("Malformed X-TIMESTAMP-MAP: "+e))}catch(t){v=new Error("Malformed X-TIMESTAMP-MAP: "+e)}return}""===e&&(p=!1)}y.parse(e+"\n")}),y.flush()}};t.exports=o},{53:53}],55:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){var o=t.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,performance.now());var l=void 0,u=void 0;"arraybuffer"===a.responseType?(l=t.response,u=l.byteLength):(l=t.responseText,u=l.length),i.loaded=i.total=u;var d={url:t.responseURL,data:l};this.callbacks.onSuccess(d,i,a)}else i.retry>=s.maxRetry||o>=400&&o<499?(n.logger.error(o+" while loading "+a.url),this.callbacks.onError({code:o,text:t.statusText},a)):(n.logger.warn(o+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),i.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout)}},{key:"loadtimeout",value:function(){n.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context)}},{key:"loadprogress",value:function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);var r=this.callbacks.onProgress;r&&r(t,this.context,null)}}]),e}();r.default=s},{50:50}]},{},[37])(37)}); +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Hls=e()}}(function(){var e;return function e(t,r,i){function a(s,o){if(!r[s]){if(!t[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(n)return n(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var d=r[s]={exports:{}};t[s][0].call(d.exports,function(e){var r=t[s][1][e];return a(r?r:e)},d,d.exports,e,t,r,i)}return r[s].exports}for(var n="function"==typeof require&&require,s=0;s0&&this._events[e].length>r&&(this._events[e].warned=!0,console.trace),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],n=r.length,i=-1,r===t||a(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(o=n;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],a(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(t,r,i){!function(t){var a=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/;?#]*)(.*)$/,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return i.path=s.normalizePath(i.path),s.buildURLFromParts(i)}var a=this.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=n.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var d=o.path,f=d.substring(0,d.lastIndexOf("/")+1)+a.path;u.path=s.normalizePath(f)}else u.path=o.path,a.params||(u.params=o.params,a.query||(u.query=o.query));return null===u.path&&(u.path=r.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(u)},parseURL:function(e){var t=a.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(/(?:\/|^)\.(?=\/)/g,"");e.length!==(e=e.replace(/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};"object"==typeof i&&"object"==typeof r?r.exports=s:"function"==typeof e&&e.amd?e([],function(){return s}):"object"==typeof i?i.URLToolkit=s:t.URLToolkit=s}(this)},{}],3:[function(e,t,r){var i=arguments[3],a=arguments[4],n=arguments[5],s=JSON.stringify;t.exports=function(e,t){function r(e){p[e]=!0;for(var t in a[e][1]){var i=a[e][1][t];p[i]||r(i)}}for(var o,l=Object.keys(n),u=0,d=l.length;u500*r.duration/o){var l=e.levels,d=Math.max(1,n.bw?n.bw/8:1e3*n.loaded/s),f=l[r.level],c=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,g=n.total?n.total:Math.max(n.loaded,Math.round(r.duration*c/8)),p=t.currentTime,y=(g-n.loaded)/d,m=(h.default.bufferInfo(t,p,e.config.maxBufferHole).end-p)/o;if(m<2*r.duration/o&&y>m){var E=void 0,b=void 0;for(b=r.level-1;b>a;b--){var T=l[b].realBitrate?Math.max(l[b].realBitrate,l[b].bitrate):l[b].bitrate;if((E=r.duration*T/(6.4*d))=i;u--){var d=l[u],f=d.details,c=f?f.totalduration/f.fragments.length:t,h=!!f&&f.live,g=void 0;g=u<=e?s*r:o*r;var p=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,y=p*c/g;if(v.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(g)+"/"+p+"/"+c+"/"+n+"/"+y),g>p&&(!y||h||y=0)return c;v.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,y=i.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){g=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-m,v.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),p=y=1}}return c=this._findBestLevel(s,o,d,a,t,f+g,p,y,r),Math.max(c,0)}}]),t}(f.default);r.default=m},{31:31,32:32,33:33,35:35,49:49,51:51}],6:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&e===-1?(k.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=R.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=R.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=R.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=R.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var e,t,r,i=this.hls,a=i.config;switch(this.state){case R.ERROR:case R.PAUSED:case R.BUFFER_FLUSHING:break;case R.STARTING:this.state=R.WAITING_TRACK,this.loadedmetadata=!1;break;case R.IDLE:var n=this.tracks;if(!n)break;if(!this.media&&(this.startFragRequested||!a.startFragPrefetch))break;e=this.loadedmetadata?this.media.currentTime:this.nextLoadPosition;var s=this.mediaBuffer?this.mediaBuffer:this.media,o=f.default.bufferInfo(s,e,a.maxBufferHole),l=o.len,d=o.end,c=this.fragPrevious,h=a.maxMaxBufferLength,g=this.audioSwitch,p=this.trackId;if((lE||o.nextStart))return;k.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=E+.05}if(r.initSegment&&!r.initSegment.data)T=r.initSegment;else if(d<=E){if(T=y[0],r.live&&T.loadIdx&&T.loadIdx===this.fragLoadIdx){var A=o.nextStart?o.nextStart:E;return k.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(A+.05)),void(this.media.currentTime=A+.05)}}else{var S=void 0,L=a.maxFragLookUpTolerance,w=c?y[c.sn-y[0].sn+1]:void 0,D=function(e){var t=Math.min(L,e.duration);return e.start+e.duration-t<=d?1:e.start-t>d&&e.start?-1:0};db-L&&(L=0),S=w&&!D(w)?w:u.default.search(y,D)):S=y[m-1],S&&(T=S,E=S.start,c&&T.level===c.level&&T.sn===c.sn&&(T.snO&&Math.abs(this.fragLoadIdx-T.loadIdx)=P||C)&&(k.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=R.IDLE);break;case R.WAITING_INIT_PTS:case R.STOPPED:case R.FRAG_LOADING:case R.PARSING:case R.PARSED:case R.ENDED:}}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===R.ENDED&&(this.state=R.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(e){k.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.state=R.IDLE,this.fragCurrent=null,this.state=R.PAUSED,this.waitingFragment=null,t?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=R.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,r=e.id,i=this.tracks[r],a=t.totalduration,n=0;if(k.logger.log("track "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var s=i.details;s&&t.fragments.length>0?(E.default.mergeDetails(s,t),n=t.fragments[0].start,t.PTSKnown?k.logger.log("live audio playlist sliding:"+n.toFixed(3)):k.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,k.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,!this.startFragRequested){if(this.startPosition===-1){var o=t.startTimeOffset;isNaN(o)?this.startPosition=0:(k.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o)}this.nextLoadPosition=this.startPosition}this.state===R.WAITING_TRACK&&(this.state=R.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===R.KEY_LOADING&&(this.state=R.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===R.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var i=this.tracks[this.trackId],a=i.details,n=a.totalduration,s=t.level,o=t.sn,l=t.cc,u=this.config.defaultAudioCodec||i.audioCodec||"mp4a.40.2",d=this.stats=e.stats;if("initSegment"===o)this.state=R.IDLE,d.tparsed=d.tbuffered=performance.now(),a.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:d,frag:t,id:"audio"}),this.tick();else{this.state=R.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new h.default(this.hls,"audio"));var f=this.initPTS[l],c=a.initSegment?a.initSegment.data:[];if(a.initSegment||void 0!==f){this.pendingBuffering=!0,k.logger.log("Demuxing "+o+" of ["+a.startSN+" ,"+a.endSN+"],track "+s);this.demuxer.push(e.payload,c,u,null,t,n,!1,f)}else k.logger.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+o+" of ["+a.startSN+" ,"+a.endSN+"],track "+s),this.waitingFragment=e,this.state=R.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING){var i=e.tracks,a=void 0;if(i.video&&delete i.video,a=i.audio){a.levelCodec="mp4a.40.2",a.id=e.id,this.hls.trigger(v.default.BUFFER_CODECS,i),k.logger.log("audio track:audio,container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var n=a.initSegment;if(n){var s={type:"audio",data:n,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[s]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,s))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,i=e.frag;if(r&&"audio"===e.id&&"audio"===e.type&&i.sn===r.sn&&i.level===r.level&&this.state===R.PARSING){var a=this.trackId,n=this.tracks[a],s=this.hls;isNaN(e.endPTS)&&(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),k.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),E.default.updateFragPTSDTS(n.details,r,e.startPTS,e.endPTS);var o=this.audioSwitch,l=this.media,u=!1;if(o&&l)if(l.readyState){var d=l.currentTime;k.logger.log("switching audio track : currentTime:"+d),d>=e.startPTS&&(k.logger.log("switching audio track : flushing all audio"),this.state=R.BUFFER_FLUSHING,s.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,s.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:a}))}else this.audioSwitch=!1,s.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:a});var f=this.pendingData;this.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&t.length&&f.push({type:e.type,data:t,parent:"audio",content:"data"})}),!u&&f.length&&(f.forEach(function(e){t.state===R.PARSING&&(t.pendingBuffering=!0,t.hls.trigger(v.default.BUFFER_APPENDING,e))}),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING&&(this.stats.tparsed=performance.now(),this.state=R.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==R.PARSING&&t!==R.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==R.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=performance.now(),r.trigger(v.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("audio buffered : "+T.default.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=R.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!e.fatal){var r=this.fragLoadError;r?r++:r=1;var i=this.config;if(r<=i.fragLoadingMaxRetry){this.fragLoadError=r,t.loadCounter=0;var a=Math.min(Math.pow(2,r-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);k.logger.warn("audioStreamController: frag loading failed, retry in "+a+" ms"),this.retryDate=performance.now()+a,this.state=R.FRAG_LOADING_WAITING_RETRY}else k.logger.error("audioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=R.ERROR}break;case _.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case _.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case _.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==R.ERROR&&(this.state=e.fatal?R.ERROR:R.IDLE,k.logger.warn("audioStreamController: "+e.details+" while loading frag,switch to "+this.state+" state ..."));break;case _.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===R.PARSING||this.state===R.PARSED)){var n=this.mediaBuffer,s=this.media.currentTime;if(n&&f.default.isBuffered(n,s)&&f.default.isBuffered(n,s+.5)){var o=this.config;o.maxMaxBufferLength>=o.maxBufferLength&&(o.maxMaxBufferLength/=2,k.logger.warn("audio:reduce max buffer length to "+o.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*o.fragLoadingLoopThreshold),this.state=R.IDLE}else k.logger.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=R.BUFFER_FLUSHING,this.hls.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(k.logger.log("appending pending audio data on Buffer Flushed"),t.forEach(function(t){e.hls.trigger(v.default.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=R.PARSED):(this.state=R.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,k.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(y.default);r.default=A},{25:25,31:31,32:32,33:33,35:35,36:36,46:46,51:51,52:52}],7:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){this.updateTrack(this.trackId)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(e){var t=this,r=e.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:r});var a=0;r.forEach(function(e){if(e.default)return t.audioTrack=a,void(i=!0);a++}),i===!1&&r.length&&(c.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id=0&&e=0&&e.1){var a=i.updating;try{i.abort()}catch(e){a=!0,c.logger.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(c.logger.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+e.start),i.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,r=e.video,i=0;e.altAudio&&(t||r)&&(i=(t?1:0)+(r?1:0),c.logger.log(i+" sourceBuffer(s) expected")),this.sourceBufferNb=i}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){c.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){c.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){c.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){c.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){c.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;c.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce(function(e,r){return r.parent===t?e+1:e},0);this.hls.trigger(u.default.BUFFER_APPENDED,{parent:t,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){c.logger.error("sourceBuffer error:",e),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var i in e)if(!t[i]){var a=e[i],n=a.levelCodec||a.codec,s=a.container+";codecs="+n;c.logger.log("creating sourceBuffer("+s+")");try{var o=t[i]=r.addSourceBuffer(s);o.addEventListener("updateend",this.onsbue),o.addEventListener("error",this.onsbe),this.tracks[i]={codec:n,container:a.container},a.buffer=o}catch(e){c.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:s})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){c.logger.error("sourceBuffer error:",e.event),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var i in t)r&&i!==r||t[i].ended||(t[i].ended=!0,c.logger.log(i+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(!t||"open"!==t.readyState)return void(this._needsEos=!1);for(var r in e){var i=e[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}c.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){c.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,r=this.sourceBuffer,i=this._levelDuration;if(null!==i&&e&&t&&r&&0!==e.readyState&&"open"===t.readyState){for(var a in r)if(r[a].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var n=e.duration;(i>this._msDuration&&i>n||n===1/0||isNaN(n))&&(c.logger.log("Updating mediasource duration to "+i.toFixed(3)),this._msDuration=t.duration=i)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var i in r)t+=r[i].buffered.length}catch(e){c.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(u.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void c.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var i=r.shift();try{var a=i.type,n=t[a];n?n.updating?r.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){c.logger.error("error while trying to append buffer:"+t.message),r.unshift(i);var s={type:h.ErrorTypes.MEDIA_ERROR,parent:i.parent};if(22===t.code)return this.segments=[],s.details=h.ErrorDetails.BUFFER_FULL_ERROR,s.fatal=!1,void e.trigger(u.default.ERROR,s);if(this.appendError?this.appendError++:this.appendError=1,s.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry)return c.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],s.fatal=!0,void e.trigger(u.default.ERROR,s);s.fatal=!1,e.trigger(u.default.ERROR,s)}}}}},{key:"flushBuffer",value:function(e,t,r){var i,a,n,s,o,l,u=this.sourceBuffer;if(Object.keys(u).length){if(c.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter.5)return this.flushBufferCounter++,c.logger.log("flush "+d+" ["+o+","+l+"], of ["+n+","+s+"], pos:"+this.media.currentTime),i.remove(o,l),!1}catch(e){c.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else c.logger.warn("abort flushing too many retries");c.logger.log("buffer flushed")}return!0}}]),t}(f.default);r.default=g},{31:31,32:32,33:33,51:51}],9:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;rthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var t=0,r=void 0,i=void 0,a=this.mediaWidth,n=this.mediaHeight,s=0,o=0;for(r=0;r<=e&&(i=this.levels[r],!this.isLevelRestricted(r))&&(t=r,s=i.width,o=i.height,!(a<=s||n<=o));r++);return t}},{key:"isLevelRestricted",value:function(e){return!(!this.restrictedLevels||this.restrictedLevels.indexOf(e)===-1)}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}},{key:"mediaWidth",get:function(){var e=void 0,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=this.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=this.contentScaleFactor),e}}]),t}(f.default);r.default=c},{32:32,33:33}],10:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&n>l.config.fpsDroppedMonitoringThreshold*s){var d=l.currentLevel;c.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=d)&&(d-=1,l.trigger(u.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,l.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(f.default);r.default=h},{32:32,33:33,51:51}],11:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r>4){case 0:return i;case 1:case 2:case 3:case 4:case 5:case 6:case 7:i+=String.fromCharCode(s);break;case 12:case 13:t=e[a++],i+=String.fromCharCode((31&s)<<6|63&t);break;case 14:t=e[a++],r=e[a++],i+=String.fromCharCode((15&s)<<12|(63&t)<<6|(63&r)<<0)}}return i}}]),t}(f.default);r.default=c},{32:32,33:33}],12:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0})}else o.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:o.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels,r=this.hls;if(e>=0&&e1&&a.loadErrore&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),e!==-1&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return this._manualLevel!==-1?this._manualLevel:this.hls.nextAutoLevel},set:function(e){this.level=e,this._manualLevel===-1&&(this.hls.nextAutoLevel=e)}}]),t}(f.default);r.default=p},{31:31,32:32,33:33,35:35,51:51}],13:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&e===-1&&(k.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=R.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=R.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=R.STOPPED,this.forceStartLoad=!1}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case R.ERROR:break;case R.BUFFER_FLUSHING:this.fragLoadError=0;break;case R.IDLE:this._doTickIdle();break;case R.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=R.IDLE);break;case R.FRAG_LOADING_WAITING_RETRY:var t=performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(k.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=R.IDLE);break;case R.ERROR:case R.STOPPED:case R.FRAG_LOADING:case R.PARSING:case R.PARSED:case R.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){ +var e=this.hls,t=e.config,r=this.media;if(void 0===this.levelLastLoaded||r||!this.startFragRequested&&t.startFragPrefetch){var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,n=this.levels[a],s=n.bitrate,o=void 0;o=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,o=Math.min(o,t.maxMaxBufferLength);var l=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,t.maxBufferHole),u=l.len;if(!(u>=o)){k.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+o.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var d=n.details;if(void 0===d||d.live&&this.levelLastLoaded!==a)return void(this.state=R.WAITING_LEVEL);var c=this.fragPrevious;if(!d.live&&c&&c.sn===d.endSN){if(Math.min(r.duration,c.start+c.duration)-Math.max(l.end,c.start)<=Math.max(.2,c.duration/2)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(v.default.BUFFER_EOS,h),void(this.state=R.ENDED)}}this._fetchPayloadOrEos(i,l,d)}}}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var i=this.fragPrevious,a=this.level,n=r.fragments,s=n.length;if(0!==s){var o=n[0].start,l=n[s-1].start+n[s-1].duration,u=t.end,d=void 0;if(r.initSegment&&!r.initSegment.data)d=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(sf&&(l.currentTime=f)}if(e.PTSKnown&&t>i&&l&&l.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a){var c=a.sn+1;c>=e.startSN&&c<=e.endSN&&(u=n[c-e.startSN],k.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=n[Math.min(s-1,Math.round(s/2))],k.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u}},{key:"_findFragment",value:function(e,t,r,i,a,n,s){var o=this.hls.config,l=void 0,d=void 0,f=o.maxFragLookUpTolerance,c=t?i[t.sn-i[0].sn+1]:void 0,h=function(e){var t=Math.min(f,e.duration);return e.start+e.duration-t<=a?1:e.start-t>a&&e.start?-1:0};if(an-f&&(f=0),d=c&&!h(c)?c:u.default.search(i,h)):d=i[r-1],d){l=d;var g=l.sn-s.startSN,v=t&&l.level===t.level,p=i[g-1],y=i[g+1];if(v&&l.sn===t.sn)if(l.sno.maxBufferHole&&t.dropped&&g?(l=p,k.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),t.loadCounter--):(l=y,k.logger.log("SN just loaded, load next one: "+l.sn))}else l=null;else l.dropped&&!v&&(y&&y.backtracked?(k.logger.warn("Already backtracked from fragment "+(g+1)+", will not backtrack to fragment "+g+". Loading fragment "+(g+1)),l=y):(k.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,p?(p.loadCounter&&p.loadCounter--,l=p):l=null))}return l}},{key:"_loadFragmentOrKey",value:function(e,t,r,i,a){var n=this.hls,s=n.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(k.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+i.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var o=s.fragLoadingLoopThreshold;if(e.loadCounter>o&&Math.abs(this.fragLoadIdx-e.loadIdx)t.endPTS?1:0})}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,r=this.media;if(r&&r.readyState&&r.seeking===!1&&(t=r.currentTime,t>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),f.default.isBuffered(r,t)?e=this.getBufferedFrag(t):f.default.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var i=e;if(i!==this.fragPlaying){this.hls.trigger(v.default.FRAG_CHANGED,{frag:i});var a=i.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(v.default.LEVEL_SWITCHED,{level:a}),this.fragPlaying=i}}}},{key:"immediateLevelSwitch",value:function(){if(k.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,r=void 0,i=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,r=this.getBufferedFrag(e.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),e.paused)t=0;else{var a=this.hls.nextLoadLevel,n=this.levels[a],s=this.fragLastKbps;t=s&&this.fragCurrent?this.fragCurrent.duration*n.bitrate/(1e3*s)+1:0}if((i=this.getBufferedFrag(e.currentTime+t))&&(i=this.followingBufferedFrag(i))){var o=this.fragCurrent;o&&o.loader&&o.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.startPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=R.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0,e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;if(k.logger.log("media seeking to "+t.toFixed(3)),this.state===R.FRAG_LOADING){var i=this.mediaBuffer?this.mediaBuffer:e,a=f.default.bufferInfo(i,t,this.config.maxBufferHole),n=this.fragCurrent;if(0===a.len&&n){var s=r.maxFragLookUpTolerance,o=n.start-s,l=n.start+n.duration+s;tl?(n.loader&&(k.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE):k.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===R.ENDED&&(this.state=R.IDLE);e&&(this.lastCurrentTime=t),this.state!==R.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){k.logger.log("media seeked to "+this.media.currentTime.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){k.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){k.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,r=!1,i=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(t.indexOf("mp4a.40.2")!==-1&&(r=!0),t.indexOf("mp4a.40.5")!==-1&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&k.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,i=this.levels[r],a=t.totalduration,n=0;if(k.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),this.levelLastLoaded=r,t.live){var s=i.details;s&&t.fragments.length>0?(E.default.mergeDetails(s,t),n=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(n,s),t.PTSKnown?k.logger.log("live playlist sliding:"+n.toFixed(3)):k.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,k.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,this.hls.trigger(v.default.LEVEL_UPDATED,{details:t,level:r}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var o=t.startTimeOffset;isNaN(o)?t.live?(this.startPosition=this.computeLivePosition(n,t),k.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(o<0&&(k.logger.log("negative start time offset "+o+", count from end of last fragment"),o=n+a+o),k.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===R.WAITING_LEVEL&&(this.state=R.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===R.KEY_LOADING&&(this.state=R.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===R.FRAG_LOADING&&t&&"main"===r.type&&r.level===t.level&&r.sn===t.sn){var i=e.stats,a=this.levels[t.level],n=a.details;if(k.logger.log("Loaded "+t.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t.level),this.bitrateTest=!1,this.stats=i,r.bitrateTest===!0&&this.hls.nextLoadLevel)this.state=R.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=performance.now(),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=R.IDLE,i.tparsed=i.tbuffered=performance.now(),n.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.tick();else{this.state=R.PARSING;var s=n.totalduration,o=t.level,l=t.sn,u=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(k.logger.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=u.indexOf("mp4a.40.5")!==-1?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,k.logger.log("Parsing "+l+" of ["+n.startSN+" ,"+n.endSN+"],level "+o+", cc "+t.cc);var d=this.demuxer;d||(d=this.demuxer=new h.default(this.hls,"main"));var f=this.media,c=f&&f.seeking,g=!c&&(n.PTSKnown||!n.live),p=n.initSegment?n.initSegment.data:[];d.push(e.payload,p,u,a.videoCodec,t,s,g,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING){var i,a,n=e.tracks;if(n.audio&&this.altAudio&&delete n.audio,a=n.audio){var s=this.levels[this.level].audioCodec,o=navigator.userAgent.toLowerCase();s&&this.audioCodecSwap&&(k.logger.log("swapping playlist audio codec"),s=s.indexOf("mp4a.40.5")!==-1?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&o.indexOf("firefox")===-1&&(s="mp4a.40.5"),o.indexOf("android")!==-1&&"audio/mpeg"!==a.container&&(s="mp4a.40.2",k.logger.log("Android: force audio codec to "+s)),a.levelCodec=s,a.id=e.id}a=n.video,a&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=e.id),this.hls.trigger(v.default.BUFFER_CODECS,n);for(i in n){a=n[i],k.logger.log("main track:"+i+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var l=a.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:i,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,i=e.frag;if(r&&"main"===e.id&&i.sn===r.sn&&i.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===R.PARSING){var a=this.levels[this.level],n=r;if(isNaN(e.endPTS)&&(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),k.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(n.dropped=e.dropped,n.dropped){if(!n.backtracked)return n.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=R.IDLE,void this.tick();k.logger.warn("Already backtracked on this fragment, appending with the gap")}else n.backtracked=!1;var s=E.default.updateFragPTSDTS(a.details,n,e.startPTS,e.endPTS,e.startDTS,e.endDTS),o=this.hls;o.trigger(v.default.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:s,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(r){r&&r.length&&t.state===R.PARSING&&(t.appended=!0,t.pendingBuffering=!0,o.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===R.PARSING&&(this.stats.tparsed=performance.now(),this.state=R.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){k.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(k.logger.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=R.IDLE}var a=this.hls;a.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(k.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,i=void 0,a=!1;for(var n in t){var s=t[n];"main"===s.id?(i=n,r=s,"video"===n&&(this.videoBuffer=t[n].buffer)):a=!0}a&&r?(k.logger.log("alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==R.PARSING&&t!==R.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==R.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("main buffered : "+T.default.toString(t.buffered));var r=this._bufferedFrags.filter(function(e){return f.default.isBuffered(t,(e.startPTS+e.endPTS)/2)});r.push(e),this._bufferedFrags=r.sort(function(e,t){return e.startPTS-t.startPTS}),this.fragPrevious=e;var i=this.stats;i.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*i.total/(i.tbuffered-i.tfirst)),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:e,id:"main"}),this.state=R.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=this.media,i=r&&f.default.isBuffered(r,r.currentTime)&&f.default.isBuffered(r,r.currentTime+.5);switch(e.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal){var a=this.fragLoadError;a?a++:a=1;var n=this.config;if(a<=n.fragLoadingMaxRetry||i||t.autoLevel&&t.level){this.fragLoadError=a,t.loadCounter=0;var s=Math.min(Math.pow(2,a-1)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);k.logger.warn("mediaController: frag loading failed, retry in "+s+" ms"),this.retryDate=performance.now()+s,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=R.FRAG_LOADING_WAITING_RETRY}else k.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=R.ERROR}break;case _.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(i?(this._reduceMaxBufferLength(t.duration),this.state=R.IDLE):t.autoLevel&&0!==t.level||(e.fatal=!0,this.state=R.ERROR));break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==R.ERROR&&(e.fatal?(this.state=R.ERROR,k.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):this.state===R.WAITING_LEVEL&&(this.state=R.IDLE));break;case _.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==R.PARSING&&this.state!==R.PARSED||(i?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=R.IDLE):(k.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,k.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&e.readyState){var t=e.currentTime,r=this.mediaBuffer?this.mediaBuffer:e,i=r.buffered;if(!this.loadedmetadata&&i.length){this.loadedmetadata=!0;var a=e.seeking?t:this.startPosition,n=f.default.isBuffered(r,a);t===a&&n||(k.logger.log("target start position:"+a),n||(a=i.start(0),k.logger.log("target start position not buffered, seek to buffered.start(0) "+a)),k.logger.log("adjust currentTime from "+t+" to "+a),e.currentTime=a)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var s=f.default.bufferInfo(e,t,0),o=!(e.paused||e.ended||0===e.buffered.length),l=t!==this.lastCurrentTime,u=this.config;if(l)this.stallReported&&(k.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(o){var d=performance.now(),c=this.hls;if(this.stalled){var h=d-this.stalled,g=s.len,p=this.nudgeRetry||0;if(g<=.5&&h>1e3*u.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,k.logger.warn("playback stalling in low buffer @"+t),c.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}));var y=s.nextStart,m=y-t;if(y&&m0){this.nudgeRetry=++p;var E=p*u.nudgeOffset;k.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+y+" + nudge "+E),e.currentTime=y+E,this.stalled=void 0,c.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:y+E-t})}}else if(g>.5&&h>1e3*u.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,k.logger.warn("playback stalling in high buffer @"+t),c.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g})),this.stalled=void 0,this.nudgeRetry=++p,p"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(y.default);r.default=A},{25:25,31:31,32:32,33:33,35:35,36:36,46:46,51:51,52:52}],14:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r-1&&this.vttFragQueues[this.currentTrackId].length){var e=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.hls.trigger(u.default.FRAG_LOADING,{frag:e})}}},{key:"onSubtitleFragProcessed",value:function(e){e.success&&this.vttFragSNsProcessed[e.frag.trackId].push(e.frag.sn),this.currentlyProcessing=null,this.nextFrag()}},{key:"onError",value:function(e){var t=e.frag;t&&"subtitle"!==t.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())}},{key:"onSubtitleTracksUpdated",value:function(e){var t=this;c.logger.log("subtitle tracks updated"),this.tracks=e.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(e){t.vttFragSNsProcessed[e.id]=[]})}},{key:"onSubtitleTrackSwitch",value:function(e){this.currentTrackId=e.id,this.clearVttFragQueues()}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this.vttFragSNsProcessed[e.id],r=this.vttFragQueues[e.id],i=this.currentlyProcessing?this.currentlyProcessing.sn:-1,a=function(e){return t.indexOf(e.sn)>-1},n=function(e){return r.some(function(t){return t.sn===e.sn})};e.details.fragments.forEach(function(t){a(t)||t.sn===i||n(t)||(t.trackId=e.id,r.push(t))}),this.nextFrag()}}]),t}(f.default);r.default=h},{32:32,33:33,51:51}],15:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){for(var t=[],r=0;r=0&&e0;)e.removeCue(e.cues[0])}function l(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}function u(e,t,r,i){return Math.min(t,i)-Math.max(e,r)}Object.defineProperty(r,"__esModule",{value:!0});var d=function(){function e(e,t){for(var r=0;r=0&&(o[0]=Math.min(o[0],t),o[1]=Math.max(o[1],r),n=!0,l/(r-t)>.5))return}n||a.push([t,r]),this.Cues.newCue(this[e],t,r,i)}},{key:"onInitPtsFound",value:function(e){var t=this;void 0===this.initPTS&&(this.initPTS=e.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(e){t.onFragLoaded(e)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var r=0;r>>8^255&p^99,e[h]=p,t[p]=h;var y=c[h],m=c[y],E=c[m],b=257*c[p]^16843008*p;i[h]=b<<24|b>>>8,a[h]=b<<16|b>>>16,n[h]=b<<8|b>>>24,s[h]=b,b=16843009*E^65537*m^257*y^16843008*h,l[p]=b<<24|b>>>8,u[p]=b<<16|b>>>16,d[p]=b<<8|b>>>24,f[p]=b,h?(h=y^c[c[c[E^y]]],g^=c[c[g]]):h=g=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,i=0;i>8|e>>>24}},{key:"decrypt",value:function(e,t,r){for(var i,a,n=this.keySize+6,s=this.invKeySchedule,o=this.invSBox,l=this.invSubMix,u=l[0],d=l[1],f=l[2],c=l[3],h=this.uint8ArrayToUint32Array_(r),g=h[0],v=h[1],p=h[2],y=h[3],m=new Int32Array(e),E=new Int32Array(m.length),b=void 0,T=void 0,_=void 0,k=void 0,R=void 0,A=void 0,S=void 0,L=void 0,w=void 0,D=void 0,O=void 0,I=void 0,P=this.networkToHostOrderSwap;t>>24]^d[A>>16&255]^f[S>>8&255]^c[255&L]^s[i],T=u[A>>>24]^d[S>>16&255]^f[L>>8&255]^c[255&R]^s[i+1],_=u[S>>>24]^d[L>>16&255]^f[R>>8&255]^c[255&A]^s[i+2],k=u[L>>>24]^d[R>>16&255]^f[A>>8&255]^c[255&S]^s[i+3],R=b,A=T,S=_,L=k,i+=4;b=o[R>>>24]<<24^o[A>>16&255]<<16^o[S>>8&255]<<8^o[255&L]^s[i],T=o[A>>>24]<<24^o[S>>16&255]<<16^o[L>>8&255]<<8^o[255&R]^s[i+1],_=o[S>>>24]<<24^o[L>>16&255]<<16^o[R>>8&255]<<8^o[255&A]^s[i+2],k=o[L>>>24]<<24^o[R>>16&255]<<16^o[A>>8&255]<<8^o[255&S]^s[i+3],i+=3,E[t]=P(b^g),E[t+1]=P(k^v),E[t+2]=P(_^p),E[t+3]=P(T^y),g=w,v=D,p=O,y=I,t+=4}return E.buffer}},{key:"destroy",value:function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0}}]),e}();r.default=n},{}],19:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>>5,(s-=h)>0&&c+h+s<=v);)for(g=m+f*u,p={unit:e.subarray(c+h,c+h+s),pts:g,dts:g},a.samples.push(p),a.len+=s,c+=s+h,f++;c>>6),(o=(60&t[r+2])>>>2)>h.length-1?void e.trigger(Event.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+o}):(u=(1&t[r+2])<<2,u|=(192&t[r+3])>>>6,i.logger.log("manifest codec:"+n+",ADTS data:type:"+s+",sampleingIndex:"+o+"["+h[o]+"Hz],channelConfig:"+u),/firefox/i.test(f)?o>=6?(s=5,d=new Array(4),l=o-3):(s=2,d=new Array(2),l=o):f.indexOf("android")!==-1?(s=2,d=new Array(2),l=o):(s=5,d=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&o>=6?l=o-3:((n&&n.indexOf("mp4a.40.2")!==-1&&o>=6&&1===u||!n&&1===u)&&(s=2,d=new Array(2)),l=o)),d[0]=s<<3,d[0]|=(14&o)>>1,d[1]|=(1&o)<<7,d[1]|=u<<3,5===s&&(d[1]|=(14&l)>>1,d[2]=(1&l)<<7,d[2]|=8,d[3]=0),{config:d,samplerate:h[o],channelCount:u,codec:"mp4a.40."+s,manifestCodec:c})}};t.exports=n},{31:31,51:51}],23:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&null!=t&&null!=t.key&&"AES-128"===t.method){var g=this.decrypter;null==g&&(g=this.decrypter=new d.default(this.observer,this.config));var v,p=this;try{v=performance.now()}catch(e){v=Date.now()}g.decrypt(e,t.key.buffer,t.iv.buffer,function(e){var d;try{d=performance.now()}catch(e){d=Date.now()}p.observer.trigger(o.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:d}}),p.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),i,a,n,s,l,u,f,c,h)})}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),i,a,n,s,l,u,f,c,h)}},{key:"pushDecrypted",value:function(e,t,r,i,a,n,s,u,d,f,h,v){var y=this.demuxer;if(!y||s&&!this.probe(e)){var E=this.observer,T=this.typeSupported,_=this.config,k=[{demux:p.default,remux:m.default},{demux:c.default,remux:m.default},{demux:g.default,remux:b.default}];for(var R in k){var A=k[R],S=A.demux.probe;if(S(e)){var L=this.remuxer=new A.remux(E,_,T,this.vendor);y=new A.demux(E,L,_,T),this.probe=S;break}}if(!y)return void E.trigger(o.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=y}var w=this.remuxer;(s||u)&&(y.resetInitSegment(r,i,a,f),w.resetInitSegment()),s&&(y.resetTimeStamp(),w.resetTimeStamp(v)),"function"==typeof y.setDecryptData&&y.setDecryptData(t),y.append(e,n,d,h)}}]),e}();r.default=T},{19:19,21:21,28:28,30:30,31:31,33:33,43:43,44:44}],24:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=e(23),n=i(a),s=e(33),o=i(s),l=e(51),u=e(1),d=i(u),f=function(e){var t=new d.default;t.trigger=function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a1?r-1:0),a=1;a1?t-1:0),i=1;i1?t-1:0),i=1;ie?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,r,i=8,a=8;for(t=0;t=8){var r=e.bin2str(t.subarray(4,8));return["moof","ftyp","styp"].indexOf(r)>=0}return!1}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"findBox",value:function(t,r){var i,a,n,s,o,l=[];if(!r.length)return null;for(i=0;i1?i+a:t.byteLength,n===r[0]&&(1===r.length?l.push(t.subarray(i+8,s)):(o=e.findBox(t.subarray(i+8,s),r.slice(1)),o.length&&(l=l.concat(o)))),i=s;return l}},{key:"parseInitSegment",value:function(t){var r=[];return e.findBox(t,["moov","trak"]).forEach(function(t){var i=e.findBox(t,["tkhd"])[0];if(i){var a=i[0],n=0===a?12:20,s=i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3];s=s<0?4294967296+s:s;var o=e.findBox(t,["mdia","mdhd"])[0];if(o){a=o[0],n=0===a?12:20;var l=o[n]<<24|o[n+1]<<16|o[n+2]<<8|o[n+3],u=e.findBox(t,["mdia","hdlr"])[0];if(u){var d=e.bin2str(u.subarray(8,12)),f={soun:"audio",vide:"video"}[d];f&&(r[s]={timescale:l,type:f},r[f]={timescale:l,id:s})}}}}),r}},{key:"startDTS",value:function(t,r){var i,a,n;return i=e.findBox(r,["moof","traf"]),a=[].concat.apply([],i.map(function(r){return e.findBox(r,["tfhd"]).map(function(i){var a,n,s;return a=i[4]<<24|i[5]<<16|i[6]<<8|i[7],n=t[a].timescale||9e4,s=e.findBox(r,["tfdt"]).map(function(e){var t,r;return t=e[0],r=e[4]<<24|e[5]<<16|e[6]<<8|e[7],1===t&&(r*=Math.pow(2,32),r+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),r})[0],(s=s||1/0)/n})})),n=Math.min.apply(null,a),isFinite(n)?n:0}}]),e}();r.default=o},{33:33}],29:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=e.length)return void r();if(!(e[t].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,i),!i)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),i=0,a=32;a<=e.length-16;a+=160,i+=16)r.set(e.subarray(a,a+16),i);return r}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var r=0,i=32;i<=e.length-16;i+=160,r+=16)e.set(t.subarray(r,r+16),i);return e}},{key:"decryptAvcSample",value:function(e,t,r,i,a,n){var s=this.discardEPB(a.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,function(o){a.data=l.getAvcDecryptedUnit(s,o),n||l.decryptAvcSamples(e,t,r+1,i)})}},{key:"decryptAvcSamples",value:function(e,t,r,i){for(;;t++,r=0){if(t>=e.length)return void i();for(var a=e[t].units;!(r>=a.length);r++){var n=a[r];if(!(n.length<=48||1!==n.type&&5!==n.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,i,n,s),!s)return}}}}}]),e}();r.default=o},{19:19}],30:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>4>1){if((o=a+5+e[a+4])===a+188)continue}else o=a+4;switch(s){case m:n&&(_&&(l=L(_))&&w(l,!1),_={data:[],size:0}),_&&(_.data.push(e.subarray(o,a+188)),_.size+=a+188-o);break;case E:n&&(k&&(l=L(k))&&(p.isAAC?D(l):O(l)),k={data:[],size:0}),k&&(k.data.push(e.subarray(o,a+188)),k.size+=a+188-o);break;case b:n&&(R&&(l=L(R))&&I(l),R={data:[],size:0}),R&&(R.data.push(e.subarray(o,a+188)),R.size+=a+188-o);break;case 0:n&&(o+=e[o]+1),T=this._pmtId=A(e,o);break;case T:n&&(o+=e[o]+1);var P=S(e,o,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,null!=this.sampleAes);m=P.avc,m>0&&(h.id=m),E=P.audio,E>0&&(p.id=E,p.isAAC=P.isAAC),b=P.id3,b>0&&(y.id=b),f&&!c&&(g.logger.log("reparse from beginning"),f=!1,a=-188),c=this.pmtParsed=!0;break;case 17:case 8191:break;default:f=!0}}else this.observer.trigger(u.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_&&(l=L(_))?(w(l,!0),h.pesData=null):h.pesData=_,k&&(l=L(k))?(p.isAAC?D(l):O(l),p.pesData=null):(k&&k.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=k),R&&(l=L(R))?(I(l),y.pesData=null):y.pesData=R,null==this.sampleAes?this.remuxer.remux(p,h,y,this._txtTrack,t,r,i):this.decryptAndRemux(p,h,y,this._txtTrack,t,r,i)}},{key:"decryptAndRemux",value:function(e,t,r,i,a,n,s){if(e.samples&&e.isAAC){var o=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){o.decryptAndRemuxAvc(e,t,r,i,a,n,s)})}else this.decryptAndRemuxAvc(e,t,r,i,a,n,s)}},{key:"decryptAndRemuxAvc",value:function(e,t,r,i,a,n,s){if(t.samples){var o=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){o.remuxer.remux(e,t,r,i,a,n,s)})}else this.remuxer.remux(e,t,r,i,a,n,s)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,r,i){var a,n,s,o,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=(15&e[t+1])<<8|e[t+2],n=t+3+a-4,s=(15&e[t+10])<<8|e[t+11],t+=12+s;t1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(t=d[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if((i=(t[4]<<8)+t[5])&&i>e.size-6)return null;r=t[7],192&r&&(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,s>4294967295&&(s-=8589934592),64&r?(o=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,o>4294967295&&(o-=8589934592),s-o>54e5&&(g.logger.warn(Math.round((s-o)/9e4)+"s delta between PTS and DTS, align them"),s=o)):o=s),a=t[8],l=a+9,e.size-=l,n=new Uint8Array(e.size);for(var c=0,h=d.length;cv){l-=v;continue}t=t.subarray(l),v-=l,l=0}n.set(t,u),u+=v}return i&&(i-=a+3),{data:n,pts:s,dts:o,len:i}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var r=t.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||e.key===!0||t.sps&&(i||this.contiguous)?(e.id=i,r.push(e)):t.dropped++}e.debug.length&&g.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var r,i,a,n=this,s=this._avcTrack,o=this._parseAVCNALu(e.data),l=this.avcSample;e.data=null,o.forEach(function(t){switch(t.type){case 1:i=!0,l.frame=!0;var o=t.data;if(o.length>4){var u=new f.default(o).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:i=!0,l||(l=n.avcSample=n._createAVCSample(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,r=new f.default(n.discardEPB(t.data)),r.readUByte();for(var d=0,c=0,h=!1,g=0;!h&&r.bytesAvailable>1;){d=0;do{g=r.readUByte(),d+=g}while(255===g);c=0;do{g=r.readUByte(),c+=g}while(255===g);if(4===d&&0!==r.bytesAvailable){h=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var v=r.readUByte(),p=r.readUByte(),y=31&v,m=[v,p];for(a=0;a0){if(t.pts>=e[r-1].pts)e.push(t);else for(var i=r-1;i>=0;i--)if(t.pts=0)i={data:e.subarray(c,s-u-1),type:n},f.push(i);else{var h=this._getLastNalUnit();if(h&&(d&&s<=4-d&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-d)),(r=s-u-1)>0)){var g=new Uint8Array(h.data.byteLength+r);g.set(h.data,0),g.set(e.subarray(0,r),h.data.byteLength),h.data=g}}s=0&&u>=0&&(i={data:e.subarray(c,o),type:n,state:u},f.push(i)),0===f.length){var v=this._getLastNalUnit();if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return l.naluState=u,f}},{key:"discardEPB",value:function(e){for(var t,r,i=e.byteLength,a=[],n=1;n1&&(g.logger.log("AAC: align PTS for overlapping frames by "+Math.round((k-p)/90)),p=k)}for(;n+5>>5,(r-=s)>0&&n+s+r<=d);)for(l=p+a*i,f={unit:h.subarray(n+s,n+s+r),pts:l,dts:l},c.samples.push(f),c.len+=r,n+=r+s,a++;n0;)s+=t}},{key:"_onMpegFrame",value:function(e,t,r,i,a,n){var s=1152/r*1e3,o=n+a*s,l=this._audioTrack;l.config=[],l.channelCount=i,l.samplerate=r,l.duration=this._duration,l.samples.push({unit:e,pts:o,dts:o}),l.len+=e.length}},{key:"_onMpegNoise",value:function(e){g.logger.warn("mpeg audio has noise: "+e.length+" bytes")}},{key:"_parseMpeg",value:function(e,t,r,i,a){var n=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3];if(t+2>r)return-1;if(255===e[t]||224==(224&e[t+1])){if(t+24>r)return-1;var o=e[t+1]>>3&3,l=e[t+1]>>1&3,u=e[t+2]>>4&15,d=e[t+2]>>2&3,f=!!(2&e[t+2]);if(1!==o&&0!==u&&15!==u&&3!==d){var c=3===o?3-l:3===l?3:4,h=1e3*n[14*c+u-1],g=3===o?0:2===o?1:2,v=s[3*g+d],p=f?1:0,y=e[t+3]>>6==3?1:2,m=3===l?(3===o?12:6)*h/v+p<<2:(3===o?144:72)*h/v+p|0;return t+m>r?-1:(this._onMpegFrame&&this._onMpegFrame(e.subarray(t,t+m),h,v,y,i,a),m)}}for(var E=t+2;E=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();r.default=p},{22:22,26:26,29:29,31:31,33:33,51:51}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},{}],32:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var r=0;r1?r-1:0),n=1;n=r.start(i)&&t<=r.end(i))return!0;return!1},bufferInfo:function(e,t,r){if(e){var i,a=e.buffered,n=[];for(i=0;id&&(l[u-1].end=e[o].end):l.push(e[o])}else l.push(e[o])}for(o=0,i=0,a=n=t;o=f&&t=0&&oe.endSN)return 0;var d,f,c;for(d=u-e.startSN,f=e.fragments,t=f[d],c=d;c>0;c--)a.updatePTS(f,c,c-1);for(c=d;ct?a.start+a.duration:Math.max(a.start-n.duration,0):r>t?(a.duration=s-a.start,a.duration<0&&i.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):(n.duration=a.start-s,n.duration<0&&i.logger.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!"))}};t.exports=a},{51:51}],37:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var i=e.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var n in i)n in r||(r[n]=i[n]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,k.enableLogs)(r.debug),this.config=r,this._autoLevelCapping=-1;var s=this.observer=new A.default;s.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:-1;k.logger.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})}},{key:"stopLoad",value:function(){k.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})}},{key:"swapAudioCodec",value:function(){k.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){k.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){k.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){k.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){k.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){k.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){k.logger.log("set startLevel:"+e);var t=this;e!==-1&&(e=Math.max(e,t.minAutoLevel)),t.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){k.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this,t=e.levels,r=e.config.minAutoBitrate,i=t?t.length:0,a=0;ar)return a}return 0}},{key:"maxAutoLevel",get:function(){var e=this,t=e.levels,r=e.autoLevelCapping;return r===-1&&t&&t.length?t.length-1:r}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){var t=this;t.abrController.nextAutoLevel=Math.max(t.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}]),e}();r.default=L},{1:1,11:11,12:12,13:13,2:2,31:31,33:33,39:39,4:4,40:40,41:41,51:51}],38:[function(e,t,r){"use strict";t.exports=e(37).default},{37:37}],39:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&(r=new T,r.method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=u.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var e=this._byteRange=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r?r:0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),e}(),k=function(e){function t(e){s(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING,f.default.SUBTITLE_TRACK_LOADING));return r.loaders={},r}return n(t,e),o(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},h.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:"subtitleTrack",id:e.id})}},{key:"load",value:function(e,t){var r=this.loaders[t.type];if(r){var i=r.context;if(i&&i.url===e)return void y.logger.trace("playlist request ongoing");y.logger.warn("abort previous loader for type:"+t.type),r.abort()}var a=this.hls.config,n=void 0,s=void 0,o=void 0,l=void 0;"manifest"===t.type?(n=a.manifestLoadingMaxRetry,s=a.manifestLoadingTimeOut,o=a.manifestLoadingRetryDelay,l=a.manifestLoadingMaxRetryTimeout):(n=a.levelLoadingMaxRetry,s=a.levelLoadingTimeOut,o=a.levelLoadingRetryDelay,l=a.levelLoadingMaxRetryTimeout,y.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),r=this.loaders[t.type]=t.loader=void 0!==a.pLoader?new a.pLoader(a):new a.loader(a),t.url=e,t.responseType="";var u=void 0,d=void 0;u={timeout:s,maxRetry:n,retryDelay:o,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(t,u,d)}},{key:"resolve",value:function(e,t){return u.default.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(e,t){var r=[],i=void 0;for(m.lastIndex=0;null!=(i=m.exec(e));){var a={},n=a.attrs=new p.default(i[1]);a.url=this.resolve(i[2],t);var s=n.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=n.decimalInteger("AVERAGE-BANDWIDTH")||n.decimalInteger("BANDWIDTH"),a.name=n.NAME;var o=n.CODECS;if(o){o=o.split(/[ ,]+/);for(var l=0;l2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,r,i){var a,n,s=0,o=0,l={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},u=new T,d=0,f=null,c=new _;for(b.lastIndex=0;null!==(a=b.exec(e));){var h=a[1];if(h){c.duration=parseFloat(h);var g=(" "+a[2]).slice(1);c.title=g?g:null,c.tagList.push(g?["INF",h,g]:["INF",h])}else if(a[3]){if(!isNaN(c.duration)){var v=s++;c.type=i,c.start=o,c.levelkey=u,c.sn=v,c.level=r,c.cc=d,c.baseurl=t,c.relurl=(" "+a[3]).slice(1),l.fragments.push(c),f=c,o+=c.duration,c=new _}}else if(a[4]){if(c.rawByteRange=(" "+a[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(c.lastByteRangeEndOffset=m)}}else if(a[5])c.rawProgramDateTime=(" "+a[5]).slice(1),c.tagList.push(["PROGRAM-DATE-TIME",c.rawProgramDateTime]);else{for(a=a[0].match(/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)(.*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/),n=1;n=0&&(u.method=S,u.baseuri=t,u.reluri=L,u.key=null,u.iv=w));break;case"START":var D=E,O=new p.default(D),I=O.decimalFloatingPoint("TIME-OFFSET");isNaN(I)||(l.startTimeOffset=I);break;case"MAP":var P=new p.default(E);c.relurl=P.URI,c.rawByteRange=P.BYTERANGE,c.baseurl=t,c.level=r,c.type=i,c.sn="initSegment",l.initSegment=c,c=new _;break;default:y.logger.warn("line parsed but not handled: "+a)}}}return c=f,c&&!c.relurl&&(l.fragments.pop(),o-=c.duration),l.totalduration=o,l.averagetargetduration=o/l.fragments.length,l.endSN=s-1,l}},{key:"loadsuccess",value:function(e,t,r){var i=e.data,a=e.url,n=r.type,s=r.id,o=r.level,l=this.hls;if(this.loaders[n]=void 0,void 0!==a&&0!==a.indexOf("data:")||(a=r.url),t.tload=performance.now(),0===i.indexOf("#EXTM3U"))if(i.indexOf("#EXTINF:")>0){var u="audioTrack"!==n&&"subtitleTrack"!==n,d=isNaN(o)?isNaN(s)?0:s:o,c=this.parseLevelPlaylist(i,a,d,"audioTrack"===n?"audio":"subtitleTrack"===n?"subtitle":"main");c.tload=t.tload,"manifest"===n&&l.trigger(f.default.MANIFEST_LOADED,{levels:[{url:a,details:c}],audioTracks:[],url:a,stats:t}),t.tparsed=performance.now(),c.targetduration?u?l.trigger(f.default.LEVEL_LOADED,{details:c,level:o||0,id:s||0,stats:t}):"audioTrack"===n?l.trigger(f.default.AUDIO_TRACK_LOADED,{details:c,id:s,stats:t}):"subtitleTrack"===n&&l.trigger(f.default.SUBTITLE_TRACK_LOADED,{details:c,id:s,stats:t}):l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(i,a);if(h.length){var v=this.parseMasterPlaylistMedia(i,a,"AUDIO"),p=this.parseMasterPlaylistMedia(i,a,"SUBTITLES");if(v.length){var m=!1;v.forEach(function(e){e.url||(m=!0)}),m===!1&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(y.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main"}))}l.trigger(f.default.MANIFEST_LOADED,{levels:h,audioTracks:v,subtitles:p,url:a,stats:t})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest"})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,response:e,context:t})}},{key:"loadtimeout",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_TIMEOUT,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_TIMEOUT,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,context:t})}}]),t}(h.default);r.default=k},{2:2,31:31,32:32,33:33,45:45,51:51}],42:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=255&i,t.set(e,4),a=0,i=8;a>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))}},{key:"moov",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(i))}},{key:"mvhd",value:function(t,r){r*=t;var i=Math.floor(r/(n+1)),a=Math.floor(r%(n+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,s)}},{key:"sdtp",value:function(t){var r,i,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),s.push(255&a),s=s.concat(Array.prototype.slice.call(i));var o=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(s))),l=t.width,u=t.height,d=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,i=t.duration*t.timescale,a=t.width,s=t.height,o=Math.floor(i/(n+1)),l=Math.floor(i%(n+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,s>>8&255,255&s,0,0]))}},{key:"traf",value:function(t,r){var i=e.sdtp(t),a=t.id,s=Math.floor(r/(n+1)),o=Math.floor(r%(n+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),e.trun(t,i.length+16+20+8+16+8+8),i)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var i,a,n,s,o,l,u=t.samples||[],d=u.length,f=12+16*d,c=new Uint8Array(f);for(r+=8+f,c.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,c)}},{key:"initSegment",value:function(t){e.types||e.init();var r,i=e.moov(t);return r=new Uint8Array(e.FTYP.byteLength+i.byteLength),r.set(e.FTYP),r.set(i,e.FTYP.byteLength),r}}]),e}();r.default=s},{}],43:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r-1&&s&&!s.match("CriOS"),this.ISGenerated=!1}return n(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,r,i,a,n,s){if(this.ISGenerated||this.generateIS(e,t,a),this.ISGenerated)if(e.samples.length){e.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,a));var o=this.remuxAudio(e,a,n,s);if(t.samples.length){var l=void 0;o&&(l=o.endPTS-o.startPTS),t.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,a)),this.remuxVideo(t,a,n,l)}}else{var f=void 0;t.samples.length&&(f=this.remuxVideo(t,a,n)),f&&e.codec&&this.remuxEmptyAudio(e,a,n,f)}r.samples.length&&this.remuxID3(r,a),i.samples.length&&this.remuxText(i,a),this.observer.trigger(u.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,r){var i,a,n=this.observer,s=e.samples,o=t.samples,l=this.typeSupported,f="audio/mp4",g={},v={tracks:g},p=void 0===this._initPTS;if(p&&(i=a=1/0),e.config&&s.length&&(e.timescale=e.samplerate,d.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(l.mpeg?(f="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3")),g.audio={container:f,codec:e.codec,initSegment:!e.isAAC&&l.mpeg?new Uint8Array:c.default.initSegment([e]),metadata:{channelCount:e.channelCount}},p&&(i=a=s[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&o.length){var y=t.inputTimeScale;t.timescale=y,g.video={container:"video/mp4",codec:t.codec,initSegment:c.default.initSegment([t]),metadata:{width:t.width,height:t.height}},p&&(i=Math.min(i,o[0].pts-y*r),a=Math.min(a,o[0].dts-y*r),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:i}))}Object.keys(g).length?(n.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,v),this.ISGenerated=!0,p&&(this._initPTS=i,this._initDTS=a)):n.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,i){var a,n,s,o,l,f,g,v=8,p=e.timescale,y=e.samples,m=[],E=y.length,b=this._PTSNormalize,T=this._initDTS;y.sort(function(e,t){var r=e.dts-t.dts,i=e.pts-t.pts;return r?r:i?i:e.id-t.id});var _=y.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(_<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(_/90)+" ms to overcome this issue");for(var k=0;k1?d.logger.log("AVC:"+S+" ms hole between fragments detected,filling it"):S<-1&&d.logger.log("AVC:"+-S+" ms overlapping between fragments detected"),l=R,y[0].dts=l+T,o=Math.max(o-S,R),y[0].pts=o+T,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(o/90)+"/"+Math.round(l/90)+",delta:"+S+" ms")),A=y[y.length-1],g=Math.max(b(A.dts-T,R),0),f=Math.max(b(A.pts-T,R),0),f=Math.max(f,g);var L=this.isSafari;L&&(a=Math.round((g-l)/(y.length-1)));for(var w=0,D=0,O=0;O0?U-1:U].dts;if(z.stretchShortVideoTrack){var Q=z.maxBufferHole,J=z.maxSeekHole,Z=Math.floor(Math.min(Q,J)*p),$=(i?o+i*p:this.nextAudioPts)-B.pts;$>Z?(a=$-q,a<0&&(a=q),d.logger.log("It is approximately "+$/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=q}else a=q}K=Math.round(B.pts-B.dts)}m.push({size:j,duration:a,cts:K,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:B.key?2:1,isNonSync:B.key?0:1}})}this.nextAvcDts=g+a;var ee=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,m.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var te=m[0].flags;te.dependsOn=2,te.isNonSync=0}e.samples=m,s=c.default.moof(e.sequenceNumber++,l,e),e.samples=[];var re={data1:s,data2:n,startPTS:o/p,endPTS:(f+a)/p,startDTS:l/p,endDTS:this.nextAvcDts/p,type:"video",nb:m.length,dropped:ee};return this.observer.trigger(u.default.FRAG_PARSING_DATA,re),re}},{key:"remuxAudio",value:function(e,t,r,i){var a,n,s,l,f,g,v,p,y,m,E,b,T,_,k,R,A=e.inputTimeScale,S=e.timescale,L=A/S,w=e.isAAC?1024:1152,D=w*L,O=this._PTSNormalize,I=this._initDTS,P=!e.isAAC&&this.typeSupported.mpeg,C=P?0:8,x=[],F=[];if(e.samples.sort(function(e,t){return e.pts-t.pts}),F=e.samples,R=this.nextAudioPts,r|=F.length&&R&&(i&&Math.abs(t-R/A)<.1||Math.abs(F[0].pts-R-I)<20*D),r||(R=t*A),i&&e.isAAC)for(var M=0,N=R;M=D&&N){var j=Math.round(G/D);d.logger.warn("Injecting "+j+" audio frame @ "+(N/A).toFixed(3)+"s due to "+1e3*G/A+" ms gap.");for(var K=0;K0)Y=Math.round((b-R)/D),d.logger.log(V+" ms hole between AAC samples detected,filling it"),Y>0&&(_=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),_||(_=l.subarray()),e.len+=Y*_.length);else if(V<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(R/A).toFixed(3)+"s/"+(b/A).toFixed(3)+"s/"+-V+"ms"),e.len-=l.byteLength;continue}b=T=R}if(v=Math.max(0,b),p=Math.max(0,T),!(e.len>0))return;var X=P?e.len:e.len+8;try{f=new Uint8Array(X)}catch(e){return void this.observer.trigger(u.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:X,reason:"fail allocating audio mdat "+X})}P||(a=new DataView(f.buffer),a.setUint32(0,X),f.set(c.default.types.mdat,4));for(var z=0;z=2&&(Q=x[J-2].duration,s.duration=Q),J){this.nextAudioPts=b+L*Q,e.len=0,e.samples=x,g=P?new Uint8Array:c.default.moof(e.sequenceNumber++,p/L,e),e.samples=[];var Z={data1:g,data2:f,startPTS:v/A,endPTS:this.nextAudioPts/A,startDTS:p/A,endDTS:(T+L*Q)/A,type:"audio",nb:J};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Z),Z}return null}},{key:"remuxEmptyAudio",value:function(e,t,r,i){var a=e.inputTimeScale,n=e.samplerate?e.samplerate:a,s=a/n,l=this.nextAudioPts,u=(void 0!==l?l:i.startDTS*a)+this._initDTS,f=i.endDTS*a+this._initDTS,c=1024*s,h=Math.ceil((f-u)/c),g=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(d.logger.warn("remux empty Audio"),!g)return void d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var v=[],p=0;p4294967296;)e+=r;return e}}]),e}();r.default=g},{31:31,33:33,34:34,42:42,51:51}],44:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,r={};for(s.lastIndex=0;null!==(t=s.exec(e));){var i=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}return r}}]),e}();r.default=o},{}],46:[function(e,t,r){"use strict";var i={search:function(e,t){for(var r=0,i=e.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=e[a];var s=t(n);if(s>0)r=a+1;else{ +if(!(s<0))return n;i=a-1}}return null}};t.exports=i},{}],47:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rl&&(g.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=s(e);if(this.pos>=l)return void g.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(e){var t;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),b=function(){function e(t,r){i(this,e),this.chNr=t,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new E,this.nonDisplayedMemory=new E,this.lastOutputScreen=new E,this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return a(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,g.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}g.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=g.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),T=function(){function e(t,r,a){i(this,e),this.field=t||1,this.outputs=[r,a],this.channels=[new b(1,r),new b(2,a)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return a(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var r,i,a,n=!1;this.lastTime=e,g.setTime(e);for(var s=0;s ("+v([i,a])+")"),r=this.parseCmd(i,a),r||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(n=this.parseChars(i,a)))if(this.currChNr&&this.currChNr>=0){var o=this.channels[this.currChNr-1];o.insertChars(n)}else g.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:n?this.dataCounters.char+=2:(this.dataCounters.other+=2,g.log("WARNING","Couldn't parse cleaned data "+v([i,a])+" orig: "+v([t[s],t[s+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var r=null,i=(20===e||28===e)&&32<=t&&t<=47,a=(23===e||31===e)&&33<=t&&t<=35;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,g.log("DEBUG","Repeated command ("+v([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var n=this.channels[r-1];return 20===e||28===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"parseMidrow",value:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return g.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(t),g.log("DEBUG","MIDROW ("+v([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var r=null,i=null,a=(17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127,n=(16===e||24===e)&&64<=t&&t<=95;if(!a&&!n)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,i=64<=t&&t<=95?1===r?u[e]:f[e]:1===r?d[e]:c[e];var s=this.interpretPAC(i,t);return this.channels[r-1].setPAC(s),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"interpretPAC",value:function(e,t){var r=t,i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i}},{key:"parseChars",value:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var n=t;n=17===a?t+80:18===a?t+112:t+144,g.log("INFO","Special char '"+s(n)+"' in channel "+r),i=[n]}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t]);if(i){var o=v(i);g.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i}},{key:"parseBackgroundAttributes",value:function(e,t){var r,i,a,n,s=(16===e||24===e)&&32<=t&&t<=47,o=(23===e||31===e)&&45<=t&&t<=47;return!(!s&&!o)&&(r={},16===e||24===e?(i=Math.floor((t-32)/2),r.background=h[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),a=e<24?1:2,n=this.channels[a-1],n.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e=16?l--:l++,navigator.userAgent.match(/Firefox\//)?s.line=f+1:s.line=f>7?f-2:f+1,s.align="left",s.position=Math.max(0,Math.min(100,l/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(s)}}};t.exports=a},{54:54}],49:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();r.default=o},{50:50}],50:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r "+t}function n(e){var t=self.console[e];return t?function(){for(var r=arguments.length,i=Array(r),n=0;n1?t-1:0),i=1;i100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},u,{get:function(){return T},set:function(e){var r=t(e);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");T=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},u,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},u,{get:function(){return k},set:function(e){var r=t(e);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");k=r,this.hasBeenReset=!0}})),o.displayState=void 0,l)return o}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var a="auto",n={"":!0,lr:!0,rl:!0},s={start:!0,middle:!0,end:!0,left:!0,right:!0};return i.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},i}()},{}],54:[function(e,t,r){"use strict";function i(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new f,this.regionList=[]}function a(e){function t(e,t,r,i){return 3600*(0|e)+60*(0|t)+(0|r)+(0|i)/1e3}var r=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?t(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?t(r[1],r[2],0,r[4]):t(0,r[1],r[2],r[4]):null}function n(){this.values=Object.create(null)}function s(e,t,r,i){var a=i?e.split(i):[e];for(var n in a)if("string"==typeof a[n]){var s=a[n].split(r);if(2===s.length){var o=s[0],l=s[1];t(o,l)}}}function o(e,t,r){function i(){var t=a(e);if(null===t)throw new Error("Malformed timestamp: "+l);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function o(){e=e.replace(/^\s+/,"")}var l=e;if(o(),t.startTime=i(),o(),"-->"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);e=e.substr(3),o(),t.endTime=i(),o(),function(e,t){var i=new n;s(e,function(e,t){switch(e){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===t){i.set(e,r[a].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var n=t.split(","),s=n[0];i.integer(e,s),i.percent(e,s)&&i.set("snapToLines",!1),i.alt(e,s,["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",h,"end"]);break;case"position":n=t.split(","),i.percent(e,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",h,"end","left","right"])}},/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");var a=i.get("line","auto");"auto"===a&&c.line===-1&&(a=-1),t.line=a,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",h);var o=i.get("position","auto");"auto"===o&&50===c.position&&(o="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=o}(e,t)}function l(e){return e.replace(//gi,"\n")}Object.defineProperty(r,"__esModule",{value:!0}),r.fixLineBreaks=void 0;var u=e(53),d=function(e){return e&&e.__esModule?e:{default:e}}(u),f=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};n.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,r){for(var i=0;i=0&&t<=100)&&(this.set(e,t),!0)}};var c=new d.default(0,0,0),h="middle"===c.align?"middle":"center";i.prototype={parse:function(e){function t(){var e=r.buffer,t=0;for(e=l(e);t")===-1){r.cue.id=i;continue}case"CUE":try{o(i,r.cue,r.regionList)}catch(e){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var u=i.indexOf("-->")!==-1;if(!i||u&&(n=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+="\n"),r.cue.text+=i;continue;case"BADCUE":i||(r.state="ID");continue}}}catch(e){"CUETEXT"===r.state&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state="INITIAL"===r.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new Error("Malformed WebVTT signature.")}catch(e){throw e}return e.onflush&&e.onflush(),this}},r.fixLineBreaks=l,r.default=i},{53:53}],55:[function(e,t,r){"use strict";var i=e(54),a=function(e){return e&&e.__esModule?e:{default:e}}(i),n=function(e){var t=parseInt(e.substr(-3)),r=parseInt(e.substr(-6,2)),i=parseInt(e.substr(-9,2)),a=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;return isNaN(t)||isNaN(r)||isNaN(i)||isNaN(a)?-1:(t+=1e3*r,t+=6e4*i,t+=36e5*a)},s=function(e,t,r){var i=e[t],a=e[i.prevCC];if(!a||!a.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);for(;a&&a.new;)e.ccOffset+=i.start-a.start,i.new=!1,i=a,a=e[i.prevCC];e.presentationOffset=r},o={parse:function(e,t,r,i,o,l){var u=String.fromCharCode.apply(null,new Uint8Array(e)).trim().replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n"),d="00:00.000",f=0,c=0,h=0,g=[],v=void 0,p=!0,y=new a.default;y.oncue=function(e){var t=r[i],a=r.ccOffset;t&&t.new&&(c?a=r.ccOffset=t.start:s(r,i,h)),h&&!c&&(a=h+r.ccOffset-r.presentationOffset),e.startTime+=a-c,e.endTime+=a-c,e.text=decodeURIComponent(escape(e.text)),e.endTime>0&&g.push(e)},y.onparsingerror=function(e){v=e},y.onflush=function(){if(v&&l)return void l(v);o(g)},u.forEach(function(e){if(p){if(e.startsWith("X-TIMESTAMP-MAP=")){p=!1,e.substr(16).split(",").forEach(function(e){e.startsWith("LOCAL:")?d=e.substr(6):e.startsWith("MPEGTS:")&&(f=parseInt(e.substr(7)))});try{t=t<0?t+8589934592:t,f-=t,c=n(d)/1e3,h=f/9e4,c===-1&&(v=new Error("Malformed X-TIMESTAMP-MAP: "+e))}catch(t){v=new Error("Malformed X-TIMESTAMP-MAP: "+e)}return}""===e&&(p=!1)}y.parse(e+"\n")}),y.flush()}};t.exports=o},{54:54}],56:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){var o=t.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,performance.now());var l=void 0,u=void 0;"arraybuffer"===a.responseType?(l=t.response,u=l.byteLength):(l=t.responseText,u=l.length),i.loaded=i.total=u;var d={url:t.responseURL,data:l};this.callbacks.onSuccess(d,i,a)}else i.retry>=s.maxRetry||o>=400&&o<499?(n.logger.error(o+" while loading "+a.url),this.callbacks.onError({code:o,text:t.statusText},a)):(n.logger.warn(o+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),i.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout)}},{key:"loadtimeout",value:function(){n.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context)}},{key:"loadprogress",value:function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);var r=this.callbacks.onProgress;r&&r(t,this.context,null)}}]),e}() +;r.default=s},{51:51}]},{},[38])(38)}); diff --git a/dashboard-ui/camerauploadsettings.html b/dashboard-ui/camerauploadsettings.html index 6931b78daf..46de0f1a06 100644 --- a/dashboard-ui/camerauploadsettings.html +++ b/dashboard-ui/camerauploadsettings.html @@ -1,6 +1,6 @@ 
    -
    +

    diff --git a/dashboard-ui/channelitems.html b/dashboard-ui/channelitems.html index fba63e5603..ff1fad238a 100644 --- a/dashboard-ui/channelitems.html +++ b/dashboard-ui/channelitems.html @@ -7,7 +7,7 @@

    -
    +
    diff --git a/dashboard-ui/channels.html b/dashboard-ui/channels.html index 8fa9ab2fc1..3642bd3673 100644 --- a/dashboard-ui/channels.html +++ b/dashboard-ui/channels.html @@ -7,7 +7,4 @@
    - -
    -
    \ No newline at end of file diff --git a/dashboard-ui/cinemamodeconfiguration.html b/dashboard-ui/cinemamodeconfiguration.html index 36bf270687..b525be7467 100644 --- a/dashboard-ui/cinemamodeconfiguration.html +++ b/dashboard-ui/cinemamodeconfiguration.html @@ -1,6 +1,6 @@ 
    -
    +

    @@ -50,7 +50,7 @@
    ${OptionTrailersFromMyMoviesHelp}

    @@ -86,7 +86,7 @@
    ${LabelCodecIntrosPathHelp}
    - +

    diff --git a/dashboard-ui/components/apphost.js b/dashboard-ui/components/apphost.js index 71e6ce89f3..ad5f139db3 100644 --- a/dashboard-ui/components/apphost.js +++ b/dashboard-ui/components/apphost.js @@ -1 +1 @@ -define(["appStorage","browser"],function(appStorage,browser){"use strict";function getBaseProfileOptions(item){var disableHlsVideoAudioCodecs=[];return item&&(!browser.edge&&canPlayNativeHls()||(disableHlsVideoAudioCodecs.push("mp3"),disableHlsVideoAudioCodecs.push("ac3"))),{enableMkvProgressive:!1,disableHlsVideoAudioCodecs:disableHlsVideoAudioCodecs}}function canPlayNativeHls(){var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function getDeviceProfileForWindowsUwp(item){return new Promise(function(resolve,reject){require(["browserdeviceprofile","environments/windows-uwp/mediacaps"],function(profileBuilder,uwpMediaCaps){var profileOptions=getBaseProfileOptions(item);profileOptions.supportsDts=uwpMediaCaps.supportsDTS(),profileOptions.supportsTrueHd=uwpMediaCaps.supportsDolby(),profileOptions.audioChannels=uwpMediaCaps.getAudioChannels(),resolve(profileBuilder(profileOptions))})})}function getDeviceProfile(item,options){return options=options||{},self.Windows?getDeviceProfileForWindowsUwp(item):new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){var profile=profileBuilder(getBaseProfileOptions(item));item&&!options.isRetry&&(browser.edge||browser.msie||browser.orsay||browser.tizen||(profile.SubtitleProfiles.push({Format:"ass",Method:"External"}),profile.SubtitleProfiles.push({Format:"ssa",Method:"External"}))),resolve(profile)})})}function getCapabilities(){return getDeviceProfile().then(function(profile){var supportsPersistentIdentifier=!!browser.edgeUwp,caps={PlayableMediaTypes:["Audio","Video"],SupportsPersistentIdentifier:supportsPersistentIdentifier,DeviceProfile:profile};return caps})}function generateDeviceId(){return new Promise(function(resolve,reject){require(["cryptojs-sha1"],function(){var keys=[];keys.push(navigator.userAgent),keys.push((new Date).getTime()),resolve(CryptoJS.SHA1(keys.join("|")).toString())})})}function getDeviceId(){var key="_deviceId2",deviceId=appStorage.getItem(key);return deviceId?Promise.resolve(deviceId):generateDeviceId().then(function(deviceId){return appStorage.setItem(key,deviceId),deviceId})}function getDeviceName(){var deviceName;return deviceName=browser.tizen?"Samsung Smart TV":browser.web0S?"LG Smart TV":browser.operaTv?"Opera TV":browser.xboxOne?"Xbox One":browser.ps4?"Sony PS4":browser.chrome?"Chrome":browser.edge?"Edge":browser.firefox?"Firefox":browser.msie?"Internet Explorer":"Web Browser",browser.ipad?deviceName+=" Ipad":browser.iphone?deviceName+=" Iphone":browser.android&&(deviceName+=" Android"),deviceName}function supportsVoiceInput(){return!browser.tv&&(window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.oSpeechRecognition||window.msSpeechRecognition)}function supportsFullscreen(){if(browser.tv)return!1;var element=document.documentElement;return!!(element.requestFullscreen||element.mozRequestFullScreen||element.webkitRequestFullscreen||element.msRequestFullscreen)||!!document.createElement("video").webkitEnterFullscreen}function getSyncProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile","appSettings"],function(profileBuilder,appSettings){var profile=profileBuilder();profile.MaxStaticMusicBitrate=appSettings.maxStaticMusicBitrate(),resolve(profile)})})}function getDefaultLayout(){return"desktop"}function supportsHtmlMediaAutoplay(){if(browser.edgeUwp||browser.tv||browser.ps4||browser.xboxOne)return!0;if(browser.mobile)return!1;var savedResult=appStorage.getItem(htmlMediaAutoplayAppStorageKey);return"true"===savedResult||"false"!==savedResult&&null}var htmlMediaAutoplayAppStorageKey="supportshtmlmediaautoplay0",supportedFeatures=function(){var features=["sharing","externalpremium"];return browser.edgeUwp||browser.tv||browser.xboxOne||browser.ps4||features.push("filedownload"),browser.operaTv||browser.tizen||browser.web0s?features.push("exit"):features.push("exitmenu"),browser.operaTv||features.push("externallinks"),supportsVoiceInput()&&features.push("voiceinput"),supportsHtmlMediaAutoplay()&&(features.push("htmlaudioautoplay"),features.push("htmlvideoautoplay")),window.SyncRegistered,supportsFullscreen()&&features.push("fullscreenchange"),(browser.chrome||browser.edge&&!browser.slow)&&(browser.noAnimation||browser.edgeUwp||browser.xboxOne||features.push("imageanalysis")),Dashboard.isConnectMode()&&features.push("multiserver"),(browser.tv||browser.xboxOne||browser.ps4||browser.mobile)&&features.push("physicalvolumecontrol"),browser.tv||browser.xboxOne||browser.ps4||features.push("remotecontrol"),browser.operaTv||browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp||features.push("remotemedia"),features.push("otherapppromotions"),features}();supportedFeatures.indexOf("htmlvideoautoplay")===-1&&supportsHtmlMediaAutoplay()!==!1&&require(["autoPlayDetect"],function(autoPlayDetect){autoPlayDetect.supportsHtmlMediaAutoplay().then(function(){appStorage.setItem(htmlMediaAutoplayAppStorageKey,"true"),supportedFeatures.push("htmlvideoautoplay"),supportedFeatures.push("htmlaudioautoplay")},function(){appStorage.setItem(htmlMediaAutoplayAppStorageKey,"false")})});var appInfo,version=window.dashboardVersion||"3.0";return{getWindowState:function(){return document.windowState||"Normal"},setWindowState:function(state){alert("setWindowState is not supported and should not be called")},exit:function(){if(browser.tizen)try{tizen.application.getCurrentApplication().exit()}catch(err){console.log("error closing application: "+err)}else window.close()},supports:function(command){return supportedFeatures.indexOf(command.toLowerCase())!=-1},appInfo:function(){return appInfo?Promise.resolve(appInfo):getDeviceId().then(function(deviceId){return appInfo={deviceId:deviceId,deviceName:getDeviceName(),appName:"Emby Mobile",appVersion:version}})},getCapabilities:getCapabilities,preferVisualCards:browser.android||browser.chrome,moreIcon:browser.safari||browser.edge?"dots-horiz":"dots-vert",getSyncProfile:getSyncProfile,getDefaultLayout:getDefaultLayout,getDeviceProfile:getDeviceProfile}}); \ No newline at end of file +define(["appStorage","browser"],function(appStorage,browser){"use strict";function getBaseProfileOptions(item){var disableHlsVideoAudioCodecs=[];return item&&(!browser.edge&&canPlayNativeHls()||(disableHlsVideoAudioCodecs.push("mp3"),disableHlsVideoAudioCodecs.push("ac3"))),{enableMkvProgressive:!1,disableHlsVideoAudioCodecs:disableHlsVideoAudioCodecs}}function canPlayNativeHls(){var media=document.createElement("video");return!(!media.canPlayType("application/x-mpegURL").replace(/no/,"")&&!media.canPlayType("application/vnd.apple.mpegURL").replace(/no/,""))}function getDeviceProfileForWindowsUwp(item){return new Promise(function(resolve,reject){require(["browserdeviceprofile","environments/windows-uwp/mediacaps"],function(profileBuilder,uwpMediaCaps){var profileOptions=getBaseProfileOptions(item);profileOptions.supportsDts=uwpMediaCaps.supportsDTS(),profileOptions.supportsTrueHd=uwpMediaCaps.supportsDolby(),profileOptions.audioChannels=uwpMediaCaps.getAudioChannels(),resolve(profileBuilder(profileOptions))})})}function getDeviceProfile(item,options){return options=options||{},self.Windows?getDeviceProfileForWindowsUwp(item):new Promise(function(resolve,reject){require(["browserdeviceprofile"],function(profileBuilder){var profile=profileBuilder(getBaseProfileOptions(item));item&&!options.isRetry&&(browser.edge||browser.msie||browser.orsay||browser.tizen||(profile.SubtitleProfiles.push({Format:"ass",Method:"External"}),profile.SubtitleProfiles.push({Format:"ssa",Method:"External"}))),resolve(profile)})})}function getCapabilities(){return getDeviceProfile().then(function(profile){var supportsPersistentIdentifier=!!browser.edgeUwp,caps={PlayableMediaTypes:["Audio","Video"],SupportsPersistentIdentifier:supportsPersistentIdentifier,DeviceProfile:profile};return caps})}function generateDeviceId(){return new Promise(function(resolve,reject){require(["cryptojs-sha1"],function(){var keys=[];keys.push(navigator.userAgent),keys.push((new Date).getTime()),resolve(CryptoJS.SHA1(keys.join("|")).toString())})})}function getDeviceId(){var key="_deviceId2",deviceId=appStorage.getItem(key);return deviceId?Promise.resolve(deviceId):generateDeviceId().then(function(deviceId){return appStorage.setItem(key,deviceId),deviceId})}function getDeviceName(){var deviceName;return deviceName=browser.tizen?"Samsung Smart TV":browser.web0S?"LG Smart TV":browser.operaTv?"Opera TV":browser.xboxOne?"Xbox One":browser.ps4?"Sony PS4":browser.chrome?"Chrome":browser.edge?"Edge":browser.firefox?"Firefox":browser.msie?"Internet Explorer":"Web Browser",browser.ipad?deviceName+=" Ipad":browser.iphone?deviceName+=" Iphone":browser.android&&(deviceName+=" Android"),deviceName}function supportsVoiceInput(){return!browser.tv&&(window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.oSpeechRecognition||window.msSpeechRecognition)}function supportsFullscreen(){if(browser.tv)return!1;var element=document.documentElement;return!!(element.requestFullscreen||element.mozRequestFullScreen||element.webkitRequestFullscreen||element.msRequestFullscreen)||!!document.createElement("video").webkitEnterFullscreen}function getSyncProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile","appSettings"],function(profileBuilder,appSettings){var profile=profileBuilder();profile.MaxStaticMusicBitrate=appSettings.maxStaticMusicBitrate(),resolve(profile)})})}function getDefaultLayout(){return"desktop"}function supportsHtmlMediaAutoplay(){if(browser.edgeUwp||browser.tv||browser.ps4||browser.xboxOne)return!0;if(browser.mobile)return!1;var savedResult=appStorage.getItem(htmlMediaAutoplayAppStorageKey);return"true"===savedResult||"false"!==savedResult&&null}var htmlMediaAutoplayAppStorageKey="supportshtmlmediaautoplay0",supportedFeatures=function(){var features=["sharing","externalpremium"];return browser.edgeUwp||browser.tv||browser.xboxOne||browser.ps4||features.push("filedownload"),browser.operaTv||browser.tizen||browser.web0s?features.push("exit"):features.push("exitmenu"),browser.operaTv||features.push("externallinks"),supportsVoiceInput()&&features.push("voiceinput"),supportsHtmlMediaAutoplay()&&(features.push("htmlaudioautoplay"),features.push("htmlvideoautoplay")),window.SyncRegistered,supportsFullscreen()&&features.push("fullscreenchange"),(browser.chrome||browser.edge&&!browser.slow)&&(browser.noAnimation||browser.edgeUwp||browser.xboxOne||features.push("imageanalysis")),Dashboard.isConnectMode()&&features.push("multiserver"),(browser.tv||browser.xboxOne||browser.ps4||browser.mobile)&&features.push("physicalvolumecontrol"),browser.tv||browser.xboxOne||browser.ps4||features.push("remotecontrol"),browser.operaTv||browser.tizen||browser.orsay||browser.web0s||browser.edgeUwp||features.push("remotemedia"),features.push("otherapppromotions"),features.push("targetblank"),features}();supportedFeatures.indexOf("htmlvideoautoplay")===-1&&supportsHtmlMediaAutoplay()!==!1&&require(["autoPlayDetect"],function(autoPlayDetect){autoPlayDetect.supportsHtmlMediaAutoplay().then(function(){appStorage.setItem(htmlMediaAutoplayAppStorageKey,"true"),supportedFeatures.push("htmlvideoautoplay"),supportedFeatures.push("htmlaudioautoplay")},function(){appStorage.setItem(htmlMediaAutoplayAppStorageKey,"false")})});var appInfo,version=window.dashboardVersion||"3.0";return{getWindowState:function(){return document.windowState||"Normal"},setWindowState:function(state){alert("setWindowState is not supported and should not be called")},exit:function(){if(browser.tizen)try{tizen.application.getCurrentApplication().exit()}catch(err){console.log("error closing application: "+err)}else window.close()},supports:function(command){return supportedFeatures.indexOf(command.toLowerCase())!=-1},appInfo:function(){return appInfo?Promise.resolve(appInfo):getDeviceId().then(function(deviceId){return appInfo={deviceId:deviceId,deviceName:getDeviceName(),appName:"Emby Mobile",appVersion:version}})},getCapabilities:getCapabilities,preferVisualCards:browser.android||browser.chrome,moreIcon:browser.safari||browser.edge?"dots-horiz":"dots-vert",getSyncProfile:getSyncProfile,getDefaultLayout:getDefaultLayout,getDeviceProfile:getDeviceProfile}}); \ No newline at end of file diff --git a/dashboard-ui/components/directorybrowser/directorybrowser.js b/dashboard-ui/components/directorybrowser/directorybrowser.js index 67adf20a97..06f395e4ad 100644 --- a/dashboard-ui/components/directorybrowser/directorybrowser.js +++ b/dashboard-ui/components/directorybrowser/directorybrowser.js @@ -1 +1 @@ -define(["loading","dialogHelper","dom","listViewStyle","emby-input","emby-button","paper-icon-button-light","css!./directorybrowser","formDialogStyle"],function(loading,dialogHelper,dom){"use strict";function getSystemInfo(){return systemInfo?Promise.resolve(systemInfo):ApiClient.getPublicSystemInfo().then(function(info){return systemInfo=info,info})}function onDialogClosed(){loading.hide()}function refreshDirectoryBrowser(page,path,fileOptions,updatePathOnError){if(path&&"string"!=typeof path)throw new Error("invalid path");loading.show();var promises=[];"Network"===path?promises.push(ApiClient.getNetworkDevices()):path?(promises.push(ApiClient.getDirectoryContents(path,fileOptions)),promises.push(ApiClient.getParentPath(path))):promises.push(ApiClient.getDrives()),Promise.all(promises).then(function(responses){var folders=responses[0],parentPath=responses[1]||"";page.querySelector("#txtDirectoryPickerPath").value=path||"";var html="";path&&(html+=getItem("lnkPath lnkDirectory","",parentPath,"..."));for(var i=0,length=folders.length;i',html+='
    ',html+='
    ',html+=name,html+="
    ",html+="
    ",html+='arrow_forward',html+=""}function getEditorHtml(options,systemInfo){var html="";if(html+='
    ',html+='
    ',!options.pathReadOnly){var instruction=options.instruction?options.instruction+"

    ":"";html+='
    ',html+=instruction,html+=Globalize.translate("MessageDirectoryPickerInstruction").replace("{0}","\\\\server").replace("{1}","\\\\192.168.1.101"),"bsd"==systemInfo.OperatingSystem.toLowerCase()?(html+="
    ",html+="
    ",html+=Globalize.translate("MessageDirectoryPickerBSDInstruction"),html+="
    ",html+=''+Globalize.translate("ButtonMoreInformation")+""):"linux"==systemInfo.OperatingSystem.toLowerCase()&&(html+="
    ",html+="
    ",html+=Globalize.translate("MessageDirectoryPickerLinuxInstruction"),html+="
    "),html+="
    "}html+='',html+='
    ',html+='
    ';var labelKey=options.includeFiles!==!0?"LabelFolder":"LabelPath",readOnlyAttribute=options.pathReadOnly?" readonly":"";return html+='',html+="
    ",readOnlyAttribute||(html+=''),html+="
    ",readOnlyAttribute||(html+='
    '),options.enableNetworkSharePath&&(html+='
    ',html+='',html+='
    ',html+=Globalize.translate("LabelOptionalNetworkPathHelp"),html+="
    ",html+="
    "),html+='
    ',html+='",html+="
    ",html+="",html+="
    ",html+="
    ",html+=""}function initEditor(content,options,fileOptions){content.addEventListener("click",function(e){var lnkPath=dom.parentWithClass(e.target,"lnkPath");if(lnkPath){var path=lnkPath.getAttribute("data-path");lnkPath.classList.contains("lnkFile")?content.querySelector("#txtDirectoryPickerPath").value=path:refreshDirectoryBrowser(content,path,fileOptions,!0)}}),content.addEventListener("click",function(e){var btnRefreshDirectories=dom.parentWithClass(e.target,"btnRefreshDirectories");if(btnRefreshDirectories){var path=content.querySelector("#txtDirectoryPickerPath").value;refreshDirectoryBrowser(content,path,fileOptions)}}),content.addEventListener("change",function(e){var txtDirectoryPickerPath=dom.parentWithTag(e.target,"INPUT");txtDirectoryPickerPath&&"txtDirectoryPickerPath"==txtDirectoryPickerPath.id&&refreshDirectoryBrowser(content,txtDirectoryPickerPath.value,fileOptions)}),content.querySelector("form").addEventListener("submit",function(e){if(options.callback){var networkSharePath=this.querySelector("#txtNetworkPath");networkSharePath=networkSharePath?networkSharePath.value:null,options.callback(this.querySelector("#txtDirectoryPickerPath").value,networkSharePath)}return e.preventDefault(),e.stopPropagation(),!1})}function getDefaultPath(options){return options.path?Promise.resolve(options.path):ApiClient.getJSON(ApiClient.getUrl("Environment/DefaultDirectoryBrowser")).then(function(result){return result.Path||""},function(){return""})}function directoryBrowser(){var currentDialog,self=this;self.show=function(options){options=options||{};var fileOptions={includeDirectories:!0};null!=options.includeDirectories&&(fileOptions.includeDirectories=options.includeDirectories),null!=options.includeFiles&&(fileOptions.includeFiles=options.includeFiles),Promise.all([getSystemInfo(),getDefaultPath(options)]).then(function(responses){var systemInfo=responses[0],initialPath=responses[1],dlg=dialogHelper.createDialog({size:"medium-tall",removeOnClose:!0,scrollY:!1});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("directoryPicker"),dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=options.header||Globalize.translate("HeaderSelectPath"),html+="

    ",html+="
    ",html+=getEditorHtml(options,systemInfo),dlg.innerHTML=html,initEditor(dlg,options,fileOptions),dlg.addEventListener("close",onDialogClosed),dialogHelper.open(dlg),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),currentDialog=dlg;var txtCurrentPath=dlg.querySelector("#txtDirectoryPickerPath");txtCurrentPath.value=initialPath;var txtNetworkPath=dlg.querySelector("#txtNetworkPath");txtNetworkPath&&(txtNetworkPath.value=options.networkSharePath||""),options.pathReadOnly||refreshDirectoryBrowser(dlg,txtCurrentPath.value,null,!0)})},self.close=function(){currentDialog&&dialogHelper.close(currentDialog)}}var systemInfo;return directoryBrowser}); \ No newline at end of file +define(["loading","dialogHelper","dom","listViewStyle","emby-input","emby-button","paper-icon-button-light","css!./directorybrowser","formDialogStyle","emby-linkbutton"],function(loading,dialogHelper,dom){"use strict";function getSystemInfo(){return systemInfo?Promise.resolve(systemInfo):ApiClient.getPublicSystemInfo().then(function(info){return systemInfo=info,info})}function onDialogClosed(){loading.hide()}function refreshDirectoryBrowser(page,path,fileOptions,updatePathOnError){if(path&&"string"!=typeof path)throw new Error("invalid path");loading.show();var promises=[];"Network"===path?promises.push(ApiClient.getNetworkDevices()):path?(promises.push(ApiClient.getDirectoryContents(path,fileOptions)),promises.push(ApiClient.getParentPath(path))):promises.push(ApiClient.getDrives()),Promise.all(promises).then(function(responses){var folders=responses[0],parentPath=responses[1]||"";page.querySelector("#txtDirectoryPickerPath").value=path||"";var html="";path&&(html+=getItem("lnkPath lnkDirectory","",parentPath,"..."));for(var i=0,length=folders.length;i',html+='
    ',html+='
    ',html+=name,html+="
    ",html+="
    ",html+='arrow_forward',html+=""}function getEditorHtml(options,systemInfo){var html="";if(html+='
    ',html+='
    ',!options.pathReadOnly){var instruction=options.instruction?options.instruction+"

    ":"";html+='
    ',html+=instruction,html+=Globalize.translate("MessageDirectoryPickerInstruction").replace("{0}","\\\\server").replace("{1}","\\\\192.168.1.101"),"bsd"==systemInfo.OperatingSystem.toLowerCase()?(html+="
    ",html+="
    ",html+=Globalize.translate("MessageDirectoryPickerBSDInstruction"),html+="
    ",html+=''+Globalize.translate("ButtonMoreInformation")+""):"linux"==systemInfo.OperatingSystem.toLowerCase()&&(html+="
    ",html+="
    ",html+=Globalize.translate("MessageDirectoryPickerLinuxInstruction"),html+="
    "),html+="
    "}html+='
    ',html+='
    ',html+='
    ';var labelKey=options.includeFiles!==!0?"LabelFolder":"LabelPath",readOnlyAttribute=options.pathReadOnly?" readonly":"";return html+='',html+="
    ",readOnlyAttribute||(html+=''),html+="
    ",readOnlyAttribute||(html+='
    '),options.enableNetworkSharePath&&(html+='
    ',html+='',html+='
    ',html+=Globalize.translate("LabelOptionalNetworkPathHelp"),html+="
    ",html+="
    "),html+='
    ',html+='",html+="
    ",html+="
    ",html+="
    ",html+="
    ",html+=""}function initEditor(content,options,fileOptions){content.addEventListener("click",function(e){var lnkPath=dom.parentWithClass(e.target,"lnkPath");if(lnkPath){var path=lnkPath.getAttribute("data-path");lnkPath.classList.contains("lnkFile")?content.querySelector("#txtDirectoryPickerPath").value=path:refreshDirectoryBrowser(content,path,fileOptions,!0)}}),content.addEventListener("click",function(e){var btnRefreshDirectories=dom.parentWithClass(e.target,"btnRefreshDirectories");if(btnRefreshDirectories){var path=content.querySelector("#txtDirectoryPickerPath").value;refreshDirectoryBrowser(content,path,fileOptions)}}),content.addEventListener("change",function(e){var txtDirectoryPickerPath=dom.parentWithTag(e.target,"INPUT");txtDirectoryPickerPath&&"txtDirectoryPickerPath"==txtDirectoryPickerPath.id&&refreshDirectoryBrowser(content,txtDirectoryPickerPath.value,fileOptions)}),content.querySelector("form").addEventListener("submit",function(e){if(options.callback){var networkSharePath=this.querySelector("#txtNetworkPath");networkSharePath=networkSharePath?networkSharePath.value:null,options.callback(this.querySelector("#txtDirectoryPickerPath").value,networkSharePath)}return e.preventDefault(),e.stopPropagation(),!1})}function getDefaultPath(options){return options.path?Promise.resolve(options.path):ApiClient.getJSON(ApiClient.getUrl("Environment/DefaultDirectoryBrowser")).then(function(result){return result.Path||""},function(){return""})}function directoryBrowser(){var currentDialog,self=this;self.show=function(options){options=options||{};var fileOptions={includeDirectories:!0};null!=options.includeDirectories&&(fileOptions.includeDirectories=options.includeDirectories),null!=options.includeFiles&&(fileOptions.includeFiles=options.includeFiles),Promise.all([getSystemInfo(),getDefaultPath(options)]).then(function(responses){var systemInfo=responses[0],initialPath=responses[1],dlg=dialogHelper.createDialog({size:"medium-tall",removeOnClose:!0,scrollY:!1});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("directoryPicker"),dlg.classList.add("formDialog");var html="";html+='
    ',html+='',html+='

    ',html+=options.header||Globalize.translate("HeaderSelectPath"),html+="

    ",html+="
    ",html+=getEditorHtml(options,systemInfo),dlg.innerHTML=html,initEditor(dlg,options,fileOptions),dlg.addEventListener("close",onDialogClosed),dialogHelper.open(dlg),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),currentDialog=dlg;var txtCurrentPath=dlg.querySelector("#txtDirectoryPickerPath");txtCurrentPath.value=initialPath;var txtNetworkPath=dlg.querySelector("#txtNetworkPath");txtNetworkPath&&(txtNetworkPath.value=options.networkSharePath||""),options.pathReadOnly||refreshDirectoryBrowser(dlg,txtCurrentPath.value,null,!0)})},self.close=function(){currentDialog&&dialogHelper.close(currentDialog)}}var systemInfo;return directoryBrowser}); \ No newline at end of file diff --git a/dashboard-ui/components/dockedtabs/dockedtabs.js b/dashboard-ui/components/dockedtabs/dockedtabs.js index 3a0eeb805d..1881d54685 100644 --- a/dashboard-ui/components/dockedtabs/dockedtabs.js +++ b/dashboard-ui/components/dockedtabs/dockedtabs.js @@ -1 +1 @@ -define(["apphost","connectionManager","events","globalize","browser","require","dom","embyRouter","emby-tabs"],function(appHost,connectionManager,events,globalize,browser,require,dom,embyRouter){"use strict";function showUserView(id){var view=currentUserViews.filter(function(current){return current.Id==id})[0];view&&embyRouter.showItem(view)}function executeCommand(id){switch(id){case"settings":embyRouter.showSettings();break;case"signout":Dashboard.logout();break;case"selectserver":embyRouter.showSelectServer();break;case"reports":Dashboard.navigate("reports.html");break;case"metadatamanager":Dashboard.navigate("edititemmetadata.html");break;case"manageserver":Dashboard.navigate("dashboard.html");break;case"remotecontrol":Dashboard.navigate("nowplaying.html");break;case"sync":Dashboard.navigate("mysync.html");break;case"nowplaying":Dashboard.navigate("nowplaying.html");break;default:showUserView(id)}}function showMenu(menuItems,button,tabIndex){var actionSheetType=browser.safari?"actionsheet":"webActionSheet";require([actionSheetType],function(actionSheet){actionSheet.show({items:menuItems,positionTo:button,entryAnimation:"slideup",exitAnimation:"fadeout",entryAnimationDuration:160,exitAnimationDuration:100,offsetTop:-35,positionY:"top",dialogClass:"dockedtabs-dlg",menuItemClass:"dockedtabs-dlg-menuitem"}).then(function(id){if(executeCommand(id),id){var tabs=dom.parentWithClass(button,"dockedtabs-tabs");tabs.selectedIndex(tabIndex,!1)}})})}function showLibrariesMenu(button){var commands=currentUserViews.map(function(view){return{name:view.Name,id:view.Id}});showMenu(commands,button,1)}function showMoreMenu(button){var commands=[];currentUser.Policy.IsAdministrator&&(commands.push({name:globalize.translate("ButtonManageServer"),id:"manageserver"}),dom.getWindowSize().innerWidth>=1e3&&commands.push({name:globalize.translate("MetadataManager"),id:"metadatamanager"}),commands.push({name:globalize.translate("ButtonReports"),id:"reports"})),appHost.supports("multiserver")&&commands.push({name:globalize.translate("HeaderSelectServer"),id:"selectserver"}),commands.push({name:globalize.translate("TabSettings"),id:"settings"}),currentUser.Policy.EnableSync&&commands.push({name:globalize.translate("SyncToOtherDevices"),id:"sync"}),commands.push({name:globalize.translate("ButtonSignOut"),id:"signout"}),showMenu(commands,button,5)}function onTabClick(e){var index=parseInt(this.getAttribute("data-index"));switch(index){case 0:embyRouter.goHome();break;case 1:showLibrariesMenu(this),e.preventDefault(),e.stopPropagation();break;case 2:embyRouter.showLiveTV();break;case 3:Dashboard.navigate("mysync.html?mode=offline");break;case 4:Dashboard.navigate("nowplaying.html");break;case 5:showMoreMenu(this),e.preventDefault(),e.stopPropagation()}}function addNoFlexClass(buttons){setTimeout(function(){for(var i=0,length=buttons.length;i ",appHost.supports("sync")&&(html+=' "),html+=' ",html+=' ",elem.innerHTML=html;for(var buttons=elem.querySelectorAll(".emby-tab-button"),i=0,length=buttons.length;i0;hasLiveTv?element.querySelector(".docked-tab-livetv").classList.remove("hide"):element.querySelector(".docked-tab-livetv").classList.add("hide");var downloadsTab=element.querySelector(".docked-tab-syncdownloads");downloadsTab&&(user.Policy.EnableSync?downloadsTab.classList.remove("hide"):downloadsTab.classList.add("hide"))}function showUserTabs(user,element){currentUser=user;var apiClient=ConnectionManager.getApiClient(user.ServerId);apiClient.getUserViews({},user.Id).then(function(result){currentUserViews=result.Items,onUserViewResponse(user,result.Items,element)},function(){currentUserViews=[],onUserViewResponse(user,[],element)})}function showCurrentUserTabs(element){Dashboard.getCurrentUserId()&&Dashboard.getCurrentUser().then(function(user){showUserTabs(user,element)})}function onViewShow(e){e.detail.properties.indexOf("fullscreen")===-1&&Dashboard.getCurrentUserId()?instance.show():instance.hide()}function dockedTabs(options){var self=this;instance=self,self.element=render(options),events.on(connectionManager,"localusersignedin",function(e,user){self.show(),showUserTabs(user,self.element)}),events.on(connectionManager,"localusersignedout",function(){self.hide()}),showCurrentUserTabs(self.element),document.addEventListener("viewshow",onViewShow)}require(["css!./dockedtabs"]);var instance,currentUser={},currentUserViews=[];return dockedTabs.prototype.destroy=function(){document.removeEventListener("viewshow",onViewShow),instance=null;var self=this;self.element;self.element=null},dockedTabs.prototype.show=function(){this.element.classList.remove("hide")},dockedTabs.prototype.hide=function(){this.element.classList.add("hide")},dockedTabs}); \ No newline at end of file +define(["apphost","connectionManager","events","globalize","browser","require","dom","embyRouter","emby-tabs"],function(appHost,connectionManager,events,globalize,browser,require,dom,embyRouter){"use strict";function showUserView(id){var view=currentUserViews.filter(function(current){return current.Id==id})[0];view&&embyRouter.showItem(view)}function executeCommand(id){switch(id){case"settings":embyRouter.showSettings();break;case"signout":Dashboard.logout();break;case"selectserver":embyRouter.showSelectServer();break;case"reports":Dashboard.navigate("reports.html");break;case"metadatamanager":Dashboard.navigate("edititemmetadata.html");break;case"manageserver":Dashboard.navigate("dashboard.html");break;case"remotecontrol":Dashboard.navigate("nowplaying.html");break;case"sync":Dashboard.navigate("mysync.html");break;case"nowplaying":Dashboard.navigate("nowplaying.html");break;default:showUserView(id)}}function showMenu(menuItems,button,tabIndex){var actionSheetType=browser.safari?"actionsheet":"webActionSheet";require([actionSheetType],function(actionSheet){actionSheet.show({items:menuItems,positionTo:button,entryAnimation:"slideup",exitAnimation:"fadeout",entryAnimationDuration:160,exitAnimationDuration:100,offsetTop:-35,positionY:"top",dialogClass:"dockedtabs-dlg",menuItemClass:"dockedtabs-dlg-menuitem"}).then(function(id){if(executeCommand(id),id){var tabs=dom.parentWithClass(button,"dockedtabs-tabs");tabs.selectedIndex(tabIndex,!1)}})})}function showLibrariesMenu(button){var commands=currentUserViews.map(function(view){return{name:view.Name,id:view.Id}});showMenu(commands,button,1)}function showMoreMenu(button){var commands=[];currentUser.Policy.IsAdministrator&&(commands.push({name:globalize.translate("ButtonManageServer"),id:"manageserver"}),dom.getWindowSize().innerWidth>=1e3&&commands.push({name:globalize.translate("MetadataManager"),id:"metadatamanager"}),commands.push({name:globalize.translate("ButtonReports"),id:"reports"})),appHost.supports("multiserver")&&commands.push({name:globalize.translate("HeaderSelectServer"),id:"selectserver"}),commands.push({name:globalize.translate("TabSettings"),id:"settings"}),currentUser.Policy.EnableContentDownloading&&commands.push({name:globalize.translate("SyncToOtherDevices"),id:"sync"}),commands.push({name:globalize.translate("ButtonSignOut"),id:"signout"}),showMenu(commands,button,5)}function onTabClick(e){var index=parseInt(this.getAttribute("data-index"));switch(index){case 0:embyRouter.goHome();break;case 1:showLibrariesMenu(this),e.preventDefault(),e.stopPropagation();break;case 2:embyRouter.showLiveTV();break;case 3:Dashboard.navigate("mysync.html?mode=offline");break;case 4:Dashboard.navigate("nowplaying.html");break;case 5:showMoreMenu(this),e.preventDefault(),e.stopPropagation()}}function addNoFlexClass(buttons){setTimeout(function(){for(var i=0,length=buttons.length;i ",appHost.supports("sync")&&(html+=' "),html+=' ",html+=' ",elem.innerHTML=html;for(var buttons=elem.querySelectorAll(".emby-tab-button"),i=0,length=buttons.length;i0;hasLiveTv?element.querySelector(".docked-tab-livetv").classList.remove("hide"):element.querySelector(".docked-tab-livetv").classList.add("hide");var downloadsTab=element.querySelector(".docked-tab-syncdownloads");downloadsTab&&(user.Policy.EnableContentDownloading?downloadsTab.classList.remove("hide"):downloadsTab.classList.add("hide"))}function showUserTabs(user,element){currentUser=user;var apiClient=ConnectionManager.getApiClient(user.ServerId);apiClient.getUserViews({},user.Id).then(function(result){currentUserViews=result.Items,onUserViewResponse(user,result.Items,element)},function(){currentUserViews=[],onUserViewResponse(user,[],element)})}function onViewShow(e){e.detail.properties.indexOf("fullscreen")===-1&&Dashboard.getCurrentUserId()?instance.show():instance.hide()}function dockedTabs(options){var self=this;instance=self,self.element=render(options),events.on(connectionManager,"localusersignedin",function(e,user){self.show(),showUserTabs(user,self.element)}),events.on(connectionManager,"localusersignedout",function(){self.hide()}),document.addEventListener("viewshow",onViewShow)}require(["css!./dockedtabs"]);var instance,currentUser={Policy:{}},currentUserViews=[];return dockedTabs.prototype.destroy=function(){document.removeEventListener("viewshow",onViewShow),instance=null;var self=this;self.element;self.element=null},dockedTabs.prototype.show=function(){this.element.classList.remove("hide")},dockedTabs.prototype.hide=function(){this.element.classList.add("hide")},dockedTabs}); \ No newline at end of file diff --git a/dashboard-ui/components/favoriteitems.js b/dashboard-ui/components/favoriteitems.js index e3fa3ab1a8..a4b169cb2a 100644 --- a/dashboard-ui/components/favoriteitems.js +++ b/dashboard-ui/components/favoriteitems.js @@ -1 +1 @@ -define(["loading","libraryBrowser","cardBuilder","dom","apphost","imageLoader","globalize","layoutManager","scrollStyles","emby-itemscontainer"],function(loading,libraryBrowser,cardBuilder,dom,appHost,imageLoader,globalize,layoutManager){"use strict";function enableScrollX(){return!layoutManager.desktop}function getThumbShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function getPosterShape(){return enableScrollX()?"overflowPortrait":"portrait"}function getSquareShape(){return enableScrollX()?"overflowSquare":"square"}function getSections(){return[{name:"HeaderFavoriteMovies",types:"Movie",id:"favoriteMovies",shape:getPosterShape(),showTitle:!1,overlayPlayButton:!0},{name:"HeaderFavoriteShows",types:"Series",id:"favoriteShows",shape:getPosterShape(),showTitle:!1,overlayPlayButton:!0},{name:"HeaderFavoriteEpisodes",types:"Episode",id:"favoriteEpisode",shape:getThumbShape(),preferThumb:!1,showTitle:!0,showParentTitle:!0,overlayPlayButton:!0,overlayText:!1,centerText:!0},{name:"HeaderFavoriteVideos",types:"Video,MusicVideo",id:"favoriteVideos",shape:getThumbShape(),preferThumb:!0,showTitle:!0,overlayPlayButton:!0,overlayText:!1,centerText:!0},{name:"HeaderFavoriteGames",types:"Game",id:"favoriteGames",shape:getSquareShape(),preferThumb:!1,showTitle:!0},{name:"HeaderFavoriteArtists",types:"MusicArtist",id:"favoriteArtists",shape:getSquareShape(),preferThumb:!1,showTitle:!0,overlayText:!1,showParentTitle:!1,centerText:!0,overlayPlayButton:!0},{name:"HeaderFavoriteAlbums",types:"MusicAlbum",id:"favoriteAlbums",shape:getSquareShape(),preferThumb:!1,showTitle:!0,overlayText:!1,showParentTitle:!0,centerText:!0,overlayPlayButton:!0},{name:"HeaderFavoriteSongs",types:"Audio",id:"favoriteSongs",shape:getSquareShape(),preferThumb:!1,showTitle:!0,overlayText:!1,showParentTitle:!0,centerText:!0,overlayMoreButton:!0,action:"instantmix"}]}function loadSection(elem,userId,topParentId,section,isSingleSection){var screenWidth=dom.getWindowSize().innerWidth,options={SortBy:"SortName",SortOrder:"Ascending",Filters:"IsFavorite",Recursive:!0,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",CollapseBoxSetItems:!1,ExcludeLocationTypes:"Virtual",EnableTotalRecordCount:!1};topParentId&&(options.ParentId=topParentId),isSingleSection||(options.Limit=screenWidth>=1920?10:screenWidth>=1440?8:6,enableScrollX()&&(options.Limit=20));var promise;return"MusicArtist"==section.types?promise=ApiClient.getArtists(userId,options):(options.IncludeItemTypes=section.types,promise=ApiClient.getItems(userId,options)),promise.then(function(result){var html="";if(result.Items.length){if(html+='
    ',html+='

    '+globalize.translate(section.name)+"

    ",!layoutManager.tv&&options.Limit&&result.Items.length>=options.Limit){var href="secondaryitems.html?type="+section.types+"&filters=IsFavorite";html+='"}html+="
    ",html+=enableScrollX()?'
    ':'
    ';var supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=(appHost.preferVisualCards||supportsImageAnalysis)&§ion.autoCardLayout&§ion.showTitle;cardLayout=!1,html+=cardBuilder.getCardsHtml(result.Items,{preferThumb:section.preferThumb,shape:section.shape,centerText:section.centerText&&!cardLayout,overlayText:section.overlayText!==!1,showTitle:section.showTitle,showParentTitle:section.showParentTitle,scalable:!0,overlayPlayButton:section.overlayPlayButton,overlayMoreButton:section.overlayMoreButton&&!cardLayout,action:section.action,allowBottomPadding:!enableScrollX(),cardLayout:cardLayout,vibrant:supportsImageAnalysis&&cardLayout}),html+="
    "}elem.innerHTML=html,imageLoader.lazyChildren(elem)})}function loadSections(page,userId,topParentId,types){loading.show();var sections=getSections(),sectionid=getParameterByName("sectionid");sectionid&&(sections=sections.filter(function(s){return s.id==sectionid})),types&&(sections=sections.filter(function(s){return types.indexOf(s.id)!=-1}));var i,length,elem=page.querySelector(".favoriteSections");if(!elem.innerHTML){var html="";for(i=0,length=sections.length;i
    ';elem.innerHTML=html}var promises=[];for(i=0,length=sections.length;i=1920?10:screenWidth>=1440?8:6,enableScrollX()&&(options.Limit=20));var promise;return"MusicArtist"==section.types?promise=ApiClient.getArtists(userId,options):(options.IncludeItemTypes=section.types,promise=ApiClient.getItems(userId,options)),promise.then(function(result){var html="";if(result.Items.length){if(html+='
    ',html+='

    '+globalize.translate(section.name)+"

    ",!layoutManager.tv&&options.Limit&&result.Items.length>=options.Limit){var href="secondaryitems.html?type="+section.types+"&filters=IsFavorite";html+='"}html+="
    ",html+=enableScrollX()?'
    ':'
    ';var supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=(appHost.preferVisualCards||supportsImageAnalysis)&§ion.autoCardLayout&§ion.showTitle;cardLayout=!1,html+=cardBuilder.getCardsHtml(result.Items,{preferThumb:section.preferThumb,shape:section.shape,centerText:section.centerText&&!cardLayout,overlayText:section.overlayText!==!1,showTitle:section.showTitle,showParentTitle:section.showParentTitle,scalable:!0,coverImage:section.coverImage,overlayPlayButton:section.overlayPlayButton,overlayMoreButton:section.overlayMoreButton&&!cardLayout,action:section.action,allowBottomPadding:!enableScrollX(),cardLayout:cardLayout,vibrant:supportsImageAnalysis&&cardLayout}),html+="
    "}elem.innerHTML=html,imageLoader.lazyChildren(elem)})}function loadSections(page,userId,topParentId,types){loading.show();var sections=getSections(),sectionid=getParameterByName("sectionid");sectionid&&(sections=sections.filter(function(s){return s.id==sectionid})),types&&(sections=sections.filter(function(s){return types.indexOf(s.id)!=-1}));var i,length,elem=page.querySelector(".favoriteSections");if(!elem.innerHTML){var html="";for(i=0,length=sections.length;i
    ';elem.innerHTML=html}var promises=[];for(i=0,length=sections.length;i
    ${LabelConnectUserNameHelp}
    diff --git a/dashboard-ui/components/guestinviter/guestinviter.js b/dashboard-ui/components/guestinviter/guestinviter.js index 491545fe2c..c01413f4cf 100644 --- a/dashboard-ui/components/guestinviter/guestinviter.js +++ b/dashboard-ui/components/guestinviter/guestinviter.js @@ -1 +1 @@ -define(["dialogHelper","jQuery","loading","emby-input","emby-button","emby-checkbox","paper-icon-button-light","formDialogStyle"],function(dialogHelper,$,loading){"use strict";function renderLibrarySharingList(context,result){var folderHtml="";folderHtml+=result.Items.map(function(i){var currentHtml="",isChecked=!0,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+='"}).join(""),context.querySelector(".librarySharingList").innerHTML=folderHtml}function inviteUser(dlg){loading.show();var shareExcludes=$(".chkShareFolder",dlg).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-folderid")});require(["connectHelper"],function(connectHelper){connectHelper.inviteGuest({apiClient:ApiClient,guestOptions:{ConnectUsername:dlg.querySelector("#txtConnectUsername").value,EnabledLibraries:shareExcludes.join(","),SendingUserId:Dashboard.getCurrentUserId(),EnableLiveTv:!1}}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg)})})}return{show:function(){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open("GET","components/guestinviter/guestinviter.template.html",!0),xhr.onload=function(e){var template=this.response,dlg=dialogHelper.createDialog({removeOnClose:!0,size:"small"});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+=Globalize.translateDocument(template),dlg.innerHTML=html,dialogHelper.open(dlg),dlg.addEventListener("close",function(){dlg.submitted?resolve():reject()}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector("form").addEventListener("submit",function(e){return inviteUser(dlg),e.preventDefault(),!1}),ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders",{IsHidden:!1})).then(function(result){renderLibrarySharingList(dlg,result)})},xhr.send()})}}}); \ No newline at end of file +define(["dialogHelper","jQuery","loading","emby-input","emby-button","emby-checkbox","paper-icon-button-light","formDialogStyle","emby-linkbutton"],function(dialogHelper,$,loading){"use strict";function renderLibrarySharingList(context,result){var folderHtml="";folderHtml+=result.Items.map(function(i){var currentHtml="",isChecked=!0,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+='"}).join(""),context.querySelector(".librarySharingList").innerHTML=folderHtml}function inviteUser(dlg){loading.show();var shareExcludes=$(".chkShareFolder",dlg).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-folderid")});require(["connectHelper"],function(connectHelper){connectHelper.inviteGuest({apiClient:ApiClient,guestOptions:{ConnectUsername:dlg.querySelector("#txtConnectUsername").value,EnabledLibraries:shareExcludes.join(","),SendingUserId:Dashboard.getCurrentUserId(),EnableLiveTv:!1}}).then(function(){loading.hide(),dlg.submitted=!0,dialogHelper.close(dlg)})})}return{show:function(){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open("GET","components/guestinviter/guestinviter.template.html",!0),xhr.onload=function(e){var template=this.response,dlg=dialogHelper.createDialog({removeOnClose:!0,size:"small"});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+=Globalize.translateDocument(template),dlg.innerHTML=html,dialogHelper.open(dlg),dlg.addEventListener("close",function(){dlg.submitted?resolve():reject()}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector("form").addEventListener("submit",function(e){return inviteUser(dlg),e.preventDefault(),!1}),ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders",{IsHidden:!1})).then(function(result){renderLibrarySharingList(dlg,result)})},xhr.send()})}}}); \ No newline at end of file diff --git a/dashboard-ui/components/guestinviter/guestinviter.template.html b/dashboard-ui/components/guestinviter/guestinviter.template.html index 22aa84380e..587b43c867 100644 --- a/dashboard-ui/components/guestinviter/guestinviter.template.html +++ b/dashboard-ui/components/guestinviter/guestinviter.template.html @@ -12,7 +12,7 @@ diff --git a/dashboard-ui/components/imagedownloader/imagedownloader.js b/dashboard-ui/components/imagedownloader/imagedownloader.js index c58c3ea2ca..eab821f79b 100644 --- a/dashboard-ui/components/imagedownloader/imagedownloader.js +++ b/dashboard-ui/components/imagedownloader/imagedownloader.js @@ -1 +1 @@ -define(["loading","dialogHelper","imageLoader","emby-checkbox","emby-button","paper-icon-button-light","css!css/metadataeditor.css"],function(loading,dialogHelper,imageLoader){"use strict";function getBaseRemoteOptions(){var options={};return options.itemId=currentItemId,options}function reloadBrowsableImages(page){loading.show();var options=getBaseRemoteOptions();options.type=browsableImageType,options.startIndex=browsableImageStartIndex,options.limit=browsableImagePageSize,options.IncludeAllLanguages=page.querySelector("#chkAllLanguages").checked;var provider=selectedProvider||"";provider&&(options.ProviderName=provider),ApiClient.getAvailableRemoteImages(options).then(function(result){renderRemoteImages(page,result,browsableImageType,options.startIndex,options.limit),page.querySelector("#selectBrowsableImageType").value=browsableImageType;var providersHtml=result.Providers.map(function(p){return'"}),selectImageProvider=page.querySelector("#selectImageProvider");selectImageProvider.innerHTML='"+providersHtml,selectImageProvider.value=provider,loading.hide()})}function renderRemoteImages(page,imagesResult,imageType,startIndex,limit){page.querySelector(".availableImagesPaging").innerHTML=getPagingHtml(startIndex,limit,imagesResult.TotalRecordCount);for(var html="",i=0,length=imagesResult.Images.length;ilimit;html+='
    ',html+='';var startAtDisplay=totalRecordCount?startIndex+1:0;return html+=startAtDisplay+"-"+recordsEnd+" of "+totalRecordCount,html+="",showControls&&(html+='
    ',html+='',html+='',html+="
    "),html+="
    "}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function downloadRemoteImage(page,url,type,provider){var options=getBaseRemoteOptions();options.Type=type,options.ImageUrl=url,options.ProviderName=provider,loading.show(),ApiClient.downloadRemoteImage(options).then(function(){hasChanges=!0;var dlg=parentWithClass(page,"dialog");dialogHelper.close(dlg)})}function getDisplayUrl(url){return ApiClient.getUrl("Images/Remote",{imageUrl:url})}function getRemoteImageHtml(image,imageType){var html="";html+='
    ';var cssClass="remoteImage lazy";cssClass+="Backdrop"==imageType||"Art"==imageType||"Thumb"==imageType||"Logo"==imageType?" remoteBackdropImage":"Banner"==imageType?" remoteBannerImage":"Disc"==imageType?" remoteDiscImage":"Episode"==currentItemType?" remoteBackdropImage":"MusicAlbum"==currentItemType||"MusicArtist"==currentItemType?" remoteDiscImage":" remotePosterImage";var displayUrl=getDisplayUrl(image.ThumbnailUrl||image.Url);return html+='',html+="",html+='
    ',html+='
    ',html+=image.ProviderName,html+="
    ",(image.Width||image.Height||image.Language)&&(html+='
    ',image.Width&&image.Height?(html+=image.Width+" x "+image.Height,image.Language&&(html+=" • "+image.Language)):image.Language&&(html+=image.Language),html+="
    "),null!=image.CommunityRating&&(html+='
    ',"Likes"==image.RatingType?html+=image.CommunityRating+(1==image.CommunityRating?" like":" likes"):image.CommunityRating?(html+=image.CommunityRating.toFixed(1),image.VoteCount&&(html+=" • "+image.VoteCount+(1==image.VoteCount?" vote":" votes"))):html+="Unrated",html+="
    "),html+='',html+="
    ",html+="
    "}function initEditor(page){page.querySelector("#selectBrowsableImageType").addEventListener("change",function(){browsableImageType=this.value,browsableImageStartIndex=0,selectedProvider=null,reloadBrowsableImages(page)}),page.querySelector("#selectImageProvider").addEventListener("change",function(){browsableImageStartIndex=0,selectedProvider=this.value,reloadBrowsableImages(page)}),page.querySelector("#chkAllLanguages").addEventListener("change",function(){browsableImageStartIndex=0,reloadBrowsableImages(page)}),page.addEventListener("click",function(e){var btnDownloadRemoteImage=parentWithClass(e.target,"btnDownloadRemoteImage");btnDownloadRemoteImage&&downloadRemoteImage(page,btnDownloadRemoteImage.getAttribute("data-imageurl"),btnDownloadRemoteImage.getAttribute("data-imagetype"),btnDownloadRemoteImage.getAttribute("data-imageprovider"))})}function showEditor(itemId,itemType){loading.show();var xhr=new XMLHttpRequest;xhr.open("GET","components/imagedownloader/imagedownloader.template.html",!0),xhr.onload=function(e){var template=this.response;currentItemId=itemId,currentItemType=itemType;var dlg=dialogHelper.createDialog({size:"fullscreen-border",lockScroll:!0,removeOnClose:!0}),theme="b";dlg.classList.add("ui-body-"+theme),dlg.classList.add("background-theme-"+theme);var html="";html+='

    ',html+='',html+='
    '+Globalize.translate("HeaderSearch")+"
    ",html+="

    ",html+='
    ',html+=Globalize.translateDocument(template),html+="
    ",dlg.innerHTML=html,dlg.addEventListener("close",onDialogClosed),dialogHelper.open(dlg);var editorContent=dlg.querySelector(".editorContent");initEditor(editorContent),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),reloadBrowsableImages(editorContent)},xhr.send()}function onDialogClosed(){loading.hide(),hasChanges?currentResolve():currentReject()}var currentItemId,currentItemType,currentResolve,currentReject,selectedProvider,hasChanges=!1,browsableImagePageSize=browserInfo.slow?6:30,browsableImageStartIndex=0,browsableImageType="Primary";return{show:function(itemId,itemType,imageType){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,hasChanges=!1,browsableImageStartIndex=0,browsableImageType=imageType||"Primary",selectedProvider=null,showEditor(itemId,itemType)})}}}); \ No newline at end of file +define(["loading","dialogHelper","imageLoader","emby-checkbox","emby-button","paper-icon-button-light","css!css/metadataeditor.css","emby-linkbutton"],function(loading,dialogHelper,imageLoader){"use strict";function getBaseRemoteOptions(){var options={};return options.itemId=currentItemId,options}function reloadBrowsableImages(page){loading.show();var options=getBaseRemoteOptions();options.type=browsableImageType,options.startIndex=browsableImageStartIndex,options.limit=browsableImagePageSize,options.IncludeAllLanguages=page.querySelector("#chkAllLanguages").checked;var provider=selectedProvider||"";provider&&(options.ProviderName=provider),ApiClient.getAvailableRemoteImages(options).then(function(result){renderRemoteImages(page,result,browsableImageType,options.startIndex,options.limit),page.querySelector("#selectBrowsableImageType").value=browsableImageType;var providersHtml=result.Providers.map(function(p){return'"}),selectImageProvider=page.querySelector("#selectImageProvider");selectImageProvider.innerHTML='"+providersHtml,selectImageProvider.value=provider,loading.hide()})}function renderRemoteImages(page,imagesResult,imageType,startIndex,limit){page.querySelector(".availableImagesPaging").innerHTML=getPagingHtml(startIndex,limit,imagesResult.TotalRecordCount);for(var html="",i=0,length=imagesResult.Images.length;ilimit;html+='
    ',html+='';var startAtDisplay=totalRecordCount?startIndex+1:0;return html+=startAtDisplay+"-"+recordsEnd+" of "+totalRecordCount,html+="",showControls&&(html+='
    ',html+='',html+='',html+="
    "),html+="
    "}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function downloadRemoteImage(page,url,type,provider){var options=getBaseRemoteOptions();options.Type=type,options.ImageUrl=url,options.ProviderName=provider,loading.show(),ApiClient.downloadRemoteImage(options).then(function(){hasChanges=!0;var dlg=parentWithClass(page,"dialog");dialogHelper.close(dlg)})}function getDisplayUrl(url){return ApiClient.getUrl("Images/Remote",{imageUrl:url})}function getRemoteImageHtml(image,imageType){var html="";html+='
    ';var cssClass="remoteImage lazy";cssClass+="Backdrop"==imageType||"Art"==imageType||"Thumb"==imageType||"Logo"==imageType?" remoteBackdropImage":"Banner"==imageType?" remoteBannerImage":"Disc"==imageType?" remoteDiscImage":"Episode"==currentItemType?" remoteBackdropImage":"MusicAlbum"==currentItemType||"MusicArtist"==currentItemType?" remoteDiscImage":" remotePosterImage";var displayUrl=getDisplayUrl(image.ThumbnailUrl||image.Url);return html+='',html+="",html+='
    ',html+='
    ',html+=image.ProviderName,html+="
    ",(image.Width||image.Height||image.Language)&&(html+='
    ',image.Width&&image.Height?(html+=image.Width+" x "+image.Height,image.Language&&(html+=" • "+image.Language)):image.Language&&(html+=image.Language),html+="
    "),null!=image.CommunityRating&&(html+='
    ',"Likes"==image.RatingType?html+=image.CommunityRating+(1==image.CommunityRating?" like":" likes"):image.CommunityRating?(html+=image.CommunityRating.toFixed(1),image.VoteCount&&(html+=" • "+image.VoteCount+(1==image.VoteCount?" vote":" votes"))):html+="Unrated",html+="
    "),html+='',html+="
    ",html+="
    "}function initEditor(page){page.querySelector("#selectBrowsableImageType").addEventListener("change",function(){browsableImageType=this.value,browsableImageStartIndex=0,selectedProvider=null,reloadBrowsableImages(page)}),page.querySelector("#selectImageProvider").addEventListener("change",function(){browsableImageStartIndex=0,selectedProvider=this.value,reloadBrowsableImages(page)}),page.querySelector("#chkAllLanguages").addEventListener("change",function(){browsableImageStartIndex=0,reloadBrowsableImages(page)}),page.addEventListener("click",function(e){var btnDownloadRemoteImage=parentWithClass(e.target,"btnDownloadRemoteImage");btnDownloadRemoteImage&&downloadRemoteImage(page,btnDownloadRemoteImage.getAttribute("data-imageurl"),btnDownloadRemoteImage.getAttribute("data-imagetype"),btnDownloadRemoteImage.getAttribute("data-imageprovider"))})}function showEditor(itemId,itemType){loading.show();var xhr=new XMLHttpRequest;xhr.open("GET","components/imagedownloader/imagedownloader.template.html",!0),xhr.onload=function(e){var template=this.response;currentItemId=itemId,currentItemType=itemType;var dlg=dialogHelper.createDialog({size:"fullscreen-border",lockScroll:!0,removeOnClose:!0}),theme="b";dlg.classList.add("ui-body-"+theme),dlg.classList.add("background-theme-"+theme);var html="";html+='

    ',html+='',html+='
    '+Globalize.translate("HeaderSearch")+"
    ",html+="

    ",html+='
    ',html+=Globalize.translateDocument(template),html+="
    ",dlg.innerHTML=html,dlg.addEventListener("close",onDialogClosed),dialogHelper.open(dlg);var editorContent=dlg.querySelector(".editorContent");initEditor(editorContent),dlg.querySelector(".btnCloseDialog").addEventListener("click",function(){dialogHelper.close(dlg)}),reloadBrowsableImages(editorContent)},xhr.send()}function onDialogClosed(){loading.hide(),hasChanges?currentResolve():currentReject()}var currentItemId,currentItemType,currentResolve,currentReject,selectedProvider,hasChanges=!1,browsableImagePageSize=browserInfo.slow?6:30,browsableImageStartIndex=0,browsableImageType="Primary";return{show:function(itemId,itemType,imageType){return new Promise(function(resolve,reject){currentResolve=resolve,currentReject=reject,hasChanges=!1,browsableImageStartIndex=0,browsableImageType=imageType||"Primary",selectedProvider=null,showEditor(itemId,itemType)})}}}); \ No newline at end of file diff --git a/dashboard-ui/components/maintabsmanager.js b/dashboard-ui/components/maintabsmanager.js index 16bd144535..2cc82b7147 100644 --- a/dashboard-ui/components/maintabsmanager.js +++ b/dashboard-ui/components/maintabsmanager.js @@ -1 +1 @@ -define(["emby-tabs","emby-button"],function(){"use strict";function setTabs(view,selectedIndex,builder){var viewMenuBarTabs;if(!view)return void(tabOwnerView&&(document.body.classList.remove("withTallToolbar"),viewMenuBarTabs=queryScope.querySelector(".viewMenuBarTabs"),viewMenuBarTabs.innerHTML="",viewMenuBarTabs.classList.add("hide"),tabOwnerView=null));if(viewMenuBarTabs=queryScope.querySelector(".viewMenuBarTabs"),tabOwnerView||viewMenuBarTabs.classList.remove("hide"),tabOwnerView!==view){var index=0,indexAttribute=null==selectedIndex?"":' data-index="'+selectedIndex+'"';return viewMenuBarTabs.innerHTML='
    '+builder().map(function(t){var tabHtml,tabClass="emby-tab-button";return tabHtml=t.href?'":'",index++,tabHtml}).join("")+"
    ",document.body.classList.add("withTallToolbar"),tabOwnerView=view,!0}return viewMenuBarTabs.querySelector('[is="emby-tabs"]').selectedIndex(selectedIndex),tabOwnerView=view,!1}function getTabsElement(){return document.querySelector(".tabs-viewmenubar")}var tabOwnerView,queryScope=document.querySelector(".skinHeader");return{setTabs:setTabs,getTabsElement:getTabsElement}}); \ No newline at end of file +define(["emby-tabs","emby-button"],function(){"use strict";function setTabs(view,selectedIndex,builder){var headerTabs;if(!view)return void(tabOwnerView&&(document.body.classList.remove("withTallToolbar"),headerTabs=queryScope.querySelector(".headerTabs"),headerTabs.innerHTML="",headerTabs.classList.add("hide"),tabOwnerView=null));if(headerTabs=queryScope.querySelector(".headerTabs"),tabOwnerView||headerTabs.classList.remove("hide"),tabOwnerView!==view){var index=0,indexAttribute=null==selectedIndex?"":' data-index="'+selectedIndex+'"';return headerTabs.innerHTML='
    '+builder().map(function(t){var tabHtml,tabClass="emby-tab-button";return tabHtml=t.href?'":'",index++,tabHtml}).join("")+"
    ",document.body.classList.add("withTallToolbar"),tabOwnerView=view,!0}return headerTabs.querySelector('[is="emby-tabs"]').selectedIndex(selectedIndex),tabOwnerView=view,!1}function getTabsElement(){return document.querySelector(".tabs-viewmenubar")}var tabOwnerView,queryScope=document.querySelector(".skinHeader");return{setTabs:setTabs,getTabsElement:getTabsElement}}); \ No newline at end of file diff --git a/dashboard-ui/components/medialibrarycreator/medialibrarycreator.template.html b/dashboard-ui/components/medialibrarycreator/medialibrarycreator.template.html index 59b3a06c89..b7c2556c10 100644 --- a/dashboard-ui/components/medialibrarycreator/medialibrarycreator.template.html +++ b/dashboard-ui/components/medialibrarycreator/medialibrarycreator.template.html @@ -18,7 +18,7 @@

    ${HeadersFolders}

    - diff --git a/dashboard-ui/components/tvproviders/schedulesdirect.js b/dashboard-ui/components/tvproviders/schedulesdirect.js index 6982d2b747..a9502920b0 100644 --- a/dashboard-ui/components/tvproviders/schedulesdirect.js +++ b/dashboard-ui/components/tvproviders/schedulesdirect.js @@ -1 +1 @@ -define(["jQuery","loading","emby-checkbox","listViewStyle","emby-input","emby-select"],function($,loading){"use strict";return function(page,providerId,options){function reload(){loading.show(),ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.ListingProviders.filter(function(i){return i.Id==providerId})[0]||{};listingsId=info.ListingsId,$("#selectListing",page).val(info.ListingsId||""),page.querySelector(".txtUser").value=info.Username||"",page.querySelector(".txtPass").value="",page.querySelector(".txtZipCode").value=info.ZipCode||"",info.Username&&info.Password?page.querySelector(".listingsSection").classList.remove("hide"):page.querySelector(".listingsSection").classList.add("hide"),page.querySelector(".chkAllTuners").checked=info.EnableAllTuners,page.querySelector(".chkAllTuners").checked?page.querySelector(".selectTunersSection").classList.add("hide"):page.querySelector(".selectTunersSection").classList.remove("hide"),setCountry(info),refreshTunerDevices(page,info,config.TunerHosts)})}function setCountry(info){ApiClient.getJSON(ApiClient.getUrl("LiveTv/ListingProviders/SchedulesDirect/Countries")).then(function(result){var i,length,countryList=[];for(var region in result){var countries=result[region];if(countries.length&&"ZZZ"!==region)for(i=0,length=countries.length;ib.name?1:a.name'+c.name+""}).join("")).val(info.Country||""),$(page.querySelector(".txtZipCode")).trigger("change")},function(){Dashboard.alert({message:Globalize.translate("ErrorGettingTvLineups")})}),loading.hide()}function submitLoginForm(){loading.show(),require(["cryptojs-sha1"],function(){var info={Type:"SchedulesDirect",Username:page.querySelector(".txtUser").value,EnableAllTuners:!0,Password:CryptoJS.SHA1(page.querySelector(".txtPass").value).toString()},id=providerId;id&&(info.Id=id),ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ListingProviders",{ValidateLogin:!0}),data:JSON.stringify(info),contentType:"application/json",dataType:"json"}).then(function(result){Dashboard.processServerConfigurationUpdateResult(),providerId=result.Id,reload()},function(){Dashboard.alert({message:Globalize.translate("ErrorSavingTvProvider")})})})}function submitListingsForm(){var selectedListingsId=$("#selectListing",page).val();if(!selectedListingsId)return void Dashboard.alert({message:Globalize.translate("ErrorPleaseSelectLineup")});loading.show();var id=providerId;ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.ListingProviders.filter(function(i){return i.Id==id})[0];info.ZipCode=page.querySelector(".txtZipCode").value,info.Country=$("#selectCountry",page).val(),info.ListingsId=selectedListingsId,info.EnableAllTuners=page.querySelector(".chkAllTuners").checked,info.EnabledTuners=info.EnableAllTuners?[]:$(".chkTuner",page).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-id")}),ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ListingProviders",{ValidateListings:!0}),data:JSON.stringify(info),contentType:"application/json"}).then(function(result){loading.hide(),options.showConfirmation!==!1&&Dashboard.processServerConfigurationUpdateResult(),Events.trigger(self,"submitted")},function(){loading.hide(),Dashboard.alert({message:Globalize.translate("ErrorAddingListingsToSchedulesDirect")})})})}function refreshListings(value){return value?(loading.show(),void ApiClient.ajax({type:"GET",url:ApiClient.getUrl("LiveTv/ListingProviders/Lineups",{Id:providerId,Location:value,Country:$("#selectCountry",page).val()}),dataType:"json"}).then(function(result){$("#selectListing",page).html(result.map(function(o){return'"})),listingsId&&$("#selectListing",page).val(listingsId),loading.hide()},function(result){Dashboard.alert({message:Globalize.translate("ErrorGettingTvLineups")}),refreshListings(""),loading.hide()})):void $("#selectListing",page).html("")}function getTunerName(providerId){switch(providerId=providerId.toLowerCase()){case"m3u":return"M3U Playlist";case"hdhomerun":return"HDHomerun";case"satip":return"DVB";default:return"Unknown"}}function refreshTunerDevices(page,providerInfo,devices){for(var html="",i=0,length=devices.length;i';var enabledTuners=providerInfo.EnabledTuners||[],isChecked=providerInfo.EnableAllTuners||enabledTuners.indexOf(device.Id)!=-1,checkedAttribute=isChecked?" checked":"";html+='",html+='
    ',html+='
    ',html+=device.FriendlyName||getTunerName(device.Type),html+="
    ",html+='
    ',html+=device.Url,html+="
    ",html+="
    ",html+="
    "}page.querySelector(".tunerList").innerHTML=html}var listingsId,self=this;self.submit=function(){page.querySelector(".btnSubmitListingsContainer").click()},self.init=function(){options=options||{},options.showCancelButton!==!1?page.querySelector(".btnCancel").classList.remove("hide"):page.querySelector(".btnCancel").classList.add("hide"),options.showSubmitButton!==!1?page.querySelector(".btnSubmitListings").classList.remove("hide"):page.querySelector(".btnSubmitListings").classList.add("hide"),$(".formLogin",page).on("submit",function(){return submitLoginForm(),!1}),$(".formListings",page).on("submit",function(){return submitListingsForm(),!1}),$(".txtZipCode",page).on("change",function(){refreshListings(this.value)}),page.querySelector(".chkAllTuners").addEventListener("change",function(e){e.target.checked?page.querySelector(".selectTunersSection").classList.add("hide"):page.querySelector(".selectTunersSection").classList.remove("hide")}),$(".createAccountHelp",page).html(Globalize.translate("MessageCreateAccountAt",'http://www.schedulesdirect.org')),reload()}}}); \ No newline at end of file +define(["jQuery","loading","emby-checkbox","listViewStyle","emby-input","emby-select","emby-linkbutton"],function($,loading){"use strict";return function(page,providerId,options){function reload(){loading.show(),ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.ListingProviders.filter(function(i){return i.Id==providerId})[0]||{};listingsId=info.ListingsId,$("#selectListing",page).val(info.ListingsId||""),page.querySelector(".txtUser").value=info.Username||"",page.querySelector(".txtPass").value="",page.querySelector(".txtZipCode").value=info.ZipCode||"",info.Username&&info.Password?page.querySelector(".listingsSection").classList.remove("hide"):page.querySelector(".listingsSection").classList.add("hide"),page.querySelector(".chkAllTuners").checked=info.EnableAllTuners,page.querySelector(".chkAllTuners").checked?page.querySelector(".selectTunersSection").classList.add("hide"):page.querySelector(".selectTunersSection").classList.remove("hide"),setCountry(info),refreshTunerDevices(page,info,config.TunerHosts)})}function setCountry(info){ApiClient.getJSON(ApiClient.getUrl("LiveTv/ListingProviders/SchedulesDirect/Countries")).then(function(result){var i,length,countryList=[];for(var region in result){var countries=result[region];if(countries.length&&"ZZZ"!==region)for(i=0,length=countries.length;ib.name?1:a.name'+c.name+""}).join("")).val(info.Country||""),$(page.querySelector(".txtZipCode")).trigger("change")},function(){Dashboard.alert({message:Globalize.translate("ErrorGettingTvLineups")})}),loading.hide()}function submitLoginForm(){loading.show(),require(["cryptojs-sha1"],function(){var info={Type:"SchedulesDirect",Username:page.querySelector(".txtUser").value,EnableAllTuners:!0,Password:CryptoJS.SHA1(page.querySelector(".txtPass").value).toString()},id=providerId;id&&(info.Id=id),ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ListingProviders",{ValidateLogin:!0}),data:JSON.stringify(info),contentType:"application/json",dataType:"json"}).then(function(result){Dashboard.processServerConfigurationUpdateResult(),providerId=result.Id,reload()},function(){Dashboard.alert({message:Globalize.translate("ErrorSavingTvProvider")})})})}function submitListingsForm(){var selectedListingsId=$("#selectListing",page).val();if(!selectedListingsId)return void Dashboard.alert({message:Globalize.translate("ErrorPleaseSelectLineup")});loading.show();var id=providerId;ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.ListingProviders.filter(function(i){return i.Id==id})[0];info.ZipCode=page.querySelector(".txtZipCode").value,info.Country=$("#selectCountry",page).val(),info.ListingsId=selectedListingsId,info.EnableAllTuners=page.querySelector(".chkAllTuners").checked,info.EnabledTuners=info.EnableAllTuners?[]:$(".chkTuner",page).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-id")}),ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ListingProviders",{ValidateListings:!0}),data:JSON.stringify(info),contentType:"application/json"}).then(function(result){loading.hide(),options.showConfirmation!==!1&&Dashboard.processServerConfigurationUpdateResult(),Events.trigger(self,"submitted")},function(){loading.hide(),Dashboard.alert({message:Globalize.translate("ErrorAddingListingsToSchedulesDirect")})})})}function refreshListings(value){return value?(loading.show(),void ApiClient.ajax({type:"GET",url:ApiClient.getUrl("LiveTv/ListingProviders/Lineups",{Id:providerId,Location:value,Country:$("#selectCountry",page).val()}),dataType:"json"}).then(function(result){$("#selectListing",page).html(result.map(function(o){return'"})),listingsId&&$("#selectListing",page).val(listingsId),loading.hide()},function(result){Dashboard.alert({message:Globalize.translate("ErrorGettingTvLineups")}),refreshListings(""),loading.hide()})):void $("#selectListing",page).html("")}function getTunerName(providerId){switch(providerId=providerId.toLowerCase()){case"m3u":return"M3U Playlist";case"hdhomerun":return"HDHomerun";case"satip":return"DVB";default:return"Unknown"}}function refreshTunerDevices(page,providerInfo,devices){for(var html="",i=0,length=devices.length;i';var enabledTuners=providerInfo.EnabledTuners||[],isChecked=providerInfo.EnableAllTuners||enabledTuners.indexOf(device.Id)!=-1,checkedAttribute=isChecked?" checked":"";html+='",html+='
    ',html+='
    ',html+=device.FriendlyName||getTunerName(device.Type),html+="
    ",html+='
    ',html+=device.Url,html+="
    ",html+="
    ",html+=""}page.querySelector(".tunerList").innerHTML=html}var listingsId,self=this;self.submit=function(){page.querySelector(".btnSubmitListingsContainer").click()},self.init=function(){options=options||{},options.showCancelButton!==!1?page.querySelector(".btnCancel").classList.remove("hide"):page.querySelector(".btnCancel").classList.add("hide"),options.showSubmitButton!==!1?page.querySelector(".btnSubmitListings").classList.remove("hide"):page.querySelector(".btnSubmitListings").classList.add("hide"),$(".formLogin",page).on("submit",function(){return submitLoginForm(),!1}),$(".formListings",page).on("submit",function(){return submitListingsForm(),!1}),$(".txtZipCode",page).on("change",function(){refreshListings(this.value)}),page.querySelector(".chkAllTuners").addEventListener("change",function(e){e.target.checked?page.querySelector(".selectTunersSection").classList.add("hide"):page.querySelector(".selectTunersSection").classList.remove("hide")}),$(".createAccountHelp",page).html(Globalize.translate("MessageCreateAccountAt",'http://www.schedulesdirect.org')),reload()}}}); \ No newline at end of file diff --git a/dashboard-ui/connectlogin.html b/dashboard-ui/connectlogin.html index bf39280f7c..390f89264f 100644 --- a/dashboard-ui/connectlogin.html +++ b/dashboard-ui/connectlogin.html @@ -19,10 +19,8 @@ ${ButtonSignIn}