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
Related
I want to know whether my activity is in upper view or bottom view in the multi-window mode.
The reason for this is I'm using a custom MediaController in a player activity which gets behind the NavigationBar.
Earlier I handled this by adding a bottom margin of the NavigationBarheight to the MediaController but I can't use it in multi-window mode.
When the activity is in upper view of the multi-window mode, I need to remove the bottom margin and when it is in bottom view, I have to provide the bottom margin.
I've tried applying android:fitsInSystemWindows=true attribute to the activity layout and media controller layout, but it didn't help.
Can anyone help me with this?
You can use View:getWindowVisibleFrame method and check rect.top.
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.
I am using a sliding menu over a webview.
I need to disable or blur the webview when the menu is open.
On adding a framelayout and setting foreground, the webview can be blurred but is not disabled and is still scrollable/clickable.
How can I completely freeze the view beneath?
The easiest way is to add enable or disable clicks to the webview by setting the view that is overlayed on top to either be clickable or not clickable.
You can try creating a method like the one below of use the setClickable() method in another similar fashion.
public void setClickable(boolean isClickable){
blurView.setClickable(isClickable);
}
While your overlay is clickable it will intercept all touch events and the user will not be able to interact with the webview.
Note you can set the default behavior for a view easily in xml as well by using this line
android:clickable="true"
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.
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.