()
| 63 | const vidUrl = options.sources[0].src; |
| 64 | |
| 65 | const togglePictureInPicture = async () => { |
| 66 | try { |
| 67 | if (document.pictureInPictureElement) { |
| 68 | await document.exitPictureInPicture(); |
| 69 | } else if (document.pictureInPictureEnabled && playerRef.current) { |
| 70 | playerRef.current.requestPictureInPicture(); |
| 71 | } |
| 72 | } catch (error) { |
| 73 | // Ignore specific errors that might occur during normal operation |
| 74 | if ( |
| 75 | error instanceof Error && |
| 76 | error.name !== 'NotAllowedError' && |
| 77 | error.name !== 'NotSupportedError' |
| 78 | ) { |
| 79 | console.error('Failed to toggle Picture-in-Picture mode:', error); |
| 80 | toast.error('Failed to toggle Picture-in-Picture mode.'); |
| 81 | } |
| 82 | } |
| 83 | }; |
| 84 | |
| 85 | const PipButton = () => ( |
| 86 | <button |
no outgoing calls
no test coverage detected