Skip to content

Commit fa37773

Browse files
Update README.md
1 parent 0af1102 commit fa37773

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,34 @@ npm install react-create-html-video
1212
2. A lightweight API surface that is easy to understand
1313
3. Helps render a native HTML `<video>` element on the browser
1414
4. 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 */
1941
import { ReactCreateHTMLVideo } from "react-create-html-video";
2042

21-
/* API Signature */
22-
// { mp4: string, webm: string }
23-
2443
/* module */
2544
function UIComponent() {
2645
return (

0 commit comments

Comments
 (0)