diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6b9402e6..0f232833 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -16,7 +16,7 @@ @@ -53,6 +53,7 @@ const socket = ref() const downloading = reactive({}) const completed = reactive({}) const video_link = ref('') +const video_title = ref('') const addForm = useStorage('addForm', true) const showTasks = useStorage('showTasks', false) const cli_output = ref([]) @@ -231,7 +232,10 @@ const addItem = (item) => { }); }; -const playItem = item => video_link.value = makeDownload(config, item, 'm3u8'); +const playItem = item => { + video_link.value = makeDownload(config, item, 'm3u8'); + video_title.value = item.title; +} const reloadWindow = () => window.location.reload(); diff --git a/frontend/src/components/Video-Player.vue b/frontend/src/components/Video-Player.vue index 991bced9..13523a52 100644 --- a/frontend/src/components/Video-Player.vue +++ b/frontend/src/components/Video-Player.vue @@ -77,7 +77,13 @@ onUnmounted(() => { if (hls) { hls.destroy() } + window.removeEventListener('keydown', eventFunc) + + if (props.title) { + window.document.title = 'YTPTube' + } + }) const prepareVideoPlayer = () => { @@ -97,6 +103,7 @@ const prepareVideoPlayer = () => { enabled: true, key: 'plyr' }, + title: props.title, mediaMetadata: { title: props.title }, @@ -118,5 +125,11 @@ const prepareVideoPlayer = () => { if (video.value) { hls.attachMedia(video.value) } + + if (props.title) { + window.document.title = `YTPTube - Playing: ${props.title}` + } + } +