MPMoviePlayerController Play Live Stream - objective-c

I am making a Radio app for my website and I tried to use MPMoviePlayerController to access my streaming (.pls) file actually shoutcast but it doesn't work>
Any help or snippet to do that ?

Apple recommends you use HTTPLiveStreaming for audio/video streams. Do a little digging and I'm sure you could figure it out.
If it's a live stream, a playlist, or something like that, you can just use the API to create an m3u8 playlist that your MPMoviePlayerController can stream. Check out the docs and guides at the link below:
HTTP Live Streaming Resources - Apple Developer

Related

video live streaming application in React Native

I am trying to implement video live streaming
live streaming and
upload it to server and
save the streaming video (Playback)
in react native can any one help me with a sample project
this is will be helpful https://www.npmjs.com/package/react-native-video
for point upload it to server, what exactly do u need upload? video uploading or something else?
So - you'll need a backend server that can accept a video stream, and convert it into a stream that can be consumed in React Native. You'd also like the server to save the streamed video, and encode it so it can be played back as video on demand (VOD) after the stream has stopped. None of this is React - it'll all be done on the backend.
You can build all this yourself, but there are a number of APIs that can do this for you. Disclaimer: I work for one such company: api.video. (A Google search will find others)
For livestreaming from the browser, you can use getUserMedia and stream to a server. (you can see my demo using JavaScript at livestream.a.video. This stream wil be visible to all your users, and then also recorded and saved as VOD for later playback.
To upload a recorded video - you can use file.slice() to break the video into manageable chunks, and upload to the server - for transcoding into a video stream (demo at upload.a.video, and tutorial.)
For playback, these APIs will give you a player URL or the m3u8 url that you can incorporate into a video player. This is your React Native part - and there are several video players that you can add into your application to playback HLS video. At api.video, we have our own player, and also support 3rd party players.

Is it possible to play Youtube stream as sound in Flutter?

For example, if I want to stream a live video from Youtube as a stream in audio player, can I do it in Flutter? I can't seem to figure out how to get a direct link to the sound, so I don't know if it is possible. If not, do you guys have any alternatives?
At the moment I am using Audioplayers library, but if it can't support streaming, any suggestions how to do this?

How can I play an m3u8 video live instead of playing old segments?

I have an m3u8 video that if I just start with the first segment it is behind the live version of the stream. But in some players it plays live just fine, so my thinking is that there must be some magical way of knowing how to play the stream live but I don't see anything on the manifest telling me this.
So what should I be looking for?
Thank you.

#sonos unable to play live radio having streaming url m3u8 extension

I have implemented same thing refered to doc
http://musicpartners.sonos.com/node/83
for live radio streaming. the streaming url is like http://example.com/abc.m3u8
but this live stream is unable to play by sonos player. please suggest or ask me for more info.
Well, it's difficult to answer your question with so little information, but you shouldn't return the streaming URL with getMetadata as it seems you are doing. You should return the URL as a result of getMediaURI requests.

How can I stream only the sound of a video from YouTube? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I would like to stream only sound from youtube. I need this for IOS but others can be ok. I have searched on stackoverflow but I couldn't find. Because I don't want to use another software, I want to directly stream only sound of youtube video by code. Also It should work on background.
Flashgot (for Firefox) has a way to download only the audio of a Youtube video. It exposes links to the audio that looks like this:
https://r3---sn-p5qlsu7d.googlevideo.com/videoplayback?id=887ce37c617a3225&itag=141&source=youtube&requiressl=yes&gcr=ca&ratebypass=yes&mime=audio%2Fmp4&gir=yes&clen=4012348&lmt=1409362978343745&dur=125.828&signature=0A00B9B16BB6EF3192DF33EEF9B2AB67F66F501F.0B649D407144B914A7CC7BE00E795B5BD1B9D932&upn=VFAbXgDGSU8&key=cms1&fexp=900718%2C924231%2C924637%2C927622%2C930809%2C931354%2C932404%2C9405454%2C941004%2C943917%2C945066%2C947209%2C947218%2C948124%2C952302%2C952605%2C952901%2C955301%2C957103%2C957105%2C957201&sver=3&ip=24.235.37.181&ipbits=0&expire=1419930614&sparams=clen,dur,expire,gcr,gir,id,ip,ipbits,itag,lmt,mime,mm,ms,mv,ratebypass,requiressl,source&cmbypass=yes&req_id=3eb2c618c54ca3ee&redirect_counter=2&cms_redirect=yes&mm=26&ms=tsu&mt=1419909012&mv=m
OK, so that is a very big link. This is the same link dissected into pieces:
https://r3---sn-p5qlsu7d.googlevideo.com/videoplayback?id=887ce37c617a3225
&itag=141
&source=youtube
&requiressl=yes
&gcr=ca
&ratebypass=yes
&mime=audio/mp4 #Here's where audio only is specified.
&gir=yes
&clen=4012348
&lmt=1409362978343745
&dur=125.828
&signature=0A00B9B16BB6EF3192DF33EEF9B2AB67F66F501F.0B649D407144B914A7CC7BE00E795B5BD1B9D932
&upn=VFAbXgDGSU8
&key=cms1
&fexp=900718,924231,924637,927622,930809,931354,932404,9405454,941004,943917,945066,947209,947218,948124,952302,952605,952901,955301,957103,957105,957201
&sver=3
&ip=24.235.37.181 #Oh, look. My IP address.
&ipbits=0
&expire=1419930614
&sparams=clen,dur,expire,gcr,gir,id,ip,ipbits,itag,lmt,mime,mm,ms,mv,ratebypass,requiressl,source
&cmbypass=yes
&req_id=3eb2c618c54ca3ee
&redirect_counter=2
&cms_redirect=yes
&mm=26
&ms=tsu
&mt=1419909012
&mv=m
Very interesting. This enables Flashgot to download only the audio and skip the video, thus saving bandwidth. I'm missing details, like how Flashgot created this link, but if Flashgot has a way to do it, it stands to reason that other HTTP clients could do it too.
You can't. The data stream that you receive from youtube includes both video/audio streams.
What you do with the data, it's up to you. This thread has interesting info on the subject.
According to the Youtube API blog post, the only options you have of playing youtube on iOS is to link to the video (and have the internal YouTube app play the video), or link from a UIWebView and play from there.
Audio-only playback is not supported.
I would use a MPMoviePlayerController and hide it's view.
Using Audacity software, you could record the audio played on your computer from any source. Since Audacity is open source and you can find open source browsers, you could combine them and get the audio from youtube. Of course its a lot of work, but I am only saying it could be possible unlike others.
In Linux:
mps-youtube a CLI solution. More details here.
VLC can do that too if started without video - more here.
mplayer can be used with the command mplayer -novideo URL
mpv can be used with the command mpv --no-video URL
Youtube Viewer, a CLI video player can be also used as indicated here.
A cross-platform solution:
As indicated in another answer the Flashgot addon for Firefox can identify in order to download an audio of a Youtube video. It will display a list of available streams for each video.
The idea is to start the youtube stream in an external player, but to be able to select only the audio stream with the Flashgot addon in Firefox by adding the external player as Flashgot "downloader" (like here) and then, after starting the youtube video in Firefox, using Flashgot to play only the audio stream by going to 'Available formats/DASH (separate audio and video tracks)'
[
and select the specific audio track.
[
Multimedia players can be assigned in Flashgot instead of a downloader, like VLC or SMPlayer, as most video players seem able to do the job (in Linux; for Windows, see below update); or even audio players like Clementine, although some audio players may not work.
It will start after a few seconds, some players after more than others. The fastest in Linux seems to be SMPlayer .
UPDATE:
Flashgot has to be up to date.
In Windows, Flashgot seems to display some audio streams in a different location than in the above image, that is already on the first list (before the DASH list). SMPlayer works the best AFAICT. VLC works, but not with all the audio streams listed by Flashgot. Clementine, Foobar2000 and XMPlay failed. It may be an overall-Windows codecs problem. MPC-HC starts but doesn't buffer correctly and stops long before it should.
There are separate streams for audio and video. This is by default in mp4 to flash conversion.
You can get the combined stream in flash format or separate in mp4 form.
Exemple:
[Headphones Stereo Test (HD)][youtube.com/watch?v=ZjAQylVPU3I]
contain
[the flash stream][youtube.com/v/ZjAQylVPU3I]
containing the combination of
audio stream and video stream in mp4 format.
*I'm sorry but the links will not work because they are customized based on ip , expire data , and other things.
To get these links i used uBlock origin for chrome because it has the logger function showing all connections made to server.
search for : mime=video and you can see all links then remove the range to get full length. Same with mime=audio and also you can use that for stream in other flash players but it is against the Terms of Service.