From a99f66193a216511e625db13f2e527fe1e8c052e Mon Sep 17 00:00:00 2001 From: Prashant Kumar Date: Wed, 23 Oct 2024 10:34:08 +0530 Subject: [PATCH] fixed al the errors realted to pip button --- src/app/layout.tsx | 3 --- src/components/ContentCard.tsx | 1 - src/components/VideoPlayer2.tsx | 24 +++++++++++++++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9ab1f4a7a..976e9c458 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -25,9 +25,6 @@ export const metadata: Metadata = siteConfig; export default function RootLayout({ children }: { children: ReactNode }) { return ( - - - = ({ const pipButtonContainer = (player as any).controlBar.addChild('button'); const root = createRoot(pipButtonContainer.el()); - root.render(picture_in_picture_alt); + root.render( +
+ +
+ ); return pipButtonContainer; }; @@ -83,14 +88,22 @@ export const VideoPlayer: FunctionComponent = ({ const createNextVideoButton = (player: Player) => { const NextButtonContainer = (player as any).controlBar.addChild('button'); const root = createRoot(NextButtonContainer.el()); - root.render(skip_next); + root.render( +
+ +
+ ); return NextButtonContainer; }; const createPrevVideoButton = (player: Player) => { const PrevButtonContainer = (player as any).controlBar.addChild('button'); const root = createRoot(PrevButtonContainer.el()); - root.render(skip_previous); + root.render( +
+ +
+ ); return PrevButtonContainer; }; @@ -433,6 +446,11 @@ export const VideoPlayer: FunctionComponent = ({ const pipButton = createPipButton(player); controlBar.el().insertBefore(pipButton.el(), fullscreenToggle.el()); + // pipButton.on('click', (e: any) => { + // e.preventDefault(); + // e.stopPropagation(); + // togglePictureInPicture(); + // }); pipButton.on('click', (e:any) => { e.preventDefault();