Stream Audio from Android to Chromecast - android

I have a music player in Android, which uses android.media.MediaPlayer to play music from the SD card.
I would like to add the ability to cast the music to a Chromecast device.
I have played around with the democastplayer demo app. Specifically I tried to get the MediaRouteSelector to work with a 'live audio' route, but the 'cast' action button didn't show (suggesting live audio is not supported perhaps?). I also tried a few other things, but had no luck getting democastplayer to send MP3 audio to Chromecast.
Is streaming/sending local SD MP3 files to Chromecast even possible? If so, are there any sample apps or open source projects I can refer to?
Thanks in advance.

You need to add/write a small web server to your android application so it can serve the local media. Then have your sender application send the url of the media (that your local server is serving) to chromecast so it can play the music directly served from your phone.

Yes, Possible to stream your MP3 files by sending file url to chromecast device you can be using remote media player to load the media file. Refer this sample https://github.com/ovingalafsal/ChromeCastSampleApp it might be helpful

Related

How to play .mts video file within an application

I have an android application for live streaming and recording from a hardware device through wifi. The hardware device can store images and video within the hardware and we can transfer these videos to our mobile application. I am getting the videos and able to download it to my mobile memory. But The video received in .mts fomat and unable to play it using android native MediaPlayer class. I would like to ask you is there any method/library available to play .mts videos . Thanks in advance
Default native MediaPlayer does not support the .mts file format. Better you use vitamio library for that. refrence link - https://stackoverflow.com/a/8261864/3912847 & https://karanbalkar.com/2014/11/tutorial-92-live-streaming-using-vitamio-in-android/
You can download the vitamio library form here

How to play android local media to DLNA Renderer?

I am trying to play android local media on DLNA renders.
I am currently able to play any global visible media on DLNA renderer which have URI starts with http://172.168.1.1:4566/content_media/file1297834.mp3 this media is also play on any web browser,
But when I try to play local media which have file URI like file;//storage/content/media/file.mp3; is not playing on DLNA Renderer.
I am aware of that local file need to remotely visible for playing so I have try some options: -
First One I open a android socket and write file into output stream of socket.
But it is not playable on DLNA device.
I think it is because android socket write row data into out put stream which DLNA renderer is not able to read.
Second I try with "https://github.com/julesbou/simple-framework"
simple framework, It also help to open socket
with it some times media will play on DLNA renderer but it not at every time.
and other problem with it is that it is not taking media item METADATA.
Please suggest some solution for the problem
You can change file path to database id such as http://172_168.1.1:4566/id/5.
File path has the messy word problem in some device.

Play music/video from a phone to another phone

In Android, is there anyway to play a music/video file via another phone like Apple airplay?
I think vlc can create a media server via rtsp protocol for another phone to get the stream and play it. But perhaps only computer versions of vlc can create media server.

need some advices when making a streaming application

I'm developing an app on android that can play videos streamed from a server (my PC) likes youtube. I'm new to this and I need some advices to get a right approach.
First, my app on android should have the ability to seek to a position that have been played. So, in the server side (my PC), what streaming server should I use?
Do I need to combine the streaming packets into a temporary file and play on this file in order to get seek-back?

stream audio file from FTP server to Android App

I have a FTP server setup that holds audio files in one of its directories. I would like to stream the audio from the server and play it on my Android phone instead of downloading it and playing it back that way. Also, is it possible to stream it to the MediaPlayer in Android for playback?
The FTP protocol does not support streaming audio or video.
However, you could set up a streaming server on the same box that will do it for you. I've used VLC to stream video and it's pretty easy to set up. Should work for audio too.
http://www.videolan.org/doc/streaming-howto/en/index.html
You can stream video over FTP. It is just a basic transfer protocol and once you have the data streaming to your device you can do what you want with it. Take a look at this tutorial if you want to set up streaming to your phone:
https://www.digitaldrugs.co.uk/wordpress/?p=37
Sure it is possible, the only problem I see is that your media files should be in a continuous file format, such as MP3. See shoutcast streaming for example, it works via http.
yxplayer is what you want, but it might be a bit limited
You can stream mp3 over FTP. Same way you can DL mp3 from ftp and listen to it before it's finished DLing. There's File Managers/Explorers like FX for one that will do this, but all it's streaming stuff is a trial or maybe by now a paid unlockable feature. Look for an open source remedy.

Categories

Resources