mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Don't add empty poster attribute
This commit is contained in:
parent
aacfb6adf6
commit
8599b4a5b3
1 changed files with 9 additions and 7 deletions
|
@ -1104,26 +1104,26 @@
|
|||
|
||||
// Get Video Poster (Code from librarybrowser.js)
|
||||
var screenWidth = Math.max(screen.height, screen.width),
|
||||
posterUrl;
|
||||
posterCode = '';
|
||||
|
||||
if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
|
||||
posterUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
posterCode = ' poster="' + ApiClient.getScaledImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
index: 0,
|
||||
maxWidth: screenWidth,
|
||||
tag: item.BackdropImageTags[0]
|
||||
});
|
||||
}) + '"';
|
||||
|
||||
}
|
||||
else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
|
||||
|
||||
posterUrl = ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
|
||||
posterCode = ' poster="' + ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
|
||||
type: 'Backdrop',
|
||||
index: 0,
|
||||
maxWidth: screenWidth,
|
||||
tag: item.ParentBackdropImageTags[0]
|
||||
});
|
||||
}) + '"';
|
||||
|
||||
}
|
||||
|
||||
|
@ -1136,11 +1136,11 @@
|
|||
|
||||
// Can't autoplay in these browsers so we need to use the full controls
|
||||
if (requiresNativeControls) {
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="none" autoplay="autoplay" controls="controls" poster="' + posterUrl + '">';
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="none" autoplay="autoplay" controls="controls"' + posterCode + '>';
|
||||
} else {
|
||||
|
||||
// Chrome 35 won't play with preload none
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay poster="' + posterUrl + '">';
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay' + posterCode + '>';
|
||||
}
|
||||
|
||||
if (!isStatic) {
|
||||
|
@ -1303,6 +1303,8 @@
|
|||
|
||||
self.stop();
|
||||
|
||||
console.dir(this);
|
||||
|
||||
var errorCode = this.error ? this.error.code : '';
|
||||
console.log('Html5 Video error code: ' + errorCode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue