@@ -56,15 +56,16 @@ export const minMaxPos = (settings: Partial<Settings>, includeDisabled = false)
5656export const slot = < S , T > ( name : Comp , comp : PlayerComponentSetting , left : S , right : T ) : S | T => ( comp ?. position ?? defaultPositions [ name ] ) < 0 ? right : left ;
5757export const setDefaultIds = ( ) => {
5858 const left = document . querySelectorAll ( '#video-controls > :last-child > :first-child > *' ) ;
59- const right = document . querySelectorAll ( '#video-controls > :last-child > :last-child > *:not(div:empty)' ) ;
59+ const right = document . querySelectorAll ( '#video-controls > :last-child > :nth-child(2) > *' ) ;
60+ console . dev . debug ( 'Player elements left' , left , 'right' , right ) ;
6061 if ( left . length != 3 )
61- throw new Error ( ' Expected three buttons on left' ) ;
62+ throw new Error ( ` Expected three buttons on left, got ${ left . length } ` ) ;
6263 const hasChromecast = document . querySelector ( '#video-controls > div > :last-child > [aria-label="Chromecast"]' ) ;
6364 if ( hasChromecast ) {
6465 if ( right . length != 6 && right . length != 7 )
65- throw new Error ( ' Chromecast detected, expected 6 or 7 buttons on right' ) ;
66+ throw new Error ( ` Chromecast detected, expected 6 or 7 buttons on right, got ${ right . length } ` ) ;
6667 } else if ( right . length != 4 && right . length != 5 )
67- throw new Error ( ' No Chromecast detected, expected 4 or 5 buttons on right' ) ;
68+ throw new Error ( ` No Chromecast detected, expected 4 or 5 buttons on right, got ${ right . length } ` ) ;
6869 const expectNoSubtitle = hasChromecast ? right . length === 6 : right . length === 4 ;
6970 const givenLeft = builtin . slice ( 0 , left . length ) ;
7071 const givenRight = builtin . slice ( left . length )
0 commit comments