1
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.lzy.ninegrid.preview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.lzy.ninegrid.R;
|
||||
import com.pili.pldroid.player.widget.PLVideoView;
|
||||
|
||||
public class VideoPreviewActivity extends Activity {
|
||||
|
||||
private PLVideoView pLVideoView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_preview_video);
|
||||
pLVideoView = findViewById(R.id.pLVideoView);
|
||||
String url = getIntent().getStringExtra("url");
|
||||
pLVideoView.setVideoPath(url);
|
||||
MediaController mMediaController = new MediaController(this);
|
||||
pLVideoView.setMediaController(mMediaController);
|
||||
pLVideoView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
pLVideoView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
pLVideoView.pause();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
pLVideoView.stopPlayback();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user