Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Android HLS

I'm trying to prevent Android 4.1 and higher from playing HLS, but two devices play it despite including "androidhls: "false" " in my embed code. The way I'm testing this is I have a primary .M3U8 source, and the MP4 source is a different video entirely. When I play it on Android 4.1 and Android 5, both play the HLS. Android 5 actually plays it "ok", but I'm trying to ensure that no android devices play it at all, so the only way I can verify that is if my 4.1 device, and my Android 5 device default to the MP4 file. Right now, neither of them do. Here is the embed I"m using:

<div id="myElement">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
image: "POSTER-IMAGE.jpg",
tracks: [{
sources: [{
file: "SOURCE-FILE.m3u8"
file: "SOURCE-FILE.mp4"
primary: "flash",
androidhls: "false",
sharing: {
code: encodeURI("<iframe src='' width='640' height='360' />"),
heading: "SHARE THE TRUTH"

1 Community Answers


JW Player Support Agent  
0 rated :

We do not have built-in functionality to block HLS streams from playing on Android devices, but you could do some user agent detection and set your setup parameters accordingly. Here’s a sample code example to choose the video, image, and ad tag URLs:

<script type="text/javascript"> if (navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/g) == null) { //if not a mobile device document.write('You are not using a mobile device<br>'); var primaryMode = 'flash'; var videoUrl = 'bunny.mp4'; var imageUrl = 'bunny.jpg'; var adTag = ''; } else { //this is for mobile devices document.write('You are using a mobile device<br>'); var primaryMode = 'html5'; var videoUrl = 'tears.mp4'; var imageUrl = 'tears.jpg'; var adTag = ',test'; } jwplayer('player').setup({ primary: primaryMode, image: imageUrl, file: videoUrl, advertising: { client: 'vast', tag: adTag } }); </script>

This question has received the maximum number of answers.