mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add credentials to media elements
This commit is contained in:
parent
e8b7d2e27e
commit
818ff90aff
1 changed files with 13 additions and 4 deletions
|
@ -178,7 +178,7 @@
|
||||||
html += '<div class="mediaPlayerAudioContainer" style="display:none;padding: 1em;background: #222;"><div class="mediaPlayerAudioContainerInner">';;
|
html += '<div class="mediaPlayerAudioContainer" style="display:none;padding: 1em;background: #222;"><div class="mediaPlayerAudioContainerInner">';;
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<audio class="mediaPlayerAudio" crossorigin="use-credentials" controls>';
|
html += '<audio class="mediaPlayerAudio" controls>';
|
||||||
html += '</audio></div></div>';
|
html += '</audio></div></div>';
|
||||||
|
|
||||||
$(document.body).append(html);
|
$(document.body).append(html);
|
||||||
|
@ -211,6 +211,14 @@
|
||||||
return MediaPlayer.canPlayHls() && !MediaPlayer.canPlayNativeHls();
|
return MediaPlayer.canPlayHls() && !MediaPlayer.canPlayNativeHls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCrossOriginValue(mediaSource) {
|
||||||
|
|
||||||
|
if (mediaSource.EnableHttpCredentials) {
|
||||||
|
return 'use-credentials';
|
||||||
|
}
|
||||||
|
return 'anonymous';
|
||||||
|
}
|
||||||
|
|
||||||
function createVideoElement() {
|
function createVideoElement() {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
@ -222,15 +230,15 @@
|
||||||
|
|
||||||
// Can't autoplay in these browsers so we need to use the full controls
|
// Can't autoplay in these browsers so we need to use the full controls
|
||||||
if (requiresNativeControls && AppInfo.isNativeApp && browserInfo.android) {
|
if (requiresNativeControls && AppInfo.isNativeApp && browserInfo.android) {
|
||||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="use-credentials"' + poster + ' webkit-playsinline>';
|
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay"' + poster + ' webkit-playsinline>';
|
||||||
}
|
}
|
||||||
else if (requiresNativeControls) {
|
else if (requiresNativeControls) {
|
||||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="use-credentials"' + poster + ' controls="controls" webkit-playsinline>';
|
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay"' + poster + ' controls="controls" webkit-playsinline>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// Chrome 35 won't play with preload none
|
// Chrome 35 won't play with preload none
|
||||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="use-credentials"' + poster + ' webkit-playsinline>';
|
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay"' + poster + ' webkit-playsinline>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</video>';
|
html += '</video>';
|
||||||
|
@ -350,6 +358,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elem.crossOrigin = getCrossOriginValue(mediaSource);
|
||||||
var val = streamInfo.url;
|
var val = streamInfo.url;
|
||||||
|
|
||||||
if (AppInfo.isNativeApp && browserInfo.safari) {
|
if (AppInfo.isNativeApp && browserInfo.safari) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue