I'am using Android Media Player to play music from my server. It is possible to save playing audio to storage using MediaPlayer?
MediaPlayer class does not support downloading an audio, you will need to download it using http, as far as I remember there DownloadService in Android that you can use to download. You can also try to use any library, please Check this link
Related
I use ExoPlayer in my Android app for playing .m3u8 video and audio streams. It works well. But now I want to add the ability to play encrypted(aes encryption on server-side) videos. For example, I obtain from backend the next parameters:
streamUrl: "https://some_stream.m3u8",
aes_key: "16symbols_key",
aes_iv: "16symbols_IV",
decrypt the stream and play it in my ExoPlayer. How can I make this?
You might wanna look at this issue where it is explained how to play AES-128.
Also do check that your encryption is supported https://exoplayer.dev/hls.html
Which library is useful to load audio or video file from API and play to the application? I tried glide for the image. But no idea about audio or video. (I want to fetch the image and file name to the recycle view after click operation file will play to the next activity.) A short guideline with library name is very helpful.
Android has MediaPlayer to load and play Audio and Video from URL. you can setDataSource as URL.
refer this answer...
You have Two approach one of them is using official Library (Media Player Library for music and VideoView for video) and other approach is using custom library I suggest you to using ExoPlayer Library for playing music and video
you can use following link:
https://github.com/google/ExoPlayer
So I am creating a podcasting app and I was wondering if playing a podcast such as this http://www.npr.org/rss/podcast.php?id=122287224 - will MediaPlayer work to play such a podcast? I have never used MediaPlayer and I am just wondering if that would work.
yea you can , just parsing the xml and get the link of the xml and using the media player in streaming the mp3
this tutorial help you
here how to parse xml
http://www.androidhive.info/2011/11/android-xml-parsing-tutorial/
media player and streaming
http://www.helloandroid.com/tutorials/musicdroid-audio-player-part-i
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/
http://blog.endpoint.com/2011/03/api-gaps-android-mediaplayer-example.html
http://androidstreamingtut.blogspot.com/2012/08/custom-progressive-audio-streaming-with.html
I am developing an app. that will stream the video recorded from camera and stored as mp4 in sdcard...
I know there something called as RTSP which is used for that...
Please tell me where to start . .and is there any library that will do this for me...
I do not understand why you want to stream a local mp4 file, but maybe I misunderstood you problem. RTSP is used for live streaming, but you want to play a local mp4 file.
If you want to capture video and save it as mp4 onto a SD card, you need to use the Android MediaRecorder. Here a link to a simple example.
If you just want to playback a local mp4 file. Have a look at the Android API Demos.
These are part of the Android SDK installation and contain a good example of how to playback local media files.
Please provide some url related to some documentation about video streaming in android. I got many document on this site but all are getting total content of video from url and then playing the video but i want to stream and play video simultaneously so that i can play without consuming a lot of time. thank you
There are two techniques:
Using MediaPlayer: If you are using streaming server to fetch video then just provide your URL in MediaPlayer source. MediaPlayer will manage everything.
Manually: If you are not using streaming server for video then you need to download and play video. Use following link as example. In following link author explain audio streaming. You can use same technique for video.
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/