html5 video streaming

▼魔方 西西 提交于 2019-12-11 02:15:17

问题


I am working to stream a video screencast on our cakephp site using mediaViews and html5. I am using videojs for the player and am running into a few problems:

  1. Will not stream in safari/ipad/iphone (I have it converted into an mp4)
  2. Does not allow the viewer to skip to the middle of a video in any browser. They must watch the video straight through start to finish, which is not ideal.
  3. Is not falling back to the flash object for browsers that don't support html5

It currently streams correctly on Chrome and Firefox. I have not tried IE yet.

Code is below. All conversions of the video file were done using Miro Video Converter which I read should work well.

Any help is very appreciated!

Students Controller Code

function view_demo_mp4() {
    $this->viewClass = 'Media';
    $params = array(
        'id' => 'webinar.mp4',
        'extension' => 'mp4',
        'path' => APP . "../../documentation" . DS,
        'download' => false,
        'cache' =>true
    );
    $this->set($params);

}

function view_demo_webm() {
    $this->viewClass = 'Media';
    $params = array(
        'id' => 'webinar.webm',
        'extension' => 'webm',
        'path' => APP . "../../documentation" . DS,
        'download' => false,
        'cache' =>true
    );
    $this->set($params);
}

function view_demo_ogg() {
    $this->viewClass = 'Media';
    $params = array(
        'id' => 'webinar.ogv',
        'extension' => 'ogv',
        'path' => APP . "../../documentation" . DS,
        'download' => false,
        'cache' =>true
    );
    $this->set($params);
}

View

<video class="video-js vjs-default-skin" controls preload="none" width="768" height="432"
     poster="/files/demo_splash.png"
     data-setup="{}">
        <source src="/students/view_demo_mp4" type='video/mp4' />
        <source src="/students/view_demo_ogg" type='video/ogg' />
        <source src="/students/view_demo_webm" type='video/webm' />
 </video>

I have three versions of the the video. The original was created using Quicktime Screen Recording. I am currently using:

  • Mp4 H.264, Audio channels: 2 Total bit rate 320
  • Ogv HTML5 Video (Ogg) I don't see any further details
  • WebM HTML% Video webm (again, no more details that I can find)

When using the Miro converter to convert the video I am using the far right option "Format", selecting "Video" and then the output type.

This is on an https site, so perhaps that could be causing problems with the flash fallback? Other than that I didn't see any instructions on videojs to help set up the fallback. Am I missing something?

Many thanks for any help.


回答1:


If your HTML5 video does not play on any Apple handheld devices, try encoding the mp4 version by yourself in Adobe Media Encoder. Make sure that, under the Video tab, choose a level that is 4 or lower, definitely choose Baseline for Profile, and show a bit rate that is lower enough, such as between 1000kbps and 2000kbps (The default is usually at 20000kbps.).



来源:https://stackoverflow.com/questions/14263977/html5-video-streaming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!