how to create a Floating popup video player in android? - android

how to create a Floating popup video player in android?
In my app i want floating popup window .i don't know the concept help?
like Floating YouTube Popup Player
please

There is open source, they did all you want. Link as below:
http://flavienlaurent.com/blog/2013/08/28/each-navigation-drawer-hides-a-viewdraghelper/
https://github.com/pedrovgs/DraggablePanel

Create a PopupWindow which contains a VideoView

Make AbsoluteLayout with fill_parent for width and height and add VideoView on this. Also, you can implement Frame/Linear layour with padding and background as frame for your VideoView
Add onTouchListener for VideoView and implement standart drag behavior in this listener by updating coordinates of VideoView
Add this AbsoluteLayout on your activity layout.

Related

Custom TimeBar in ExoPlayer

I would like to create a custom timebar in exoplayer using PlayerView that:
cannot be dragged by user but only shows the progress in the video
UPDATE: Ok, so I was able to disable dragging by setting the touch_target_height to 0dp!
allows the underlying PlayerView to be clickable (I am losing clickability of PlayerView due to the controller on top)
is always shown on the PlayerView surface (the custom controller appears only on clicking PlayerView once)
I tried using DefaultTimeBar in a custom controller layout but couldn't disable dragging of time bar. Also, the controller is only shown when tapped I have tried the following so far:
On PlayerView component of layout XML, have added the following to disable hiding of controller, but it still requires clicking PlayerView the first time for controller to show up.
app:show_timeout="0"
app:hide_on_touch="false"
I need to capture onClick event on PlayerView which I was able to until I introduced the custom controller layout. I have PlayerView both focusable and clickable
android:focusable="true"
android:clickable="true"
Also, in an attempt to disable dragging of time bar in DefaultTimeBar, I did the following but it only removes the thumb (or scrubber) from the time bar, doesn't disable dragging:
app:scrubber_enabled_size="0dp"
app:scrubber_disabled_size="0dp"
app:scrubber_dragged_size="0dp"
Any ideas on how to do these 3 things?
Thanks,
AB
Regarding the third thing you can try to do it programmatically.
You can ovveride this methods in your DefaultTimeBar:
onScrubStart(...)
onScrubMove(...)
onScrubStop(...)
and implement your logic for each of them (maybe a simple return is enough).
Please check this link for more details: OnScrubListener

Removing elements from within the YouTubePlayerView in Android

My YouTube video shows an overflow menu, full screen, open in YouTube buttons from within the YouTubePlayerView or the YouTubePlayerFragment.
Is there any way to remove those items? I can't find anything in the docs.
Thanks.
Add the style YouTubePlayer.PlayerStyle.CHROMELESS in initialization to completely remove all available controls.
In onInitializationSuccess add ytPlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);.
Check here for more details.
Edit : You can add your own controls using either a DialogFragment or Dialog on top of the YoutubePlayer. This will allow you to control playback completely using your own buttons and seekbar. And it does the trick of removing Youtube App Button from player.
Yes You can disable full screen from default player,You need to just use below code with your player object.
//To disable full screen mode.
player.setShowFullscreenButton(false);
Use above line to hide full screen button from your default youtube player.Hope this will work for you.

Android - Master/Detail flow with Media Player

how develop this type of layout?
if song playing then it show otherwise not..
which should display over master/Detail.... as well update progress of playing song.
i want it for Android 4.0 or above for both portrait & landscape
Please Help me..
In my opinion you should use FrameLayout. You can declare NavigationDrawer with ListView as the first layout (NavigationDrawer reference) and then a "steering" of music player layout with progressbar as the second. The progress bar can be achieved with a SeekBar.
You can show/hide the second layout programmatically with setVisibility(int visibility)
Here you have a nice reference and tutorial.

android : YouTubePlayerView video not visible

i am inflating a layout over the cameraview . The layout is like this
{ Linerlayout
Relativelayout
YouTubePlayerView }
This inflated layout elements are initilly invisible and on user action these are made visible and i call
youTubeView.initialize()
the initialise finish listenr will call
player.cueVideo(getVideoUrl());
Now i can see the progressindicator first, then i can see the thumbnail of the video with play control on top. When i press that play button , the video start playing but nothing is visible. I can see my cameraview ( ie the view when we open camera )( over which this layout is inflated ) . The video sound is coming and the video is played. Now if i press fullscreen button, it opens video in full screen and here everything is fine. I can see the video . If i go back to small screen again no video only sound.
youTubeView.setVisibility(View.VISIBLE);
toplayerLinearLayout.setVisibility(View.VISIBLE);
toplayerRelLayout.setVisibility(View.VISIBLE);
youTubeView.initialize(DEVELOPER_KEY,
(OnInitializedListener) applicationActivity);
Please give some pointers on what could be happening
Please help as i am totally blocked
The issue was the cameraview . I dont know why youtubeplayer view behaves like this . But i made the GLview ( camera ) invisible before making the youtubeplayerview visible and it is working .

How do I put my ProgressBar Spinner ontop of a button in XML?

I made a soundboard app where when I click a button, it plays a sound by setting the onClick to Button_sound.start. I want a progress spinner ontop of the button only while the sound is playing. How do I put the spinner ontop of the button in xml instead of above or below the button? and How do I make the spinned only show while the sound is playing? Thanks greatly as I am very new to developing and please make your answers as specific as possible.
Can you please post the code that you already got so it will be bit easier to come up with solution.
You can set the orientation of the linearlayout(which contains your spinner and button)to be vertical.this will align spinner on top of button.
Make sure you have code for spinner written before button inside that linear layout.

Categories

Resources