File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 let audioMuted = false ;
1313
1414 onMount (async () => {
15- if (! player .videoFormats || player .videoFormats .length === 0 ) return ;
16- usingEmbed = false ;
17-
1815 if (playerEl ) {
1916 const playerSettings = localStorage .getItem (' player-settings' );
2017 if (playerSettings ) {
7875 });
7976 </script >
8077
81- {#if usingEmbed || player . videoFormats . length === 0 }
78+ {#if usingEmbed }
8279 <media-player
8380 storage =" player-settings"
8481 src ={` https://youtu.be/${player .id } ` }
8885 >
8986 <media-provider ></media-provider >
9087
91- <media-plyr-layout ></media-plyr-layout >
88+ <media-plyr-layout displayDuration ={ true } ></media-plyr-layout >
9289 </media-player >
9390{:else }
9491 <media-player
Original file line number Diff line number Diff line change 5353
5454 onMount (async () => {
5555 const routeURL = new URL (window .location .href );
56- const searchParams = routeURL .searchParams .get (' id' )! ;
56+ const searchParams = routeURL .searchParams .get (' id' );
57+
58+ if (! searchParams ) {
59+ notify (' No video ID found' );
60+ return ;
61+ }
62+
5763 let videoID = searchParams ;
5864 if (searchParams .startsWith (' watch?v=' )) {
5965 videoID = searchParams .replace (' watch?v=' , ' ' );
You can’t perform that action at this time.
0 commit comments