【问题标题】:Video file not running on browser视频文件未在浏览器上运行
【发布时间】:2012-08-06 17:32:08
【问题描述】:

在 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);

【问题讨论】:

  • 什么??您正在尝试播放或尝试录制???
  • 我用安卓手机录制了视频,然后将其存储在 sdcard 中。从 sdcard 之后,我将它复制到我的计算机并尝试在浏览器上运行它。

标签: android html5-video android-video-player


【解决方案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 相机代码

【讨论】:

    猜你喜欢
    • 2018-07-18
    • 2016-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-25
    • 2014-06-07
    • 2013-06-28
    • 2012-07-22
    相关资源
    最近更新 更多