在android中我创建了.mp4视频文件并将其存储在sdcard中。从sdcard我已将其复制到计算机中并尝试使用视频标记在浏览器上运行它。
我的HTML代码是: -
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="12.mp4" type="video/mp4" />
<source src="12.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
</body>
</html>
我的安卓代码是: -
private MediaRecorder prMediaRecorder;
prMediaRecorder.setCamera(prCamera);
prMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
prMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
prMediaRecorder.setAudioEncoder(AudioEncoder.AMR_NB);
prMediaRecorder.setVideoEncoder(VideoEncoder.H264);
答案 0 :(得分:1)
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="12.mp4" type="video/mp4" />
<source src="12.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
</body>
</html>
尝试直接录制视频?
private MediaRecorder prMediaRecorder;
prMediaRecorder.setCamera(prCamera);
prMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
prMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
prMediaRecorder.setAudioEncoder(AudioEncoder.AMR_NB);
prMediaRecorder.setVideoEncoder(VideoEncoder.H264);
相机的代码不是吗?我不太确定这个Android代码,但它似乎是一个Android摄像头代码