@halibegic/react-video-player 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -2
- package/dist/components/live-player.d.ts +9 -1
- package/dist/components/player/live-player/live-player-event-check.d.ts +8 -0
- package/dist/components/player/live-player/live-player-go-live.d.ts +6 -0
- package/dist/components/player/live-player/live-player-playback-indicator.d.ts +2 -0
- package/dist/components/player/live-player/live-player-playback.d.ts +1 -1
- package/dist/components/player/live-player/live-player-progress.d.ts +2 -0
- package/dist/components/player/live-player/live-player-provider.d.ts +7 -0
- package/dist/components/player/live-player/live-player-remaining-time.d.ts +2 -0
- package/dist/components/player/live-player/live-player-tech.d.ts +5 -0
- package/dist/components/player/player-hls-engine.d.ts +6 -0
- package/dist/components/player/player-tech.d.ts +1 -1
- package/dist/components/player/ui/icons/arrow-right-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/check-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/fullscreen-enter-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/fullscreen-exit-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/hd-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/pause-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/play-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/volume-max-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/volume-min-icon.d.ts +2 -0
- package/dist/components/player/ui/icons/volume-mute-icon.d.ts +2 -0
- package/dist/components/player/ui/player-button.d.ts +5 -2
- package/dist/components/player/ui/player-controls.styles.d.ts +7 -0
- package/dist/components/player/ui/player-dropdown.d.ts +11 -0
- package/dist/components/player/ui/player-fullscreen.d.ts +1 -1
- package/dist/components/player/ui/player-idle-check.d.ts +3 -0
- package/dist/components/player/ui/player-playback-indicator.d.ts +4 -0
- package/dist/components/player/ui/player-progress.styles.d.ts +6 -0
- package/dist/components/player/ui/player-quality-control.d.ts +2 -0
- package/dist/components/player/ui/player-remaining-time.styles.d.ts +6 -0
- package/dist/components/player/ui/player-slider.d.ts +3 -5
- package/dist/components/player/ui/player-spinner.d.ts +3 -0
- package/dist/components/player/ui/player-volume.d.ts +2 -0
- package/dist/components/vod-player/vod-player-playback-indicator.d.ts +2 -0
- package/dist/components/vod-player/vod-player-remaining-time.d.ts +2 -0
- package/dist/components/vod-player/vod-player-watch-history.d.ts +5 -0
- package/dist/components/vod-player.d.ts +5 -1
- package/dist/config/player.d.ts +3 -5
- package/dist/hooks/use-interval.d.ts +2 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +3 -0
- package/dist/hooks/use-state-refresh.d.ts +2 -0
- package/dist/react-video-player.es.js +6817 -3
- package/dist/react-video-player.es.js.map +1 -1
- package/dist/react-video-player.umd.js +369 -103
- package/dist/react-video-player.umd.js.map +1 -1
- package/dist/stores/live-player-store.d.ts +21 -0
- package/dist/stores/player-store.d.ts +12 -2
- package/dist/types/player.d.ts +10 -0
- package/dist/utils/dom.d.ts +11 -0
- package/dist/utils/player.d.ts +17 -3
- package/package.json +7 -9
- package/dist/components/player/tech/player-dash-tech.d.ts +0 -6
- package/dist/components/player/tech/player-hls-tech.d.ts +0 -6
- package/dist/index-DXKCbM7O.js +0 -2003
- package/dist/index-DXKCbM7O.js.map +0 -1
- package/dist/player-dash-tech-D7KQCWFx.js +0 -50
- package/dist/player-dash-tech-D7KQCWFx.js.map +0 -1
- package/dist/player-hls-tech-sXKjWi4D.js +0 -29
- package/dist/player-hls-tech-sXKjWi4D.js.map +0 -1
- /package/dist/{components/hooks → hooks}/use-debounce.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player-hls-tech-sXKjWi4D.js","sources":["../src/components/player/tech/player-hls-tech.tsx"],"sourcesContent":["import { usePlayerStore } from \"@/stores/player-store\";\nimport Hls, { type HlsConfig } from \"hls.js\";\nimport { useCallback, useEffect, useRef } from \"react\";\n\ntype PlayerHlsTechProps = {\n url: string;\n isLive: boolean;\n};\n\nfunction PlayerHlsTech({ url, isLive }: PlayerHlsTechProps) {\n const hlsRef = useRef<Hls | null>(null);\n const techRef = usePlayerStore((s) => s.techRef);\n\n const handleMediaAttached = useCallback((): void => {\n if (!hlsRef.current) return;\n\n console.log(\"[Player][Event]\", \"MEDIA_ATTACHED\");\n\n hlsRef.current.loadSource(url);\n }, [url]);\n\n const prepareHls = useCallback(() => {\n if (!techRef.current) return;\n\n const liveConfig = {\n backBufferLength: 10,\n startLevel: -1,\n } as HlsConfig;\n\n const vodConfig = {\n backBufferLength: 60,\n startLevel: -1,\n } as HlsConfig;\n\n const config = isLive ? liveConfig : vodConfig;\n\n try {\n console.log(\"[Player] URL\", url);\n console.log(\"[Player] Config\", JSON.stringify(config));\n console.log(\"[Player] Version\", Hls.version);\n\n hlsRef.current = new Hls(config) as Hls;\n\n hlsRef.current.attachMedia(techRef.current);\n\n hlsRef.current.on(Hls.Events.MEDIA_ATTACHED, handleMediaAttached);\n } catch (error) {\n throw new Error(`Error initializing Hls: ${error}`);\n }\n }, [handleMediaAttached, isLive, techRef, url]);\n\n const cleanupHls = useCallback(() => {\n if (hlsRef.current) {\n hlsRef.current.off(Hls.Events.MEDIA_ATTACHED, handleMediaAttached);\n\n hlsRef.current.destroy();\n hlsRef.current = null;\n }\n }, [handleMediaAttached]);\n\n useEffect(() => {\n if (Hls.isSupported()) prepareHls();\n\n return cleanupHls;\n }, [cleanupHls, prepareHls]);\n\n return null;\n}\n\nexport default PlayerHlsTech;\n"],"names":["PlayerHlsTech","url","isLive","hlsRef","useRef","techRef","usePlayerStore","s","handleMediaAttached","useCallback","prepareHls","config","Hls","error","cleanupHls","useEffect"],"mappings":";;;AASA,SAASA,EAAc,EAAE,KAAAC,GAAK,QAAAC,KAA8B;AAC1D,QAAMC,IAASC,EAAmB,IAAI,GAChCC,IAAUC,EAAe,CAACC,MAAMA,EAAE,OAAO,GAEzCC,IAAsBC,EAAY,MAAY;AAClD,IAAKN,EAAO,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