This commit is contained in:
ArabCoders 2025-01-03 00:44:02 +03:00
parent 2a79ac6849
commit 7633f8ffe2
2 changed files with 26 additions and 8 deletions

View file

@ -82,7 +82,13 @@ class FFStream:
"""
Is the stream labelled as a video stream.
"""
return self.__dict__.get("codec_type", None) == "video"
if self.__dict__.get("codec_type", None) != "video":
return False
if self.__dict__.get("codec_name", None) in ["png", "mjpeg", "gif", "bmp", "tiff", "webp"]:
return False
return True
def is_subtitle(self):
"""

View file

@ -18,7 +18,7 @@
<template>
<div>
<video ref="video" :poster="previewImageLink" :controls="isControls" :title="title" playsinline>
<video ref="video" :data-poster="thumbnail" :controls="isControls" :title="title" playsinline>
<source :src="link" type="application/x-mpegURL" />
</video>
</div>
@ -31,10 +31,6 @@ import Plyr from 'plyr'
import 'plyr/dist/plyr.css'
const props = defineProps({
previewImageLink: {
type: String,
default: ''
},
link: {
type: String,
default: ''
@ -109,7 +105,7 @@ const prepareVideoPlayer = () => {
mediaMetadata['artist'] = props.artist
}
player = new Plyr(video.value, {
let opts = {
debug: false,
clickToPlay: true,
keyboard: { focused: true, global: true },
@ -125,12 +121,28 @@ const prepareVideoPlayer = () => {
enabled: true,
key: 'plyr'
},
poster: props.thumbnail,
artist: props.artist,
title: props.title,
mediaMetadata: mediaMetadata,
captions: {
update: true,
}
});
};
if (props.artist) {
opts.artist = props.artist
}
if (props.title) {
opts.title = props.title
}
if (props.thumbnail) {
opts.poster = props.thumbnail
}
player = new Plyr(video.value, opts);
hls = new Hls({
debug: false,