mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 19:37:55 +02:00
extract nowplayingbar into standalone widget to work with any player
This commit is contained in:
parent
efef76424e
commit
f5261fc4b7
10 changed files with 41 additions and 4357 deletions
|
@ -1590,7 +1590,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return SupportsAutomaticVideoStreamCopy;
|
return request.EnableAutoStreamCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CanStreamCopyAudio(StreamRequest request, MediaStream audioStream, List<string> supportedAudioCodecs)
|
private bool CanStreamCopyAudio(StreamRequest request, MediaStream audioStream, List<string> supportedAudioCodecs)
|
||||||
|
@ -1632,14 +1632,6 @@ namespace MediaBrowser.Api.Playback
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool SupportsAutomaticVideoStreamCopy
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyDeviceProfileSettings(StreamState state)
|
private void ApplyDeviceProfileSettings(StreamState state)
|
||||||
{
|
{
|
||||||
var headers = new Dictionary<string, string>();
|
var headers = new Dictionary<string, string>();
|
||||||
|
|
|
@ -98,14 +98,6 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
ApiEntryPoint.Instance.OnTranscodeEndRequest(playlist, TranscodingJobType.Hls);
|
ApiEntryPoint.Instance.OnTranscodeEndRequest(playlist, TranscodingJobType.Hls);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool SupportsAutomaticVideoStreamCopy
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified request.
|
/// Gets the specified request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -171,5 +171,13 @@ namespace MediaBrowser.Api.Playback
|
||||||
return Width.HasValue || Height.HasValue;
|
return Width.HasValue || Height.HasValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ApiMember(Name = "EnableAutoStreamCopy", Description = "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
||||||
|
public bool EnableAutoStreamCopy { get; set; }
|
||||||
|
|
||||||
|
public VideoStreamRequest()
|
||||||
|
{
|
||||||
|
EnableAutoStreamCopy = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,18 @@ namespace MediaBrowser.Server.Implementations.Localization
|
||||||
public IEnumerable<CountryInfo> GetCountries()
|
public IEnumerable<CountryInfo> GetCountries()
|
||||||
{
|
{
|
||||||
return CultureInfo.GetCultures(CultureTypes.SpecificCultures)
|
return CultureInfo.GetCultures(CultureTypes.SpecificCultures)
|
||||||
.Select(c => new RegionInfo(c.LCID))
|
.Select(c =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return new RegionInfo(c.LCID);
|
||||||
|
}
|
||||||
|
catch (CultureNotFoundException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.Where(i => i != null)
|
||||||
.OrderBy(c => c.DisplayName)
|
.OrderBy(c => c.DisplayName)
|
||||||
.DistinctBy(c => c.TwoLetterISORegionName)
|
.DistinctBy(c => c.TwoLetterISORegionName)
|
||||||
.Select(c => new CountryInfo
|
.Select(c => new CountryInfo
|
||||||
|
@ -356,7 +367,7 @@ namespace MediaBrowser.Server.Implementations.Localization
|
||||||
}.OrderBy(i => i.Name);
|
}.OrderBy(i => i.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LocalizeDocument(string document, string culture, Func<string,string> tokenBuilder)
|
public string LocalizeDocument(string document, string culture, Func<string, string> tokenBuilder)
|
||||||
{
|
{
|
||||||
foreach (var pair in GetLocalizationDictionary(culture).ToList())
|
foreach (var pair in GetLocalizationDictionary(culture).ToList())
|
||||||
{
|
{
|
||||||
|
|
|
@ -372,8 +372,11 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
sb.Append("<meta http-equiv=\"X-UA-Compatibility\" content=\"IE=Edge\">");
|
sb.Append("<meta http-equiv=\"X-UA-Compatibility\" content=\"IE=Edge\">");
|
||||||
sb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">");
|
sb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">");
|
||||||
sb.Append("<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">");
|
sb.Append("<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">");
|
||||||
|
sb.Append("<meta name=\"mobile-web-app-capable\" content=\"yes\">");
|
||||||
//sb.Append("<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">");
|
//sb.Append("<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">");
|
||||||
|
|
||||||
|
sb.Append("<link rel=\"icon\" sizes=\"114x114\" href=\"css/images/touchicon114.png\" />");
|
||||||
|
|
||||||
// http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
|
// http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
|
||||||
sb.Append("<link rel=\"apple-touch-icon\" href=\"css/images/touchicon.png\" />");
|
sb.Append("<link rel=\"apple-touch-icon\" href=\"css/images/touchicon.png\" />");
|
||||||
sb.Append("<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"css/images/touchicon72.png\" />");
|
sb.Append("<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"css/images/touchicon72.png\" />");
|
||||||
|
@ -442,7 +445,6 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
// jQuery + jQuery mobile
|
// jQuery + jQuery mobile
|
||||||
await AppendResource(memoryStream, "thirdparty/jquery-2.0.3.min.js", newLineBytes).ConfigureAwait(false);
|
await AppendResource(memoryStream, "thirdparty/jquery-2.0.3.min.js", newLineBytes).ConfigureAwait(false);
|
||||||
await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.2/jquery.mobile-1.4.2.min.js", newLineBytes).ConfigureAwait(false);
|
await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.2/jquery.mobile-1.4.2.min.js", newLineBytes).ConfigureAwait(false);
|
||||||
await AppendResource(memoryStream, "thirdparty/jquery.ba-tinypubsub.min.js", newLineBytes).ConfigureAwait(false);
|
|
||||||
|
|
||||||
await AppendLocalization(memoryStream).ConfigureAwait(false);
|
await AppendLocalization(memoryStream).ConfigureAwait(false);
|
||||||
await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
|
await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
|
||||||
|
@ -455,10 +457,10 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
|
await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
|
||||||
|
|
||||||
var builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
var assembly = GetType().Assembly;
|
|
||||||
using (var stream = assembly.GetManifestResourceStream("MediaBrowser.WebDashboard.ApiClient.js"))
|
using (var fs = _fileSystem.GetFileStream(GetDashboardResourcePath("thirdparty/mediabrowser.apiclient.js"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true))
|
||||||
{
|
{
|
||||||
using (var streamReader = new StreamReader(stream))
|
using (var streamReader = new StreamReader(fs))
|
||||||
{
|
{
|
||||||
var text = await streamReader.ReadToEndAsync().ConfigureAwait(false);
|
var text = await streamReader.ReadToEndAsync().ConfigureAwait(false);
|
||||||
builder.Append(text);
|
builder.Append(text);
|
||||||
|
@ -517,6 +519,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
|
|
||||||
"mediaplayer.js",
|
"mediaplayer.js",
|
||||||
"mediaplayer-video.js",
|
"mediaplayer-video.js",
|
||||||
|
"nowplayingbar.js",
|
||||||
|
|
||||||
"ratingdialog.js",
|
"ratingdialog.js",
|
||||||
"aboutpage.js",
|
"aboutpage.js",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -85,7 +85,9 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="ApiClient.js" />
|
<EmbeddedResource Include="dashboard-ui\thirdparty\mediabrowser.apiclient.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</EmbeddedResource>
|
||||||
<Content Include="dashboard-ui\advancedpaths.html">
|
<Content Include="dashboard-ui\advancedpaths.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -617,6 +619,9 @@
|
||||||
<Content Include="dashboard-ui\scripts\livetvrecordings.js">
|
<Content Include="dashboard-ui\scripts\livetvrecordings.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\nowplayingbar.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\ratingdialog.js">
|
<Content Include="dashboard-ui\scripts\ratingdialog.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -653,9 +658,6 @@
|
||||||
<Content Include="dashboard-ui\thirdparty\jquery-2.0.3.min.js">
|
<Content Include="dashboard-ui\thirdparty\jquery-2.0.3.min.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="dashboard-ui\thirdparty\jquery.ba-tinypubsub.min.js">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="dashboard-ui\thirdparty\jquery.unveil-custom.js">
|
<Content Include="dashboard-ui\thirdparty\jquery.unveil-custom.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.349</version>
|
<version>3.0.350</version>
|
||||||
<title>MediaBrowser.Common.Internal</title>
|
<title>MediaBrowser.Common.Internal</title>
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.349" />
|
<dependency id="MediaBrowser.Common" version="3.0.350" />
|
||||||
<dependency id="NLog" version="2.1.0" />
|
<dependency id="NLog" version="2.1.0" />
|
||||||
<dependency id="SimpleInjector" version="2.4.1" />
|
<dependency id="SimpleInjector" version="2.4.1" />
|
||||||
<dependency id="sharpcompress" version="0.10.2" />
|
<dependency id="sharpcompress" version="0.10.2" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.349</version>
|
<version>3.0.350</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.349</version>
|
<version>3.0.350</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.349" />
|
<dependency id="MediaBrowser.Common" version="3.0.350" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in a new issue