mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Made new device profile specifically for webm and fixed unnecessary transcoding with AV1
This commit is contained in:
parent
e5a13a2020
commit
ae715bbe9a
1 changed files with 27 additions and 28 deletions
|
@ -176,6 +176,16 @@ define(['browser'], function (browser) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function testCanPlayAv1(videoTestElement) {
|
||||
if (browser.tizenVersion >= 5.5) {
|
||||
return true;
|
||||
} else if (browser.web0sVersion >= 5 && window.outerHeight >= 2160) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return videoTestElement.canPlayType('video/webm; codecs="av01.0.15M.10"').replace(/no/, '');
|
||||
}
|
||||
|
||||
function testCanPlayTs() {
|
||||
return browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
||||
}
|
||||
|
@ -317,7 +327,6 @@ define(['browser'], function (browser) {
|
|||
|
||||
var canPlayVp8 = videoTestElement.canPlayType('video/webm; codecs="vp8"').replace(/no/, '');
|
||||
var canPlayVp9 = videoTestElement.canPlayType('video/webm; codecs="vp9"').replace(/no/, '');
|
||||
var canPlayAv1 = videoTestElement.canPlayType('video/webm; codecs="av1"').replace(/no/, '');
|
||||
var webmAudioCodecs = ['vorbis'];
|
||||
|
||||
var canPlayMkv = testCanPlayMkv(videoTestElement);
|
||||
|
@ -459,6 +468,7 @@ define(['browser'], function (browser) {
|
|||
});
|
||||
|
||||
var mp4VideoCodecs = [];
|
||||
var webmVideoCodecs = [];
|
||||
var hlsVideoCodecs = [];
|
||||
|
||||
if (canPlayH264(videoTestElement)) {
|
||||
|
@ -490,16 +500,32 @@ define(['browser'], function (browser) {
|
|||
|
||||
if (canPlayVp8) {
|
||||
mp4VideoCodecs.push('vp8');
|
||||
webmVideoCodecs.push('vp8');
|
||||
}
|
||||
|
||||
if (canPlayVp9) {
|
||||
mp4VideoCodecs.push('vp9');
|
||||
webmVideoCodecs.push('vp9');
|
||||
}
|
||||
|
||||
if (testCanPlayAv1(videoTestElement)) {
|
||||
mp4VideoCodecs.push('av1');
|
||||
webmVideoCodecs.push('av1');
|
||||
}
|
||||
|
||||
if (canPlayVp8 || browser.tizen || browser.orsay) {
|
||||
videoAudioCodecs.push('vorbis');
|
||||
}
|
||||
|
||||
if (webmVideoCodecs.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'webm',
|
||||
Type: 'Video',
|
||||
VideoCodec: webmVideoCodecs.join(','),
|
||||
AudioCodec: webmAudioCodecs.join(',')
|
||||
});
|
||||
}
|
||||
|
||||
if (mp4VideoCodecs.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mp4,m4v',
|
||||
|
@ -558,33 +584,6 @@ define(['browser'], function (browser) {
|
|||
}
|
||||
});
|
||||
|
||||
if (canPlayVp8) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'webm',
|
||||
Type: 'Video',
|
||||
AudioCodec: webmAudioCodecs.join(','),
|
||||
VideoCodec: 'VP8'
|
||||
});
|
||||
}
|
||||
|
||||
if (canPlayVp9) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'webm',
|
||||
Type: 'Video',
|
||||
AudioCodec: webmAudioCodecs.join(','),
|
||||
VideoCodec: 'VP9'
|
||||
});
|
||||
}
|
||||
|
||||
if (canPlayAv1) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'webm',
|
||||
Type: 'Video',
|
||||
AudioCodec: webmAudioCodecs.join(','),
|
||||
VideoCodec: 'AV1'
|
||||
});
|
||||
}
|
||||
|
||||
profile.TranscodingProfiles = [];
|
||||
|
||||
var hlsBreakOnNonKeyFrames = browser.iOS || browser.osx || browser.edge || !canPlayNativeHls() ? true : false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue