Hi everyone,
I’m developing an extension that plays live MPEG-TS (.ts) IPTV streams using Android WebView + mpegts.js.
The player initializes successfully, and some of the the stream starts playing correctly. However, after 5–10 seconds (sometimes a little longer), playback freezes automatically. Audio and video stop because the buffered data is exhausted.
If I destroy and reinitialize the player, it immediately plays another few seconds and then freezes again. This behavior repeats every time.
Important observations:
The same TS URLs play continuously in VLC and other IPTV players.
The issue occurs with multiple TS streams, so it doesn’t appear to be stream-specific.
The extension can always reconnect manually by reinitializing the player, which suggests the initial playback is working but continuous streaming is not.
Would anyone please help me to solve the issue ? MpegTsPlayer.java (16.7 KB) index.txt (37.2 KB)
(Html file is uploaded in .txt formate)
I took a look at the code, and to overcome the compatibility limitations and instability of IPTV/MPEG-TS streams in a WebView, you could consider integrating ExoPlayer natively.
It supports HTTP-TS streams, audio/subtitle track switching, and adaptive buffering far better than a WebView.
On the JavaScript side, we’d only need to expose a simple interface for the basic controls (play, pause, seek), while leaving all the heavy decoding work to Exo.