Video on request streamin with jwplayer wowza problem for Android

I'm trying to get jwplayer to work on an Android phone, when I install the rtsp protocol file source, it works fine in Android, but it displays an error that the file cannot be played on iOS and PC

without using an rtsp file to work with PC and iOS with a source of files, rtsp only works in android

jwplayer("mediaplayer").setup({ playlist: [{ sources: [ {file:'rtmp://localhost:1935/vod/mp4:dexter.mp4'}//used it to PC , {file:'rtsp://localhost:1935/dexter/dexter.mp4'}// used it to android, {file:'http://localhost:1935/vod/mp4:dexter.mp4/playlist.m3u8'}//and this for iOS ], title: 'dexter', width: 854, height: 480, }); 
+6
source share
3 answers

I solved the problem by checking if the device is an android or not.

  var ua = navigator.userAgent.toLowerCase(); var isAndroid = ua.indexOf("android") > -1; jwplayer("mediaplayer").setup({ playlist: [{ sources: [ (isAndroid)?{file:'rtsp://localhost:1935/vod/dexter/dexter.mp4'}:{file:'rtmp://localhost:1935/vod/mp4:dexter/dexter.mp4'}, {file:'http://localhost:1935/vod/mp4:dexter.mp4/playlist.m3u8'} ], title: 'dexter', width: 854, height: 480, }); 
+3
source

You cannot put RTSP inside installation (), block, because neither Flash nor HTML5 support it.

You must complete the work described here - http://www.longtailvideo.com/support/jw-player/28856/using-apple-hls-streaming

HLS Live on Android

For live broadcasts, there is still no good solution for playback on Android or other mobile platforms other than iOS. One way is to offer a native Android application that can support HLS streams. However, this is beyond the scope of JW Player. Another option, if you are using Wowza Media Server, is to offer a backup RTSP stream for devices that do not support HLS. For instance:

 <div id="myElement"> <a href="rtsp://example.com/vod/mp4:myVideo.mp4">watch this stream over RTSP</a> </div> jwplayer("myElement").setup({ file: "http://example.com:1935/vod/mp4:myVideo.mp4/playlist.m3u8", image: "/assets/myPoster.jpg", fallback: false }); 
+1
source

What no one mentions is the terrible latency that HLS brings to the table with “chunk video”, it can be 30 seconds if you are doing live streaming, for example, video monitoring, RTMP and RTSP are the best solutions . RTSP works well on iOS and Android via VLC with a delay of 1 to 2 seconds.

0
source

Source: https://habr.com/ru/post/949115/


All Articles