mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Keep Parameters in URL when auto-playing.
This commit is contained in:
		
							parent
							
								
									cf6ce71339
								
							
						
					
					
						commit
						3cb733dfd0
					
				
					 1 changed files with 20 additions and 6 deletions
				
			
		| 
						 | 
					@ -110,8 +110,23 @@ export default {
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                videoEl.addEventListener("ended", () => {
 | 
					                videoEl.addEventListener("ended", () => {
 | 
				
			||||||
                    if (this.selectedAutoPlay && this.video.relatedStreams.length > 0)
 | 
					                    if (this.selectedAutoPlay && this.video.relatedStreams.length > 0) {
 | 
				
			||||||
                        this.$router.push(this.video.relatedStreams[0].url);
 | 
					                        const params = this.$route.query;
 | 
				
			||||||
 | 
					                        let url = this.video.relatedStreams[0].url;
 | 
				
			||||||
 | 
					                        const searchParams = new URLSearchParams();
 | 
				
			||||||
 | 
					                        for (var param in params)
 | 
				
			||||||
 | 
					                            switch (param) {
 | 
				
			||||||
 | 
					                                case "v":
 | 
				
			||||||
 | 
					                                case "t":
 | 
				
			||||||
 | 
					                                    break;
 | 
				
			||||||
 | 
					                                default:
 | 
				
			||||||
 | 
					                                    searchParams.set(param, params[param]);
 | 
				
			||||||
 | 
					                                    break;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        const paramStr = searchParams.toString();
 | 
				
			||||||
 | 
					                        if (paramStr.length > 0) url += "&" + paramStr;
 | 
				
			||||||
 | 
					                        this.$router.push(url);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -137,11 +152,10 @@ export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.player = player;
 | 
					            this.player = player;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (
 | 
					            const disableVideo =
 | 
				
			||||||
                ((localStorage && localStorage.getItem("audioOnly") === "true") || this.$route.query.listen === "1") &&
 | 
					                ((localStorage && localStorage.getItem("audioOnly") === "true") || this.$route.query.listen === "1") &&
 | 
				
			||||||
                !this.video.livestream
 | 
					                !this.video.livestream;
 | 
				
			||||||
            )
 | 
					            this.player.configure("manifest.disableVideo", disableVideo);
 | 
				
			||||||
                this.player.configure("manifest.disableVideo", true);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            const quality = Number(localStorage.getItem("quality"));
 | 
					            const quality = Number(localStorage.getItem("quality"));
 | 
				
			||||||
            const qualityConds = quality > 0 && (this.video.audioStreams.length > 0 || this.video.livestream);
 | 
					            const qualityConds = quality > 0 && (this.video.audioStreams.length > 0 || this.video.livestream);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue