One way to achieve faster start-up time for your content is to enable media preloading in our player. This means that the player will start fetching content as soon as page loads (or init method is called on player without the need for a user interaction).
By default the player uses a smart preloading feature that enables preloading when available bandwidth and
devices resources allow it. Media preloading can also be tuned with preload
setting.
preload: String
Radiant Media Player supports the HTML5 media preload
attribute for MP4/WebM progressive download, HLS and MPEG-DASH. Accepted values are
'smart'
, 'none'
, 'metadata'
and 'auto'
. Default:
'smart'
.
'smart'
: this is default and lets the player decide based on device capabilities and
network conditions what is the best preload configuration.'none'
: means no media preloading happens. Media loading starts upon a valid user
interaction.'metadata'
: means only a restricted chunk of content will be preloaded,
generally to acquire information like duration, codec information and such.'auto'
: means media content will be preloaded as much as possible until the
player buffer is full.Media preloading is widely available on desktop browsers - for mobile devices however media preloading requires the following environments:
Media preloading may not always be welcomed by an OS/device. For example on Chrome for Android media preloading is disabled by the OS when viewer is on a cellular network. Radiant Media Player enforces the following rules in order to follow best practices with media preloading:
preload
is set to 'smart', preload is forced
to 'none'preload
setting is
always set to 'auto'
preload
setting is always set to 'auto'
Radiant Media Player API exposes
a startUpTime
getter which can be used to track your average player
start-up time for a given set up (query startUpTime
when firstframe
API event fires). This can be useful to best determine what preloading strategy works for you.
<script src="https://cdn.radiantmediatechs.com/rmp/10.2.0/js/rmp.min.js"></script> <div id="rmp"></div> <script> const src = { hls: 'https://your-hls-url.m3u8' }; const settings = { licenseKey: 'your-license-key', src, width: 640, height: 360, // Here we can tune preloading - 'smart' is default preload: 'smart', contentMetadata: { poster: [ 'https://your-poster-url.jpg' ] } }; const rmp = new RadiantMP('rmp'); // Player initialisation async function initRmpPlayer() { try { await rmp.init(settings); } catch (error) { console.error('Radiant Media Player failed to initialize', error); } } initRmpPlayer(); </script>
©2015-2025 Radiant Media Player. All Rights Reserved. ✝