How to play MP4 videos from Youtube? - javascript

I need to play videos from Youtube as MP4.
My system (an Android Phone) does not support Flash.
It can play MP4 videos.
So I'm thinking of creating a web page that plays videos from Youtube.
I need to get MP4 videos to play in my page.
What approaches are there?

Take a look at this related question, where the OP has figured out a hacky way to get the necessary ID and checksum parameters for the get_video "API".
Streaming Youtube Videos
He successfully played back the stream in the VideoView component.
You can use the fmt parameter for choosing which format you want, see wikipedia for a list: http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs
Good luck.

Did you actually try viewing videos? I have the Droid Eris, which shipped with a YouTube app. Try going to the mobile version of YouTube and see if that works out.
Google created Android. Google owns YouTube. Transitivity says you shouldn't have any problems.

Why not consider using Mobile youtube interface

Youtube provides alternative RTSP(real time streaming protocol) links for all existing videos.. dig into youtube api and try to get it.
once you get it you can try code playing the video invoking the inbuilt player to play those videos
Cheers.

Related

Is there a way to get the audio playing from the speakers of a device

So I've been battling with an issue for a while now, I've been trying to get the audio playing through the speakers of a device using the MediaDevices singleton object in javascript.
I'm trying to achieve something similar to Shazam or snapchat where they can both get the audio playing from the speakers of a device and also from a microphone so that I can for instance be taking a video using my microphone and video cam and also streaming the sound playing from the background.
I'll like to know if this is possible because I tried using devices with kind of "audiooutput" and deviceId of "default" accessible through the enumerateDevices method assuming that's the device's output speaker but I still get the audio from the microphone even when using the device kind of "audiooutput".
Note: I'm able to combine multiple audio nodes successfully.
I'm not asking for a do it for me answer, just a theory of how to go about implementing it if it's possible in javascript.
Thanks in advance :D
No, this isn't possible via the Web Audio API. Not all platforms even support this capability.
On some platforms, you can use getDisplayMedia() and get audio with it, but compatibility isn't great right now.

React-Native and playing music from the Soundcloud API?

I am just getting started with React-Native. Does anyone have any experience getting soundcloud songs to play? I have tried an iframe webview, but I need the song to be playing while surfing through the app. The webview only allows for me to play something while the webview is open.
I am thinking the best way to do this would be to have an invisible iframe webview that never gets refreshed. Is this possible?
I've also tried using the react-native-sound package, however I can't use that to stream from the soundcloud Stream URL.
Does anyone have any ideas/worked with this before?
I would recommend a more native implementation.
There is an Objetive C/Cocoa (iOS) wrapper available that supports the audio streaming. https://github.com/soundcloud/cocoa-api-wrapper
There is also an Android one (it looks like support was discontinued, but still should work) https://github.com/soundcloud/java-api-wrapper
You can wrap those using Native Modules and let the OS handle the playing of the audio. It will work better than some WebView based circumvention.
I have a suggestion.
Use this library for soundcloud api in react-native.
https://github.com/nhayflick/ReactNativeMusic

javascript disabled - youtube videos playing

Can anybody explain to me how are YouTube videos playing even with disabled JavaScript in browser? Is there any server side scripting or any other technique involved? Thank you very much.
Youtube serves pure mp4 files, if your browser supports HTML5 or you got any other player plugin installed, it will work this way. On cellphones without HTML5 support or Flash, you may simply download those files. Flash player implementation on Youtube does not work without js.
I see YouTube player use an Adobe Flash not HTML5 :)
Player in HTML5 (not by default) doesn't work without JS. (most YouTube buttons, options and others too)

Best option for streaming audio in-browser, for mobile too?

I'm trying to find a solution for my website which desperately needs an upgrade. Currently I am using Flash-based players to stream content from Shoutcast, which doesn't work too terribly, but unfortunately it leaves mobile users behind.
Ideally, I would love to have an HTML5/Javascript player that can play Shoutcast (or other) streams online. I've tried jPlayer, which seems pretty good for playing individual files, but have been unsuccessful in trying to get it to work with Shoutcast and Icecast.
Does anybody have any suggestions on where to start?
You can use jPlayer to play your shoutcast stream using HTML5 native player - it works quite well on most browsers/platforms except android. In that case jPlayer provides the flash player backup.
You need to specify your type of audio as 'mp3' (aac streams do not work so make sure you are specifying a straight icy mp3 stream) I have used 'mp3' but you can also try type 'stream'
You need to change the url of your stream slightly:
Normal: http://yourserver.com:8000/listen.pls
jPlayer: http://yourserver.com:8000/;listen.pls
(note the addition of the semicolon - this helps with shoutcast servers)
Here is the documentation from the jPlayer site that should help as well.
http://www.jplayer.org/latest/demo-08/
Happy Streaming!

Streaming Audio on my website

I am interested in streaming audio on my website, but I have no clue where to begin. There are two types of streaming I hope to achieve. The first would be streaming a playlist of songs stored on the server and the second would be live audio streaming. Can anybody recomend any good sites or plugins to use?
SoundManager2 could cover the client side stuff (cross-platform, uses flash) and any web server can be used to serve audio files that could be used in a playlist. Live streaming is a bit more complicated but could be accomplished using IceCast or mpd.
What you're looking for is a streaming audio server.
A Google search should help you locate a server or software that best fits your needs.

Categories