Embed a player (Web Player)
Learn how to embed a player with content.
After adding the player library to your site, you can instantiate the player and play content.
Basic content playback
The following steps and code sample show how to play a single media asset with the player:
- Create a named
<div>
in the<body>
of your page in the location where the player should appear. - Call
setup()
with the playlist property to instantiate the player in the named<div>
.
<div id="myElement"></div>
<script type="text/JavaScript">
jwplayer("myElement").setup({
"playlist": [{
"file": "{media_resource_url}"
}]
});
</script>
In addition to instantiating an instance of a player, setup() allows you to enable and configure player features. setup() is one of several methods that can be used to interact with the player.
Updated 6 months ago