File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ const youtubeVideoSrc = {
1414 ] ,
1515} ;
1616
17+ /**
18+ * Root React component that renders a heading and a Plyr video player configured with `youtubeVideoSrc`.
19+ *
20+ * @returns {JSX.Element } The app UI containing a header and the Plyr player.
21+ */
1722function App ( ) {
1823 const ref = useRef ( null ) ;
1924
Original file line number Diff line number Diff line change @@ -71,6 +71,19 @@ const getAPI: GetAPI<PlyrInstance, PlyrConfigurationProps> = (
7171 } ) ;
7272} ;
7373
74+ /**
75+ * Connects a video element ref to a Plyr instance and exposes a forwarded API ref.
76+ *
77+ * Initializes and manages the Plyr lifecycle using the provided `params`. The returned ref
78+ * should be attached to the underlying <video> element; the forwarded `ref` receives an
79+ * API object (shape: { plyr: PlyrInstance }) that is safe to use from parent components.
80+ *
81+ * @param params - Configuration for the Plyr instance: `source` (media source or null) and
82+ * `options` (Plyr options or null). Changes to these values will reconfigure the player.
83+ * @param deps - Optional dependency list controlling when the underlying aptor logic runs.
84+ * If `null`, defaults to [params.options, params.source].
85+ * @returns A ref to attach to the <video> element that Plyr will control.
86+ */
7487export function usePlyr (
7588 ref : Ref < APITypes > ,
7689 params : PlyrConfigurationProps ,
You can’t perform that action at this time.
0 commit comments