android : YouTubePlayerView video not visible - android

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 .

Related

How to put a layout over a YouTube player while it is in fullscreen mode?

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

Show video in dialog

I want to display video in dialog box
before the video was play in activity and it worked correctly,
but when I try to show video in dialog everything is broken.
It looks like video view becomes transparent, but clicks on video handled correctly.
Whether is a solution of this problem?

How to switch between small and full screen view for video just like youtube does

I am using video view for playing video in list view now on clicking on full screen button i want video view to cover whole screen and start playing from same point where it was playing lastly. And aging on clicking button it should return to list and play video from same point. In short i want to use a single video view and want to make it full screen and small screen as user taps the button.same as you tube does for playing video.
Please any one help me in this situation I am badly stuck in this.
Keep the instance of your video view saved, where you have the entire screen allocated to video view in landscape mode.
Keep different layout for your portrait and landscape mode.
Override the function onConfigChanges to provide the same instance of the video view you had saved, and pass it on to the video view in the other layout.
Make sure your activity is not re-created when orientation is changed by adding the following lines to your activity in manifest:
android:configChanges="orientation|keyboardHidden|screenSize"
And when orientation changes to landscape mode, use the following lines to allow the activity to take the entire space on the screen:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

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.

Disable user controls in an Android VideoView object

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.

Categories

Resources