floating video player (like youtube player ) in android - android

In my app i need to implement floating video player ( like youtube player). i gone through the below urls but not able to solve my issue. I don't know where to start and what to use .
Please someone help me
how to create a Floating popup video player in android?
how to create a Floating popup video player in android?
What APIs in Android is Facebook using to create Chat Heads?

Yes, you can achieve this by using service with Window manager, there is an excellent sample application available on github
https://github.com/marshallino16/FloatingView, this will guide you to achieve your requirements which are listed above

To make floating player you need to work on widgets. it is known as picture in picture mode. step is as below
1) add dependency for support media
2) create player layout
3) add player click event (touch & onclick listener)
4) add broadcast receiver to detect event on player view.
5) Start player from activity.
You can find link on github for picture in picture mode android example OR you can get reference here

Related

How to play YouTube video in react native Android app without YouTube branding?

We want to play some YouTube videos in my React Native app without YouTube branding. We would like to give the user experience as if the video is playing in a native player. We already tried with webview, react-native-youtube-iframe but still, we are not able to achieve our goal. Either top or bottom section has a YouTube logo, then watch and share options are visible. We want to eliminate those. Any possible way to do this in React Native?
URLs of Youtube videos are different for normal videos and embedded videos.
Normal: https://www.youtube.com/watch?v=DGQwd1_dpuc
Embed: https://www.youtube.com/embed/DGQwd1_dpuc
Please change 'watch?v=' with '/embed/'.
You can also hide controls and information by passing 'showinfo=0' or 'controls=0'.
I recently tried to achieve the similar thing in one of my android app if you can somehow use this particular library
This is an android library and as you mentioned you want to do it in android.
android-youtube-player
I have used this library where i used a player with custom control which helps you override the controls and also this share and next button and even the youtube logo.
Let me know if you need any help further.
Edit:
To enable web UI
IFramePlayerOptions options = new IFramePlayerOptions.Builder().controls(1).build();
Then initialize the player with this controls.
You won't see any logo now.

Show Android Notification always expanded

I have created a exoplayer audio player with a notification to play pause audio.
Inside notification there is a small dropdown arrow to expand and collapse the notification (As shown in images attached) . Is it possible to remove those small arrows and make notification always expanded?
Regards,
Ali
Based on your description, I think that you can use the media control that is introduced in Android 11, it's easy to set up and full of the features that you want. Find an introduction about it here in this developer blog article.
You can also have a look into the UAMP sample to get more insight into how they handled the player notification using the PlayerNotificationManager.

Validate Video View appium (java) android

I am automating android app using Appium (java).
I have android.widget.VideoView on the page and using verifyElementByClass , I can check whether the Video View exists on that page.Now I need to check if it is playing any video or not? How to do that?
Asserting the elements pause_button , seekbar etc. depicts that the video is being played. According to the comment :
the pause button seekbar etc are coming as overlay but UIAutomator is
unable to capture it as it stays for very less time
One way to perform the action is to tap on the android.widget.VideoView and then Assert the presence of the elements so that the overlay is present while you are asserting.
Other way I would have suggested to properly validate if the video is actually getting played is the comparison of screenshots at different timestamps using OCR which is yet not implemented in Appium. These might be of help for Screenshots and OCR-Apppium.

how to show audio equalizer in my android music app?

I am working on my first android app which is a music app and I need to provide equalizer for my app on menu options .. just tell how to use android equalizer class in my app ?
To create visualizer :
1. Use canvas
2. Draw rectangular shape according to your sound
3. Change color of your shapes.
You can also use below tutorials:
https://github.com/felixpalmer/android-visualizer
It will help.
And if you want a demo of music player then you can follow below tutorial:
https://github.com/psaravan/JamsMusicPlayer
https://github.com/punker76/simple-music-player
https://github.com/carlosrafaelgn/FPlayAndroid

Is there any way to disable "Watch Next" block at the end of video using YouTube Android Player API?

In my app I'm using YouTube Android Player API library from here https://developers.google.com/youtube/android/player/
I have a fragment that extends YouTubePlayerFragment. All works fine, but I need to make some improvements to app.
At the end of some videos I see block "Watch Next" with the link to another video, so I'm curious - does we have a possibility to disable this feature?
I created another solution using WebView, and display video using it - in this case I'm able to turn off any other additional links using "rel=0" in video url, but I want to use native solution.
Any ideas?
Thanks in advance!

Categories

Resources