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
Related
I am able to play the videos in exoplayer using the source code at https://github.com/google/ExoPlayer, but unable to find, how to save video and play later while offline.
Also how segmented videos running through mpd files will be saved offline?
Any code snippet that I can put inside the exoplayer source code to make it work would be highly appreciable.
You can use a CacheDataSource and wrap your data source with it (eg. wrap the DefaultHttpDataSource).
I download video with:
mPlayer.setDataSource("https://s3-eu-west-1.amazonaws.com/ellovidsout/1232/9/1423065486.mp4.m3u8")
Header contains following data:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=532000,RESOLUTION=400x224,CODECS="avc1.42001e,mp4a.40.2"
400k_1423065486.mp4.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1273000,RESOLUTION=640x360,CODECS="avc1.4d001f,mp4a.40.2"
1000k_1423065486.mp4.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2476000,RESOLUTION=1024x576,CODECS="avc1.4d001f,mp4a.40.2"
2000k_1423065486.mp4.m3u8
Can I manually force media player to play only video with resolution 400x224 for example? (Except manually alerating url adding quality code to id)
You can use the method selectTrack and getTrackInfo Therefore, it doesn't work properly for all devices and Android OS version.
It might be helpfull to use ExoPlayer . Here you can check the demo app.
I have a small video clip and an audio file. The problem is how to write code to merge them into a single file. i have never written code for multimedia applications for android and don't know if the merging is possible with android media framework. Is there any third party library to do that?
Can we right a merging code in Java and call it in Android?
Please guide me through this. Thanks
You can try INDE Media for Mobile, tutorials are here: https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has a sample demonstating how to substitute audio track in mp4 video file by another audio track from another mp4 file. It's here: https://github.com/INDExOS/media-for-mobile/blob/master/Android/samples/effects/src/com/intel/inde/mp/effects/SubstituteAudioEffect.java
In sample app it's under Audio Effect:
I have complied ffmpeg library for android
could any guide me how to use it for showing the video on the screen.
as far as I know ffmpeg is used for video conversion...
for showing a video use videoview or mediaplayer.
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/