How to create a live stream player in WebOS for play M3U playlist (IPTV)?

1.9k Views Asked by At

I'm trying to develop an app for LG WebOS TVs.

The app should list the content of an M3U URL with some live stream. WebOS uses HTML and Javascript, I tried using the video tag, but it doesn't work with the playlist url, and it doesn't work with a live stream url, it only works with a non-live url.

There is not much information about live stream for WebOS on the LG website, nor on the official WebOS website.

Does anyone know how I can do this?

1

There are 1 best solutions below

0
Jura Herber On

I did this with hls.js

<!DOCTYPE html>
<html>
<head>
    <script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
</head>
<body>
    <video id="player" autoplay="autoplay" crossorigin="anonymous" width="1920" height="1080" data-setup="{}"></video>

    <script>
    if( Hls.isSupported() ) {
        var oAvPlayer = document.getElementById('player');
        var oHlsApi = new Hls();
        oHlsApi.subtitleDisplay = false;
        oHlsApi.attachMedia(oAvPlayer);

        // Play channel
        oHlsApi.loadSource('https://rakuten-spotlight-3-eu.rakuten.wurl.tv/playlist.m3u8');
        oHlsApi.startLoad();
    }
    </script>
</body>
</html>