my app there are two activities. first activity displays a videoview which plays a video in non-fullscreen mode(there are other info about the video which occupies the rest of the screen). also there is a button in the same screen which pressing that causes the video play in fullscreen mode.
the way I implemented full screen is that I start a new activity with a videoview and I send the url of the playing video to this new activity. then I can load the url from begining and so on....
Is there a way that I can reuse the same videoview of the the first activity in my second activity?
Related
When the user clicks the full screen button on a video in a WebView, WebChromeClient calls onShowCustomView with the custom video view. I use this callback to add the view to the fragment and display it full screen.
However, when I rotate the device, the activity is destroyed (as expected) along with the custom video view.
How can I make the WebView show the custom video view after rotation (without losing the current state of the video, e.g. playing/paused and offset)? After calling restoreState with the WebView's saved instance state, it does not invoke WebChromeClient's onShowCustomView callback and seems to have no memory that the user was watching a video. Even if I were to somehow save the video, it would no longer be connected to the WebView, and clicking the button to exit full screen would no longer trigger WebChromeClient's onHideCustomView callback.
I am building an android application having video call facilities. I have used pristine.io webrtc library. My problem is when I press back button I want to finish the activity and show a small video view in top right corner of the screen. Thus user can navigate other activities of the application. If a user touches the small video view, the original Activity restarts with full screen video. Can anyone help me telling how can I do this.
I have a WebView showing a HTML document with media content (embedded Youtube video, html5 video...). Is it possible to show them only as thumbnail and always open a fullscreen video view when the user clicks on them?
You can parse all content and show only preview picture. When user clicks on it you can start new fullscreen activity and play video there.
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);
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 .