【发布时间】:2016-01-26 15:28:49
【问题描述】:
我正在为Android mobiles 开发一个应用程序。我想播放视频。它工作正常。现在我有一个问题。我想为VideoView 设置角落。是否可以为VideoView设置角点?
我使用以下 xml 代码:
<RelativeLayout
android:id="@+id/video_relative"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
在我的 java 代码中:
myVideoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.my_video));
myVideoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mediaPlayer) {
// close the progress bar and play the video
// progressDialog.dismiss();
//if we have a position on savedInstanceState, the video playback should start from here
myVideoView.seekTo(position);
if (position == 0) {
myVideoView.start();
}
else {
//if we come from a resumed activity, video playback will be paused
myVideoView.pause();
}
}
});
请有人帮我解决这个问题。
【问题讨论】:
标签: android android-video-player