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");
playerInstance.setup({
image: "POSTER-IMAGE.jpg",
tracks: [{
file:'/CHAPTERS.vtt',
kind:'chapters'
}],
sources: [{
file: "SOURCE-FILE.m3u8"
},{
file: "SOURCE-FILE.mp4"
}],
primary: "flash",
androidhls: "false",
sharing: {
code: encodeURI("<iframe src='http://content.jwplatform.com/players/qkj0QU2s-7yhoVlU0.html' width='640' height='360' />"),
heading: "SHARE THE TRUTH"
}
});
</script>

1 Community Answers

Todd

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 = 'http://ad4.liverail.com/?LR_PUBLISHER_ID=1331&LR_SCHEMA=vast2-vpaid'; } 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 = 'http://www.adotube.com/php/services/player/OMLService.php?avpid=oRYYzvQ&platform_version=vast20&ad_type=linear&groupbypass=1&HTTP_REFERER=http://www.longtailvideo.com&video_identifier=longtailvideo.com,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.