The player will parse SEI packets with resolution payloadType 5 based on H.264 specification for HLS (for default hls.js based streaming). Now you can write custom data to a HLS H.264 stream and get those data from API method
getMetadata
upon meta
API event.
meta
: this event fires each time new SEI packets custom data are available
When invoked, this method will return Object|null
representing the current SEI packets custom data. The returned
Object
when available will have the following structure:
{ data: { samples: [ pts: 0, payloadType: 5, uuid: "8fbb6c74-7c3e-4f78-9f7-8cb35d3c177e", userDataBytes: Object, userData: "some user data" ] }, type: "sei" }
<script src="https://cdn.radiantmediatechs.com/rmp/5.11.5/js/rmp.min.js"></script> <div id="rmpPlayer"></div> <script> var src = { hls: 'your-hls-stream-with-sei-packets-with-resolution-payloadType-5' }; var settings = { licenseKey: 'your-license-key', src: src, width: 640, height: 360 }; var elementID = 'rmpPlayer'; var rmp = new RadiantMP(elementID); var rmpContainer = document.getElementById('rmpPlayer'); // We listen to meta API event rmpContainer.addEventListener('meta', function () { // Each time meta event fires, getMetadata API method is updated and can be queried console.log(rmp.getMetadata()); }); rmp.init(settings); </script>