mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-10-31 04:32:01 +00:00 
			
		
		
		
	Add option to loop current video.
This commit is contained in:
		| @@ -5,7 +5,13 @@ | |||||||
|             style="width: 100%; height: 100%; max-height: 75vh; min-height: 250px; background: #000" |             style="width: 100%; height: 100%; max-height: 75vh; min-height: 250px; background: #000" | ||||||
|             ref="container" |             ref="container" | ||||||
|         > |         > | ||||||
|             <video data-shaka-player class="uk-width-expand" :autoplay="shouldAutoPlay" ref="videoEl"></video> |             <video | ||||||
|  |                 data-shaka-player | ||||||
|  |                 class="uk-width-expand" | ||||||
|  |                 :autoplay="shouldAutoPlay" | ||||||
|  |                 :loop="selectedAutoLoop" | ||||||
|  |                 ref="videoEl" | ||||||
|  |             ></video> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| </template> | </template> | ||||||
| @@ -21,6 +27,7 @@ export default { | |||||||
|         video: Object, |         video: Object, | ||||||
|         sponsors: Object, |         sponsors: Object, | ||||||
|         selectedAutoPlay: Boolean, |         selectedAutoPlay: Boolean, | ||||||
|  |         selectedAutoLoop: Boolean, | ||||||
|     }, |     }, | ||||||
|     computed: { |     computed: { | ||||||
|         shouldAutoPlay: _this => { |         shouldAutoPlay: _this => { | ||||||
| @@ -109,7 +116,7 @@ export default { | |||||||
|                 }); |                 }); | ||||||
|  |  | ||||||
|                 videoEl.addEventListener("ended", () => { |                 videoEl.addEventListener("ended", () => { | ||||||
|                     if (this.selectedAutoPlay && this.video.relatedStreams.length > 0) { |                     if (!this.selectedAutoLoop && this.selectedAutoPlay && this.video.relatedStreams.length > 0) { | ||||||
|                         const params = this.$route.query; |                         const params = this.$route.query; | ||||||
|                         let url = this.video.relatedStreams[0].url; |                         let url = this.video.relatedStreams[0].url; | ||||||
|                         const searchParams = new URLSearchParams(); |                         const searchParams = new URLSearchParams(); | ||||||
|   | |||||||
| @@ -3,7 +3,13 @@ | |||||||
|         <ErrorHandler v-if="video && video.error" :message="video.message" :error="video.error" /> |         <ErrorHandler v-if="video && video.error" :message="video.message" :error="video.error" /> | ||||||
|  |  | ||||||
|         <div v-show="!video.error"> |         <div v-show="!video.error"> | ||||||
|             <Player ref="videoPlayer" :video="video" :sponsors="sponsors" :selectedAutoPlay="selectedAutoPlay" /> |             <Player | ||||||
|  |                 ref="videoPlayer" | ||||||
|  |                 :video="video" | ||||||
|  |                 :sponsors="sponsors" | ||||||
|  |                 :selectedAutoPlay="selectedAutoPlay" | ||||||
|  |                 :selectedAutoLoop="selectedAutoLoop" | ||||||
|  |             /> | ||||||
|             <h1 class="uk-text-bold">{{ video.title }}</h1> |             <h1 class="uk-text-bold">{{ video.title }}</h1> | ||||||
|  |  | ||||||
|             <div uk-grid> |             <div uk-grid> | ||||||
| @@ -48,6 +54,9 @@ | |||||||
|  |  | ||||||
|         <hr /> |         <hr /> | ||||||
|  |  | ||||||
|  |         <b>Loop this Video:</b>  | ||||||
|  |         <input class="uk-checkbox" v-model="selectedAutoLoop" @change="onChange($event)" type="checkbox" /> | ||||||
|  |         <br /> | ||||||
|         <b>Auto Play next Video:</b>  |         <b>Auto Play next Video:</b>  | ||||||
|         <input class="uk-checkbox" v-model="selectedAutoPlay" @change="onChange($event)" type="checkbox" /> |         <input class="uk-checkbox" v-model="selectedAutoPlay" @change="onChange($event)" type="checkbox" /> | ||||||
|  |  | ||||||
| @@ -118,6 +127,7 @@ export default { | |||||||
|                 title: "Loading...", |                 title: "Loading...", | ||||||
|             }, |             }, | ||||||
|             sponsors: null, |             sponsors: null, | ||||||
|  |             selectedAutoLoop: false, | ||||||
|             selectedAutoPlay: null, |             selectedAutoPlay: null, | ||||||
|             showDesc: true, |             showDesc: true, | ||||||
|             comments: null, |             comments: null, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 FireMasterK
					FireMasterK