The simple use of jiecao video player

The player itself has the function of automatically memorizing the playing progress. In the full screen state, it has the function of gesture fast forward and fast backward, as well as the control of brightness on the left and volume on the right
After clicking the full screen, the video is still in the vertical screen. It needs to rotate the mobile phone to become a horizontal screen. When using mobile data, there will be a dialog prompt, and the integration is very simple.
The following code:
First, add the dependency Library:

compile 'fm.jiecao:jiecaovideoplayer:5.5'

Then declare the control in the layout:

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
        android:id="@+id/jiecao_Player"
        android:layout_width="match_parent"
        android:layout_height="200dp"/>

Activity Code:

public class MainActivity extends AppCompatActivity {
    private JCVideoPlayerStandard jcVideoPlayerStandard;
    //Test address
    String s1="https://txmov2.a.yximgs.com/upic/2017/06/22/23/BMjAxNzA2MjIyMzEyMThfNzAyMzQ4Ml8yNDU3OTA1MjA1XzJfMw==_b.mp4";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //If you need to set the title, you can try it
        //Getsupportactionbar(). Settitle ("use of jiecauvideoplayer");
        //Find control
        jcVideoPlayerStandard= (JCVideoPlayerStandard) findViewById(R.id.jiecao_Player);
        //Set the text displayed on the video
        jcVideoPlayerStandard.setUp(s1,JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL,"Demon King now");
    }

    /**
     * Don't forget these two ways
     * */
    @Override
    public void onBackPressed() {
        if (JCVideoPlayer.backPress()){
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        JCVideoPlayer.releaseAllVideos();
    }

}

Then add:

 <activity android:name=".MainActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:screenOrientation="portrait">

The minimum SDK for dependency is 16, otherwise an error will be reported

Keywords: Android Mobile SDK

Added by virgil on Mon, 04 May 2020 20:57:07 +0300