视频播放器播放 SD 卡中的视频
Video Player to play Video from SD Card
找到街草视频播放器,这是那个link,可以在线播放视频URL。
JCFullScreenActivity.toActivity(this,
"http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4",
JCVideoPlayerStandard.class,
"Title");
但是,如果我必须从 SD 卡播放视频怎么办,例如:toystory.mp4
(可在 下载 文件夹中找到)
先加
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
给你的AndroidManifest
和
使用这个
String fileName = "YourVideo.mp4"; //your file name in downloads folder
String completePath = Environment.getExternalStorageDirectory() + "/Download/" + fileName; //your file path
//File file = new File(completePath);
//Uri video = Uri.fromFile(file);
JCFullScreenActivity.toActivity(this,
completePath,
JCVideoPlayerStandard.class,
"Title");
I analysed github code and found that it's just using MediaPlayer
and passing uri to it.
找到街草视频播放器,这是那个link,可以在线播放视频URL。
JCFullScreenActivity.toActivity(this,
"http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4",
JCVideoPlayerStandard.class,
"Title");
但是,如果我必须从 SD 卡播放视频怎么办,例如:toystory.mp4
(可在 下载 文件夹中找到)
先加
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
给你的AndroidManifest
和 使用这个
String fileName = "YourVideo.mp4"; //your file name in downloads folder
String completePath = Environment.getExternalStorageDirectory() + "/Download/" + fileName; //your file path
//File file = new File(completePath);
//Uri video = Uri.fromFile(file);
JCFullScreenActivity.toActivity(this,
completePath,
JCVideoPlayerStandard.class,
"Title");
I analysed github code and found that it's just using
MediaPlayer
and passing uri to it.