File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,15 +12,34 @@ npm install react-create-html-video
12122 . A lightweight API surface that is easy to understand
13133 . Helps render a native HTML ` <video> ` element on the browser
14144 . Provides support for MP4 and Webm based Video displays
15+ 5 . No manual CSS import is required — styles are bundled with the package.
16+
17+ ### 📄 API Type Signature
18+ ``` javascript
19+ export type TReactCreateHTMLVideo = {
20+ mp4 : string ;
21+ webm : string ;
22+ };
23+ ```
24+ ### 🤝 Peer Dependencies
25+ ``` javascript
26+ " peerDependencies" : {
27+ " react" : " >=17" ,
28+ " react-dom" : " >=17"
29+ }
30+ ```
31+ ### 🧪 How This Works
32+ 1 . Detects browser support using ``` HTMLVideoElement.canPlayType ```
33+ 2 . Prefers MP4 if supported
34+ 3 . Falls back to WebM if MP4 is unavailable
35+ 4 . Disables video rendering on Internet Explorer
36+ 5 . Returns ``` null ``` when no supported format is available
1537
1638### 🔤 Example Usage
1739``` javascript
1840/* node modules */
1941import { ReactCreateHTMLVideo } from " react-create-html-video" ;
2042
21- /* API Signature */
22- // { mp4: string, webm: string }
23-
2443/* module */
2544function UIComponent () {
2645 return (
You can’t perform that action at this time.
0 commit comments