These examples demonstrate the basic setup of the Ravnur Media Player with different types of media sources.
useHTMLPlayer: true for native HTML5 player or useHLSJSPlayer: true for HLS.js player in the options. Basic video playback with a single video source.
const mediaSource = {
id: 'video-demo',
src: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
type: 'application/x-mpegURL',
title: 'Big Buck Bunny',
poster: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Big_buck_bunny_poster_big.jpg/1200px-Big_buck_bunny_poster_big.jpg'
};
player.setup(mediaSource);
Audio playback with simplified UI optimized for audio content.
const mediaSource = {
id: 'audio-demo',
src: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
type: 'audio/mp3',
title: 'SoundHelix Song #1'
};
const options = {
isAudio: true // Enables audio-optimized UI
};
player.setup(mediaSource, options);
HTTP Live Streaming (HLS) is an adaptive bitrate streaming protocol developed by Apple. It's widely supported across different platforms and devices.
const mediaSource = {
id: 'hls-demo',
src: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
type: 'application/x-mpegURL',
title: 'HLS Stream Example',
poster: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Big_buck_bunny_poster_big.jpg/1200px-Big_buck_bunny_poster_big.jpg'
};
player.setup(mediaSource);
Dynamic Adaptive Streaming over HTTP (DASH) is an adaptive bitrate streaming technique that enables high quality streaming of media content over the internet.
const mediaSource = {
id: 'dash-demo',
src: 'https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd',
type: 'application/dash+xml',
title: 'DASH Stream Example',
poster: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Big_buck_bunny_poster_big.jpg/1200px-Big_buck_bunny_poster_big.jpg'
};
player.setup(mediaSource);