问题是在 HbbTV 中实现 HTTP Live Streaming(也称为 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> Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这对旧设备没有帮助,但如果您的目标是 HBBTV 2.0.3 或更高版本,设备应支持 媒体源扩展,因此您可以尝试使用基于 javascript 的播放器,例如 hls.js 或类似的。