如何使用video.js播放.swf文件? [英] How do I play a .swf file using video.js?

查看:890
本文介绍了如何使用video.js播放.swf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 video.js 播放器播放 .SWF 文件?

我玩过下面的代码,但我无法让它工作。

当我直接打开 .swf 文件时(使用用IE打开),然后我可以通过这种方式播放 .swf 文件。

How do I play a .SWF file using the video.js player?
I've played around with the code below, but I can not get it to work.
When I open the .swf file directly (using open with IE), I then I am able to play the .swf file that way.

JavaScript:

JavaScript:

// path to location of swf-file
_V_.options.flash.swf = "video-js.swf";

// flashvars
_V_.options.flash.flashVars = {
    file: "./ExportSWF/Recording.swf", //file to be played
    autostart: "false",
    provider: "http",
    "http.startparam": "start"
};

// object params
_V_.options.flash.params = {
    allowfullscreen: "true",
    wmode: "transparent",
    allowscriptaccess: "always"
};

HTML:

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="400" height="300">


推荐答案

video.js HTML5 视频播放器。

但是,HTML5 < video> 标签目前仅支持格式有限

video.js is an HTML5 video player.
However, the HTML5 <video> tag currently only supports a limited number of formats:


  • WebM

  • Ogg Theora Vorbis

  • Ogg Opus

  • MP4 H.264

  • MP3

  • WAVE PCM

  • WebM
  • Ogg Theora Vorbis
  • Ogg Opus
  • MP4 H.264
  • MP3
  • WAVE PCM

某些浏览器可能支持一些其他格式,但这是特定于实现的。

请注意,Adobe Flash swf 文件包含在该列表中,因为它们无法使用< video> 标记进行播放,只能使用< embed> 标记。

Some browsers may support a few additional formats, but that's implementation specific.
Please note that Adobe Flash swf files are not included in that list as they cannot be played with <video> tags, only <embed> tags.

但是,有一些社区创建的扩展可以实现您的目标: https://github.com/vide ojs / video-js-swf

However, there are a few community created extensions that may accomplish what you're looking for: https://github.com/videojs/video-js-swf

这篇关于如何使用video.js播放.swf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆