简体   繁体   中英

VideoView Online Buffer android Rotate Handle

show online video my problem is : when rotate screen Video again from the beginning to buffer video

  @Override
    protected void onSaveInstanceState(Bundle outState) {
        outState.putInt("POSITION", myVideo.getCurrentPosition());
        super.onSaveInstanceState(outState);

    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        myVideo.seekTo(savedInstanceState.getInt("POSITION"));
        super.onRestoreInstanceState(savedInstanceState);
    }

This may help you

You have to write android:configChanges="orientation|screenSize" in AndroidManifest.java file

<activity android:name=".MainActivity" android:configChanges="orientation|screenSize"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM