Usage of VolumeShaper in Google Exoplayer (currently called androidx/media) - android

Im planning to port old audio play app to andriodx. My app has audio tracks crossfade, gapeless feature implemented using MediaPlayer and VolumeShaper. It's a mandatory functionality for me.
Exoplayer is missing crossfade capability - it has been in the features backlog for many years unfortunately.
Any ideas if there is a way to access MediaPlayer and VolumeShaper from within Exoplayer. Perhaps anyone knows about audio tracks crossfade implementation with Exoplayer?
Thanks in advance!
David
Find a guidance and/or source code sample.

Related

Extracting and Streaming audio from YouTube videos in Android

I'm trying to find a way to separate and stream the audio from a youtube video given it's url/video ID. I've looked into youtube extractors and most of them are pretty old or no longer maintained. I'm working in Kotlin and jetpack compose. I found an app, newpipe, that does exactly what I want, but the codebase is huge and it's way beyond my experience. I'd like to play it in the background as well, so I suppose I would use exoplayer in combination with a background service. My only obstacle is obtaining the audio from it's url. Is there a quick and dirty way to achieve this within the context of an Android app?

Check/observe what is currently being played by the Android system

I'm looking for a solution to observe what the app is currently playing. At minimum I would need to know what URI is being used to play Media and what is current playback position.
We are giving developers API with media content (MP3/HLS files) and to give them the best experience we are asking them to send various events to our API. Based on those events we can prepare better content for their users. We would like to ease the process of tracking events by implementing library that will be responsible for tracking those events. To do it we need to observe/query what their app is currently playing and what is a playback position. That's why I'm looking for a solution that will let me do this without caring too much what kind of player app is using (MediaPlayer, ExoPlayer or any other solution).
Is there any tool that will let me check those informations?

VideoView vs SurfaceView - Android

I am going to create InApp Video player which will play the videos from our content server and will also support live streaming. Previously was using third party API.
I am confused about going with SurfaceView or VideoView as I have read that VideoView has more lines of code and will be less efficient. Help needed regarding from where should I start? Also need clarity between both. Yes, I have gone through some questions but still confused.
Thank you in Advance.
Frankly Speaking,
VideoView is the combination of SurfaceView and MediaPlayer,
VideoView = SurfaceView + MediaPlayer
But advantage of using Surfaceview and MediaPlayer separately is that you will have the ability to customize it.
I just used VideoView few days ago in my app. I actually had the same confusion. Since, then I came to know about it. I used VideoView. Here is the link below
Link
Hope it helps

How to play videos in recycler view?

The app crashes when I scroll the recyclerview . I know why this happens . But I don't know how to prevent it . There are very less resources online on how to smoothly play videos in recyclerview . Facebook,instagram has done it.(even though they use react native).But what about the android studio users????..Is there a way to play crash free videos in recyclerview?
NOTE
The app crashes because
VideoView extends SurfaceView, and SurfaceView doesn’t have UI synchronization buffers.If by chance the app doesn't crashes then video that is playing tries to catch up the list when you scroll it. That looks horrible!!
You can use ExoPlayer.
for such complex task,and it also provides much more facilities.
Here is the link.
ExoPlayer is an application level media player for Android. It provides an alternative to Android’s MediaPlayer API for playing audio and video both locally and over the Internet. ExoPlayer supports features not currently supported by Android’s MediaPlayer API, including DASH and SmoothStreaming adaptive playbacks. Unlike the MediaPlayer API, ExoPlayer is easy to customize and extend, and can be updated through Play Store application updates.
For using it,just in Gradle file:
implementation 'com.google.android.exoplayer:exoplayer:2.X.X'
For complete details,you can see the blog about how to use it,and its features,i hope it may be useful to you.
If its not the answer,please ignore the answer.

Can I play a video file if I don't want to use MediaPlayer and VideoView?

I am a newbie on Android development. I wanna quickly to know, in principle, if I can use Media Codec and OpenGL ES to playing a video file? There is no need to think about audio issue. If yes, then I can spent more time to study it. Any suggestions welcome, thank you.
Yup! This is essentially what ExoPlayer does.

Categories

Resources