How to implement HLS streaming in hbbtv
P粉278379495
P粉278379495 2024-02-17 16:29:05
0
1
356

The problem is implementing HTTP Live Streaming (also known as HLS) in HbbTV I can't find the solution

For example I tried this

<!DOCTYPE html>
<html>
<head>
  <title>HbbTV Stream</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script type="text/javascript">
    function initApp() {
      var videoElement = document.createElement("video");
      videoElement.setAttribute("type", "application/vnd.apple.mpegurl");
      videoElement.setAttribute("src", "http.//example.com/test.m3u8");
      videoElement.setAttribute("data-fullscreen", "true");
      videoElement.setAttribute("data-pauseonexit", "true");
      videoElement.setAttribute("autoplay", "");
      videoElement.addEventListener("error", function(e) {
        console.log("Video error:", e);
      });
      document.body.appendChild(videoElement);
    }
  </script>
</head>
<body onload="initApp()">
</body>
</html>

P粉278379495
P粉278379495

reply all(1)
P粉594941301

This won't help with older devices, but if you're targeting HBBTV 2.0.3 or higher, the device should support Media Source Extensions, so you can try using javascript player, such as hls.js or similar.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!