mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
On branch master Send framerate to mpv player.
This commit is contained in:
parent
b67a126468
commit
56574b3516
@ -113,7 +113,7 @@ class HtmlAudioPlayer {
|
||||
|
||||
self.api.player.load(val,
|
||||
{ startMilliseconds: ms, autoplay: true },
|
||||
{type: 'music', headers: {'User-Agent': 'JellyfinMediaPlayer'}, frameRate: 0, media: {}},
|
||||
{type: 'music', headers: {'User-Agent': 'JellyfinMediaPlayer'}, media: {}},
|
||||
'#1',
|
||||
'',
|
||||
resolve);
|
||||
|
@ -189,6 +189,16 @@ async function getApi() {
|
||||
return '#' + this.#subtitleTrackIndexToSetOnPlaying;
|
||||
}
|
||||
|
||||
tryGetFramerate(options) {
|
||||
if (options.mediaSource && options.mediaSource.MediaStreams) {
|
||||
for (let stream of options.mediaSource.MediaStreams) {
|
||||
if (stream.Type == "Video") {
|
||||
return stream.RealFrameRate || stream.AverageFrameRate || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@ -204,10 +214,16 @@ async function getApi() {
|
||||
this.#subtitleTrackIndexToSetOnPlaying = options.mediaSource.DefaultSubtitleStreamIndex == null ? -1 : options.mediaSource.DefaultSubtitleStreamIndex;
|
||||
this.#audioTrackIndexToSetOnPlaying = options.playMethod === 'Transcode' ? null : options.mediaSource.DefaultAudioStreamIndex;
|
||||
|
||||
const streamdata = {type: 'video', headers: {'User-Agent': 'JellyfinMediaPlayer'}, media: {}};
|
||||
const fps = this.tryGetFramerate(options);
|
||||
if (fps) {
|
||||
streamdata.frameRate = fps;
|
||||
}
|
||||
|
||||
const player = this.#api.player;
|
||||
player.load(val,
|
||||
{ startMilliseconds: ms, autoplay: true },
|
||||
{type: 'video', headers: {'User-Agent': 'JellyfinMediaPlayer'}, frameRate: 0, media: {}},
|
||||
streamdata,
|
||||
(this.#audioTrackIndexToSetOnPlaying != null)
|
||||
? '#' + this.#audioTrackIndexToSetOnPlaying : '#1',
|
||||
this.getSubtitleParam(),
|
||||
|
Loading…
Reference in New Issue
Block a user