Getting started with HISPlayer SDK
Basic usage of HISPlayer SDK is very easy:
- Create a simple HTML page with a div element.
- Assign a position and dimensions to the element.
- In your application's JavaScript -
- Create a HisPlayer object.
- Create a config.
- Provide the license key to the config object.
- Init the player.
Note: in order to get a license key send a request at the HISPlayer website.
<!DOCTYPE html>
<html>
<head>
<!-- HISPlayer library: -->
<script src="hisplayer.js"></script>
<!-- Your application source: -->
<script src="myapp.js"></script>
</head>
<body>
<div id="player" style="position:relative;width:640px;height:360px;"></div>
</body>
</html>
// myapp.js
function initApp() {
const player = new hisplayer.HisPlayer();
const config = {
licenseKey: <YOUR_LICENSE>,
div: document.getElementById('player'),
src: 'https://playertest.longtailvideo.com/adaptive/aes-with-tracks/master.m3u8',
// Optionally enable the UI
ui: {
enabled: true,
},
};
player.init(config);
}
document.addEventListener('DOMContentLoaded', initApp);