将 JWPlayer 5 转换为 JWPlayer 6 flash(flv) 和 HTML(mp4) 格式的视频

Convert JWPlayer 5 to JWPlayer 6 flash(flv) and HTML(mp4) format videos

我想让每个人都能观看 flash(flv) 格式,如果他们没有 flash,他们会看到 html5(mp4/m4v) 视频。

我使用的是 JWPlayer 5,但由于一些错误,我需要将其更改为 JWPlayer 6。

   jwplayer('mediaplayer').setup({
    'flashplayer': 'http://www.domain.com/jwplayer/player.swf',
    'id': 'playerID',
    'autostart': 'false',
    'image': 'http://domain-images.s3.amazonaws.com/domain/picture.png', 
    'autostart': 'false',
    'controlbar': 'bottom',
    'width': '640',
    'height': '<?php /*echo $video_player_height;*/ ?>',
    'dock': 'false',
    'stretching': 'fill',
    'icons': 'false',
    'mute': 'false',    
    'volume': '100',            
    'quality': 'false',
    'modes': [
        { type: 'flash', 
          src: 'http://www.domain.com/jwplayer/player.swf', 
          config: {
          'file': '<?php /*echo $media_files[$id]['video']*/ ?>.flv',
          'provider': 'video'
            } 
        },
        { type: 'html5',
          config: {
          'file': '<?php /*echo $media_files[$id]['video']*/ ?>.mp4',
          'provider': 'video'
          }
        },
        { type: 'download',
          config: {
          'file': '<?php /*echo $media_files[$id]['video']*/ ?>.mp4', 
          'provider': 'video'
          }
        }  
    ]
});

一切都很好,但我没有找到如何在 JWPlayer 中制作同样的东西。似乎我已经阅读了所有文档,但如果我使用的是 RTMP 或 HLS 协议,则没有找到预期的方式。

只提供一个MP4,简单的设置:http://misterneutron.com/JW6video/

使用现代浏览器的访问者将看到使用原生 HTML5 播放的 MP4。使用旧浏览器(如 IE8 和更早版本)的访问者将看到使用 Flash 播放的 MP4。使用较旧浏览器但未安装 Flash 的访问者将获得下载。

JW Player 脚本会自动为您处理所有这一切。您不需要提供多种格式,也不需要任何类型的 "modes" 属性(JW6 中不存在)。

为确保您的 MP4 流正确,moov 原子必须位于文件的开头 - 如果不是,则必须先下载整个文件才能开始播放。如果位置正确,播放器将只需要文件的前几秒即可开始播放。

要将另一种格式转换为 MP4,请使用 Handbrakehttp://handbrake.fr/. Take the default options, but also check Web optimized. If you're using ffmpeg, use the -movflags faststart attribute. If you have an MP4 that has the moov atom at the end, and you just want to move it, use MP4 FastStart, which has only one purpose - it quickly alters the file to place the moov atom properly: http://www.datagoround.com/lab/