1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-13 22:00:28 +05:30

Make embed show video in full-screen.

This commit is contained in:
FireMasterK 2021-08-04 10:43:22 +05:30
parent 3d82817dad
commit 4ef653df31
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
2 changed files with 22 additions and 4 deletions

View File

@ -2,7 +2,8 @@
<div class="uk-container-expand">
<div
data-shaka-player-container
style="width: 100%; height: 100%; max-height: 75vh; min-height: 250px; background: #000"
style="width: 100%; height: 100%; background: #000"
:style="!isEmbed ? { 'max-height': '75vh', 'min-height': '250px' } : {}"
ref="container"
>
<video
@ -42,6 +43,7 @@ export default {
sponsors: Object,
selectedAutoPlay: Boolean,
selectedAutoLoop: Boolean,
isEmbed: Boolean,
},
data() {
return {

View File

@ -1,5 +1,16 @@
<template>
<div class="uk-container uk-container-xlarge" v-if="video">
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 999" v-if="video && isEmbed">
<Player
ref="videoPlayer"
:video="video"
:sponsors="sponsors"
:selectedAutoPlay="false"
:selectedAutoLoop="selectedAutoLoop"
:isEmbed="isEmbed"
/>
</div>
<div class="uk-container uk-container-xlarge" v-if="video && !isEmbed">
<ErrorHandler v-if="video && video.error" :message="video.message" :error="video.error" />
<div v-show="!video.error">
@ -128,7 +139,7 @@ export default {
if (this.active) this.$refs.videoPlayer.loadVideo();
});
this.getSponsors();
if (this.getPreferenceBoolean("comments", true)) this.getComments();
if (!this.isEmbed && this.getPreferenceBoolean("comments", true)) this.getComments();
},
activated() {
this.active = true;
@ -181,7 +192,7 @@ export default {
if (!this.video.error) {
document.title = this.video.title + " - Piped";
this.channelId = this.video.uploaderUrl.split("/")[2];
this.fetchSubscribedStatus();
if (!this.isEmbed) this.fetchSubscribedStatus();
this.video.description = this.purifyHTML(
this.video.description
@ -246,6 +257,11 @@ export default {
return this.$route.query.v || this.$route.params.v;
},
},
computed: {
isEmbed(_this) {
return String(_this.$route.path).indexOf("/embed/") == 0;
},
},
components: {
Player,
VideoItem,