Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shovtyuk committed Aug 24, 2023
0 parents commit 2d09437
Show file tree
Hide file tree
Showing 8 changed files with 3,237 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
.DS_Store
/dist
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.16.0
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# WebRTC Player Lib

WebRTC Player library is a wrapper over [Media Server independent WebRTC player](https://github.com/Eyevinn/webrtc-player) that allows for direct usage within a web browser.

## Getting Started

### Add library to HTML
```html
<script defer="defer" src="webrtc-player-lib-0.12.0.min.js"></script>
```

### Usage
```javascript
const video = document.querySelector('video');
const player = new WebRTCPlayer({
video: video,
type: 'whep',
statsTypeFilter: '^candidate-*|^inbound-rtp'
});
player.load(new URL('https://127.0.0.1:8443/live/whep'));
```

### Full example
```html
<!DOCTYPE html>
<html>
<head>
<script defer="defer" src="webrtc-player-lib-0.12.0.min.js"></script>
</head>
<body>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded",
const video = document.querySelector('video');
const player = new WebRTCPlayer({
video: video,
type: 'whep',
statsTypeFilter: '^candidate-*|^inbound-rtp'
});
player.load(new URL('https://127.0.0.1:8443/live/whep'));
});
</script>
</body>
</html>
```

## Related documentation
- [WebRTC in Softvelum products](https://softvelum.com/webrtc/)
- [WebRTC setup in Nimble Streamer](https://blog.wmspanel.com/2022/05/webrtc-publish-setup-nimble-streamer.html)
- Video: [WebRTC ingest setup in Nimble Streamer](https://www.youtube.com/watch?v=o7DnQuLLerM)
- [Opus audio support in SLDP](https://blog.wmspanel.com/2022/07/opus-sldp.html)
- [Play audio-only SLDP with Opus on iPhone](https://blog.wmspanel.com/2022/09/audio-sldp-opus-webrtc-iphone.html)
Loading

0 comments on commit 2d09437

Please sign in to comment.