AndroidVideoPlayer play videos online

Source: Internet
Author: User

AndroidVideoPlayer play videos online
AndroidVideoPlayer plays a video online. The custom SuperVideoPlayer encapsulates the startPlayVideo () Playing video loadAndPlay (String videoUrl, int seekTime) to load and start playing the video. loadVideo (String videoUrl) loads the video, when playVideoAtLastPos () is changed to a definition address, loadMultipleVideo (ArrayList <Video> allVideo) plays multiple videos. Other methods: callback/*** call back after rotating the screen * @ param newConfig */@ Override public void onConfigurationChanged (C Onfiguration newConfig) {super. onConfigurationChanged (newConfig); if (null = mSuperVideoPlayer) return;/***** reset the player Size Based on the screen direction */if (this. getResources (). getConfiguration (). orientation = Configuration. ORIENTATION_LANDSCAPE) {getWindow (). setFlags (WindowManager. layoutParams. FLAG_FULLSCREEN, WindowManager. layoutParams. FLAG_FULLSCREEN); getWindow (). getDecorView (). invalidate (); float height = Densit YUtil. getWidthInPx (this); float width = DensityUtil. getHeightInPx (this); mSuperVideoPlayer. getLayoutParams (). height = (int) width; mSuperVideoPlayer. getLayoutParams (). width = (int) height;} else if (this. getResources (). getConfiguration (). orientation = Configuration. ORIENTATION_PORTRAIT) {final WindowManager. layoutParams attrs = getWindow (). getAttributes (); attrs. flags & = (~ WindowManager. layoutParams. FLAG_FULLSCREEN); getWindow (). setAttributes (attrs); getWindow (). clearFlags (WindowManager. layoutParams. FLAG_LAYOUT_NO_LIMITS); float width = DensityUtil. getWidthInPx (this); float height = DensityUtil. dip2px (this, 230.f); mSuperVideoPlayer. getLayoutParams (). height = (int) height; mSuperVideoPlayer. getLayoutParams (). width = (int) width ;}}/*** restore screen to portrait */private void resetPageToPortrait () {if (getRequestedOrientation () = ActivityInfo. SCREEN_ORIENTATION_LANDSCAPE) {setRequestedOrientation (ActivityInfo. SCREEN_ORIENTATION_PORTRAIT); mSuperVideoPlayer. setPageType (MediaController. pageType. SHRINK );}}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.