After looking around in order to avoid the black background before videoview is prepared, i've decided to post here a fix / trick.
Well, if you have no views on top of the videoview, use the "ZOrder" method:
videoView.setZOrderOnTop(true); //to "hide" before setting up your video
videoView.setZOrderOnTop(false); //after, in your videoView.setOnPreparedListener
BUT if you have some views on top of your videoview, this method will hide everything that has meant to be on top of your videoview, so just go with the "background" method, setting it before and after video is prepared:
video.setBackgroundColor( some color, maybe your app background ); //before
video.setBackgroundColor(Color.TRANSPARENT); //after, on prepare
Related
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
I’m trying to put a layer over a YouTube player in fullscreen mode. I’ve tried putting a layout over YouTube through the xml but it isn’t visible when YouTube is in fullsreen mode. Is there a way I can put a custom button or layout over the YouTube player in fullscreen mode?
You cannot put a layer on top of Youtube Player. Whenever an overlay is detected, the youtube playback stops playing. For more info
Note that while videos are playing, this View has a minimum size of 200x110 dp. If you make the view any smaller, videos will automatically stop playing. Also, it is not permitted to overlay the view with other views while a video is playing.
You can put a layout outside the player or use Overlay ActionBar
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.
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 .
In my application I am using VideoView to play a video. Through this forum I have learnt to show the progress bar (MediaController) persistently (without hiding).
My requirement is to tint the video on some action (lets say pause on MediaController), but still be able to use the MediaController. i.e., once the video is tinted, I could move the progress-bar on MediaController and could also play the video again (after un-tinting it).