Supports WebRTC Signaling from OvenMediaEngine for Sub-Second Latency Streaming
Various protocols: WebRTC, HLS, Low Latency MPEG-DASH (LLDASH), MPEG-DASH
Customizable UI
Supports streaming regardless of browser and media type
Receives the Signaling Protocol from OME (Signaling Protocol conforms to the OME specification)
Automatically Fallback using HLS, MPEG-DASH
Easily create profit by adding Ads in various formats
Supports various subtitle formats: SMI, VTT, SRT
Responsive player regardless of screen size
Installation
There are several ways to install OvenPlayer. Use the one you are comfortable with.
Download from GitHub
You can download it from .
If you have access to , you can download the latest version in development by pressing the Clone or Download button and clicking Download ZIP in the menu that appears.
When you download and decompress it, you will see:
You need an HTML element where the OvenPlayer will be initialized.
<div id="player_id"></div>
Specifying the size or position of the player is possible by changing the style of the wrapper element.
<!-- Wrapper element for sizing or positioning the player -->
<div class="player-wrapper">
<!-- OvenPlayer will be initialized inside this element. -->
<div id="player_id"></div>
</div>
The width of the OvenPlayer is set equal to the width of the container. So with style below, the OvenPlayer will have a width of 1280px.
This React component provides the same functionality as the Vue version, including:
Props such as config (OvenPlayer configuration) and callbacks like onReady, onError, onStateChanged, etc.
Internally, it creates and manages the OvenPlayer instance, listening to all relevant events.
If you need direct access to the internal OvenPlayer instance or want to re-create/remove it programmatically, you can manage it via a React ref or by re-rendering the component with updated props.
Initialize for OME
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OvenPlayer</title>
</head>
<body>
<!-- OvenPlayer will be initialized inside this element. -->
<div id="player_id"></div>
<!-- Load OvenPlayer via CDN -->
<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
<script>
// Initialize OvenPlayer
const player = OvenPlayer.create('player_id', {
sources: [
{
label: 'label_for_webrtc',
// Set the type to 'webrtc'
type: 'webrtc',
// Set the file to WebRTC Signaling URL with OvenMediaEngine
file: 'ws://ome_host:signaling_port/app/stream'
}
]
});
</script>
</body>
</html>
Initialize for Video File
This is a way to play video files in progressive download mode.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OvenPlayer</title>
</head>
<body>
<!-- OvenPlayer will be initialized inside this element. -->
<div id="player_id"></div>
<!-- Load OvenPlayer via CDN -->
<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
<script>
// Initialize OvenPlayer
const player = OvenPlayer.create('player_id', {
sources: [
{
label: 'label_for_video',
// Set the type to 'mp4', 'webm' or etc
type: 'mp4',
file: 'https://github.com/AirenSoft/OvenPlayer/raw/master/docs/assets/OCP_480.mp4'
}
]
});
</script>
</body>
</html>
Initialize for DASH
You need to place the dash.js first, and then ovenplayer.js as shown below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OvenPlayer</title>
</head>
<body>
<!-- OvenPlayer will be initialized inside this element. -->
<div id="player_id"></div>
<!-- You need dash.js to play MPEG-DASH. -->
<script src="https://cdn.jsdelivr.net/npm/dashjs@latest/dist/dash.all.debug.min.js"></script>
<!-- Load OvenPlayer via CDN -->
<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
<script>
// Initialize OvenPlayer
const player = OvenPlayer.create('player_id', {
sources: [
{
label: 'label_for_dash',
// Set the type to 'dash'
type: 'dash',
file: 'https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd'
}
]
});
</script>
</body>
</html>
Initialize for HLS
You need to place the hls.js first, and then ovenplayer.js as shown below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OvenPlayer</title>
</head>
<body>
<!-- OvenPlayer will be initialized inside this element -->
<div id="player_id"></div>
<!-- You need hls.js to play HLS. -->
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest/dist/hls.min.js"></script>
<!-- Load OvenPlayer via CDN -->
<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
<script>
// Initialize OvenPlayer
const player = OvenPlayer.create('player_id', {
sources: [
{
label: 'label_for_hls',
// Set the type to 'hls'
type: 'hls',
file: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8'
}
]
});
</script>
</body>
</html>
Initialize for Ads
You need to set the IMA first, and then ovenplayer.js, as shown below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OvenPlayer</title>
</head>
<body>
<!-- Wrapper element for resizing and positioning the player -->
<div class="player-wrapper">
<!-- OvenPlayer will be initialized inside this element. -->
<div id="player_id"></div>
</div>
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<!-- Load OvenPlayer via CDN -->
<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
<script>
// Initialize OvenPlayer
const player = OvenPlayer.create('player_id', {
sources: [
{
label: 'label_for_video',
// Set the type to 'mp4', 'webm' or etc
type: 'mp4',
file: 'https://github.com/AirenSoft/OvenPlayer/raw/master/docs/assets/OCP_480.mp4'
}
],
// Set the AD tag URL
adTagUrl: "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator="
});
</script>
</body>
</html>
How to Contribute
License
You can also download specific version of OvenPlayer by from .
You can also download the ovenplayer.js and source map via .
For more advanced workflows, installing via is recommended.
Below is a list of simple OvenPlayer initialization methods for each situation. For detailed options when initializing the OvenPlayer, please refer to the chapter.
You can use OvenPlayer as a reusable component.
You can use OvenPlayer as a reusable component.
To play Sub-Second Latency Stream of OvenMediaEngine, set the source type to webrtc and set the file to the WebRTC Signaling URL with OvenMediaEngine. An explanation of the WebRTC Signaling URL can be found .
If you want to play MPEG-DASH, you need the .
If you want to play HLS, you need the .
If you want to use Ads in OvenPlayer, you need the .