I'm working on an app that plays a video. I cannot find a way to disable the user video controls (Play, pause, go to 1:23, etc...)
How do I remove the user controls from that object? Ideally the bottom bar of controls will not even show up.
VideoView doesn't have controls built in so I'm assuming you have a MediaController set up in your code, which has the controls that appear when tapping the screen and then go away. If that's the case you can remove it and your problem should be solved.
Related
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
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 want to show a volume bar (SeekBar) when a speaker button is pressed. Changing the whole Activity just for a SeekBar might not be a good decision.
I think overlaying that SeekBar would be the best solution. (But how?)
How would you solve this problem?
You could use your own customized dialog and automatically dismiss it if the user hasn't touched the screen after a short while, but I would like to ask exactly why you need it.
The reason: not all Android devices even have volume buttons.
If you wish, you can easily just set the volume control to be MEDIA instead of the ringtone volume, so that if the user accesses the volume , it will show the control of the MEDIA . Here's how you do it:
setVolumeControlStream(AudioManager.STREAM_MUSIC);
I think you should use a custom Dialog with a SeekBar set as content.
As a side note, remember to get rid of the title requesting the right feature to your window:
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
I am trying to do a Music player. Like in some Music player when a song is playing if u touch the screen progress Seekbar will come and after touch_up, after some time that seekbar will automatically slide down. If u again touch the screen it again come back like slide up.
I don't know whether that is a slider or different.
How can i do that in my application. Is there any way?
Thank you.
You can create a Sliding Drawer, Sliding Drawer in android and control it on the touch
The current Android YouTube application provides helpful hints for navigating the user interface. For example: the first time the user switches between tabs while a video is playing, a small "tooltip" with an arrow pops up and says "You can also switch between tabs by swiping left and right." or something to that effect. Is there a way to mimic the look and functionality of this tooltip?
The best way I could think of doing that is having something in a preferences file and when the user triggers a certain event (pressing a tab in Youtube rather than swiping) it brings up a custom view or even a Toast message. Then, after the tooltip is triggered, set the specific tag in the preferences file as triggered.