use of android.view.TextureView.SurfaceTextureListener in project android_packages_apps_Settings by crdroidandroid.
the class FingerprintLocationAnimationVideoViewTest method onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash.
@Test
public void onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash() {
mView.onFinishInflate();
final SurfaceTextureListener listener = mView.getSurfaceTextureListener();
when(mView.createMediaPlayer(any(Context.class), any(Uri.class))).thenReturn(null);
listener.onSurfaceTextureAvailable(mock(SurfaceTexture.class), 48, 48);
// should not crash
}
use of android.view.TextureView.SurfaceTextureListener in project android_packages_apps_Settings by SudaMod.
the class FingerprintLocationAnimationVideoViewTest method onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash.
@Test
public void onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash() {
mView.onFinishInflate();
final SurfaceTextureListener listener = mView.getSurfaceTextureListener();
when(mView.createMediaPlayer(any(Context.class), any(Uri.class))).thenReturn(null);
listener.onSurfaceTextureAvailable(mock(SurfaceTexture.class), 48, 48);
// should not crash
}
use of android.view.TextureView.SurfaceTextureListener in project LanSoEditor_advance by LanSoSdk.
the class VideoPlayerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.player_layout);
textureView = (TextureRenderView) findViewById(R.id.surface1);
videoPath = getIntent().getStringExtra("videopath");
TextView tvScreen = (TextView) findViewById(R.id.id_palyer_screenhinit);
TextView tvVideoRatio = (TextView) findViewById(R.id.id_palyer_videoRatio);
tvVideoDuration = (TextView) findViewById(R.id.id_palyer_videoduration);
tvSizeHint = (TextView) findViewById(R.id.id_palyer_videosizehint);
tvPlayWidget = (TextView) findViewById(R.id.id_palyer_widget);
// 获取屏幕密度(方法2)
DisplayMetrics dm = new DisplayMetrics();
dm = getResources().getDisplayMetrics();
screenWidth = dm.widthPixels;
screenHeight = dm.heightPixels;
String str = "当前屏幕分辨率:";
str += String.valueOf(screenWidth);
str += "x";
str += String.valueOf(screenHeight);
tvScreen.setText(str);
mInfo = new MediaInfo(videoPath, false);
if (mInfo.prepare() == false) {
showHintDialog();
isSupport = false;
} else {
Log.i(TAG, "info:" + mInfo.toString());
isSupport = true;
str = "当前视频分辨率:";
str += String.valueOf(mInfo.vWidth);
str += "x";
str += String.valueOf(mInfo.vHeight);
tvVideoRatio.setText(str);
str = "当前视频时长:";
str += String.valueOf(mInfo.vDuration);
tvVideoDuration.setText(str);
}
textureView.setSurfaceTextureListener(new SurfaceTextureListener() {
@Override
public void onSurfaceTextureUpdated(SurfaceTexture surface) {
// TODO Auto-generated method stub
}
@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
}
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
return false;
}
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
if (isSupport) {
// 采用系统本身的MediaPlayer播放
play(new Surface(surface));
// startVPlayer(new Surface(surface)); //我们SDK提供的播放器.
}
}
});
}
use of android.view.TextureView.SurfaceTextureListener in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FingerprintLocationAnimationVideoViewTest method onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash.
@Test
public void onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash() {
mView.onFinishInflate();
final SurfaceTextureListener listener = mView.getSurfaceTextureListener();
when(mView.createMediaPlayer(any(Context.class), any(Uri.class))).thenReturn(null);
listener.onSurfaceTextureAvailable(mock(SurfaceTexture.class), 48, 48);
// should not crash
}
use of android.view.TextureView.SurfaceTextureListener in project android_packages_apps_Settings by omnirom.
the class FingerprintLocationAnimationVideoViewTest method onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash.
@Test
public void onSurfaceTextureAvailable_nullMediaPlayer_shouldNotCrash() {
mView.onFinishInflate();
final SurfaceTextureListener listener = mView.getSurfaceTextureListener();
when(mView.createMediaPlayer(any(Context.class), any(Uri.class))).thenReturn(null);
listener.onSurfaceTextureAvailable(mock(SurfaceTexture.class), 48, 48);
// should not crash
}
Aggregations