I was making an app in react-native where I had to stream audio from a http (non secure) url. The app works well in debug mode but when I tried using the release version the audio didn't play in phones having Android 9 and above. I am using this Library.
I can't create the SSL for the link. Also I have tried with some SSL secure links (https) the library works fine with Secure Links, but due to certain restrictions I have to use the http link only.
Note: The audio streams well in Android 8 and below. I have tried using a WebView to play the audio didn't work.
Update:
1: Get yourself a https link for streaming your audio.
( If you can't do that )
2: Host up a proxy audio streaming server with your non secure http link
Keep coding š
Related
Iām currently working on a web application whose main purpose is streaming/timeshifting TV channels. Application is written in Javascript React framework and for web player we are using CookPete ReactPlayer with integrated hls.js. We have managed to successfully play live TV channels but unfortunately, we are experiencing some issues with timeshifting channels
Live streams are distributed over XtreamUI server as a m3u8 lists, and have this kind of format
example.org/live/username/password/channel_1.m3u8
So when a user is watching Live TV this kind of URL goes to the player source and CookPete player + hls.js are doing their magic with parsing/processing m3u8 list which results in playing video flawlessly.
Here comes the problem, for timeshift XtreamUI are using this kind of URL example.org/streaming/timeshift.php?username=XXX&password=XXX&stream=2&start=2020-04-26:19-23&duration=7
As you can see its PHP script which STREAMS raw bytes into the player. Here are response headers from /streaming/timeshift.php
As you can notice, the Content-type is video/mp2t which for some reason cannot be played in the browser environment.( Google Chrome, Mozilla Firefox, IE 11). This warning pops up.
On the other hand, Safari browser on Mac video is playing completely normal, but the request from Safari is a little bit different. This is a screenshot from Safari's console network tab. As you can see there are several requests with different byte-ranges.
We are seeking a solution which will provide playing timeshift video (video/mp2t content) in Google Chrome, Mozilla Firefox and IE 11. All suggestions/advices are welcome.
the Content-type is video/mp2t which for some reason cannot be played in the browser environment
This is because chrome and Firefox do not support mpeg transport streams, and safari does. hls.js works because it knows how to read a binary ts file, and rewrite it as mp4 fragment before sending to the the media source extensions buffer. You will need to do the same. Take a look at mux.js.
In Firefox install a codec by running this command.
sudo apt-get install libavcodec58
Install a similar codec in chrome too. It should fix the problem.
Browsers enforce https when using getUserMedia. I am working on a web app made to be used on a local network rather than actually connecting to the internet so going for a typical TLS cert won't really work. If I use a webview in an iOS app, would getUserMedia work when pointing the view at an IP address serving a website?
We are working on an IP camera Android app that should stream the video took in real-time by the Android camera to a Web page served by the same app and accessed through WiFi only.
The app currently use a pseudo-streaming method (an image sent using HTTP with no-store), but it is not robust enough, so we need to change it for a better streaming method. We also need to support multicast (or at least an optimized "multi-unicast"), and if possible use an UDP protocol (or at least a low-latency TCP protocol).
We cannot use any intermediary server (so no Wowza or the like, unless it is also served by the app) or any browser plugin (so no VLC or the like, unless it is served by the app too). The main browser it is used on is Chromium.
We searched for and tried a lot of methods but none worked for us :
WebRTC sounds cool, but it uses an intermediary signaling server, it doesn't support multicast, and it is kind of heavy for what we want
RTSP with libstreaming sounds cool too, but no browser seems to implement it, and we couldn't find a Javascript library to do it.
RTMP works on most browsers, but we could'nt find a working Android library
Which streaming method would be best for our needs, and do you know Javascript and Android libraries implementing them ?
There is no way to stream multicast to a browser.
I'm trying to create game with WebRTC (Peer.js). And I can't make video calls through "http"... Maybe It works only through https?
P.S. All working (that I saw) examples for media calls use https!
1) http://cdn.peerjs.com/demo/videochat/ (doesn't work)
2) https://simplewebrtc.com/demo.html (works)
It's not webrtc but the getusermedia API is supported only over secure origins (https://www.chromium.org/Home/chromium-security/deprecating-powerful-features-on-insecure-origins).
So you can use localhost for testing on your machine but for deployment, you will need https.
I'm using the SoundCloud public API for playing audio in a browser from the SC servers with the JavaScript SDK 3.0.0. After initialization, I managed to get a JSON with a specific track's stream URLs with the SC.Stream method.
{
"http_mp3_128_url":"https://cf-media.sndcdn.com/a6QC6Zg3YpKz.128.mp3...ā ,
"hls_mp3_128_url":"htt...//ec-hls-media.soundcloud.com/playlist/a6QC6Zg3YpKz.128.mp3/...ā ,
"rtmp_mp3_128_url":"rtmp://ec-rtmp-media.soundcloud.com/mp3:a6QC6Zg3YpKz.128?...",
"preview_mp3_128_url":"htt....../ec-preview-media.sndcdn.com/preview/0/90/a6QC6Zg3YpKz.128.mp3?..."
}
In it, there is an HTTP, an HLS and an RTMP URL. I can handle the HTTP, but I can't get the RTMP working. Does anyone know how is it decided which stream will be played? And how can I manipulate this? Or how can I access the RTMP stream?
A few weeks ago I checked with WireShark that SoundCloud delivered via RTMP, but now I can't seem to capture any RTMP streams, and I don't know how to search for one.
Usually RTMP stream is used from Flash Media Server, Wowza Media Server and Red5 server.
You can play that type of stream using a flash object in your web page like:
enter link description here
Or for application - you can play with ffplay and convert to other type of stream with ffmpeg
I've been working on the same thing. It plays using the HTTP protocol in Dev mode and then reverts to attempting to use the RTMP protocol in normal browsing mode (at least in chrome anyway). Here's how I solved the issue..
When you use the sc.stream request it will return the object to play. You can edit this object before it gets sent to the player.
For example:
SC.stream('/tracks/'+playr.currentTrack.id).then(function (x) {
x.options.protocols=["http"];
x.play();}
Setting the protocol object parameter as above forces it to use the correct protocol, if you console log it first by trying to play the track in non-dev mode you'll see it also contains the ["rtmp"] protocol, and then fails to play in chrome.