注意:所在的Activity不要忘记配置manifest的config。
<activity
android:name=".xxxxx"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" />
1.依赖/二选一
1.
implementation 'com.shuyu:gsyVideoPlayer-java:6.0.2'
2.
implementation 'com.shuyu:GSYVideoPlayer:7.1.4'
2.布局中添加播放控件
<com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
android:id="@+id/detail_player"
android:layout_width="match_parent"
android:layout_height="@dimen/post_media_height" />
3.配置播放控件
public class VideoPlay2Activity extends AppCompatActivity {
StandardGSYVideoPlayer videoPlayer;
OrientationUtils orientationUtils;
private String intent;
private TextView tags11;
@SuppressLint("WrongConstant&