>  Q&A  >  본문

hbbtv에서 HLS 스트리밍을 구현하는 방법

문제는 HbbTV에서 HTTP 라이브 스트리밍(HLS라고도 함)을 구현하는 것입니다. 해결책을 찾을 수 없습니다

예를 들어 저는 이것을 시도했습니다

<!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粉278379495P粉278379495245일 전351

모든 응답(1)나는 대답할 것이다

  • P粉594941301

    P粉5949413012024-02-18 12:10:31

    이것은 구형 장치에는 도움이 되지 않지만 HBBTV 2.0.3 이상을 대상으로 하는 경우 장치는 Media Source Extension을 지원해야 하므로 hls.js와 같은 자바스크립트 기반 플레이어를 사용해 볼 수 있습니다. 또는 이와 유사합니다.

    회신하다
    0
  • 취소회신하다