网页flash抓取视频(最简单的基于Flash的流媒体示例:RTMP推送和接收)

优采云 发布时间: 2022-01-07 19:00

  网页flash抓取视频(最简单的基于Flash的流媒体示例:RTMP推送和接收)

  ================================================== ===

  Flash流媒体文章列表:

  最简单的基于Flash的流媒体示例:RTMP推送和接收(ActionScript)

  最简单的基于Flash的流媒体示例:网页播放器(HTTP、RTMP、HLS)

  ================================================== ===

  本文延续上一篇文章,记录了一些基于Flash的流媒体处理的例子。本文记录了一些基于Flash技术的网络播放器。与其他网页播放器相比,基于Flash的网页播放器最大的优势在于“免插件安装”,可以大大提高用户体验质量。早期的网络视频(尤其是直播)一般都使用ActiveX控件作为视频播放器,而这些控件并不流行,所以最终用户必须下载相关插件才能观看节目,这给很多不熟悉的用户造成了很大的困扰用电脑。大障碍。直到 Flash 网络播放器的出现,这个障碍才被解决。本文将记录几个常用的网页播放器,以备日后开发和测试使用。

  

  本文记录以下常用的网络播放器:

  RTMP 示例播放器 Adob​​e

  

  RTMP Sample Player Adob​​e 是从 Adob​​e Flash Media Sever 中提取的测试播放器。测试时使用非常方便。将测试的RTMP地址粘贴到下方的“Stream URL”中,点击右侧红色的“Play Stream”。正在播放流媒体。

  RTMP Sample Player Adob​​e 的截图如下所示。

  

  RTMP 示例播放器 Wowza

  

  RTMP Sample Player Wowza 是从 Wowza Streaming Engine 中提取的测试播放器。测试和使用也很方便。将RTMP地址粘贴到对应的输入框中,点击“开始”播放流媒体。

  RTMP 示例播放器 Wowza 的屏幕截图如下所示。

  

  RTMP 示例播放器 Flowplayer

  

  FlowPlayer官网:

  注:FlowPlayer 有两个版本:HTML5 版和 Flash 版。本文使用的是 Flash 版本。

  RTMP Sample Player Flowplayer 是一个基于 FlowPlayer 的网络播放器。它收录两个玩家:

  FlowPlayer 原生支持 HTTP 点播,经 RTMP Plugin 扩展后支持 RTMP。

  Sample Player Flowplayer 是一个支持 HTTP 点播的网络播放器。代码如下所示。

  Sample Player FlowPlayerSample Player FlowPlayer<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.com flowplayer("player", "flowplayer-3.2.8.swf");</p>

  播放器的效果如下图所示,图中正在播放的视频文件的URL为

  

  RTMP 示例播放器 Flowplayer 是由 RTMP 插件扩展的网络播放器。代码如下所示。

  RTMP Sample Player FlowPlayerRTMP Sample Player FlowPlayer<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.com flowplayer("player", "flowplayer-3.2.8.swf",{ clip: { url: 'hks', provider: 'rtmp', live: true, }, plugins: { rtmp: { url: 'flowplayer.rtmp-3.2.8.swf', netConnectionUrl: 'rtmp://live.hkstv.hk.lxdns.com/live' } } });

  Sample RTMP URL (Live) is "rtmp://live.hkstv.hk.lxdns.com/live/hks"</p>

  播放器效果如下图所示,图中正在播放的视频网址为rtmp:///live/hks

  

  RTMP 示例播放器 VideoJS

  

  Video.js官网:

  注意:Video.js 是一个基于 JavaScript 的 HTML5 视频播放器,它本身是开源的。

  RTMP Sample Player VideoJS 是一个基于 Video.js 的 RTMP 播放器。它收录两个玩家:

  示例播放器 VideoJS 是一个支持 HTTP 点播的网络播放器。代码如下所示。

   Sample Player Videojs videojs.options.flash.swf = "video-js.swf"; Sample Player Videojs<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.com

  To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video </p>

  播放器的效果如下图所示,图中正在播放的视频的网址为

  

  RTMP 示例播放器 VideoJS 是一个支持 RTMP 的网络播放器。代码如下所示。

   RTMP Sample Player Videojs videojs.options.flash.swf = "video-js.swf"; RTMP Sample Player Videojs<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.com

  To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video </p>

  播放器效果如下图所示,图中正在播放的视频网址为rtmp:///livepkgr/264

  

  RTMP 示例播放器 JWPlayer

  

  JW播放器官网:

  注:最新版的JW Player好像不能免费使用RTMP播放功能,这里是旧版的JW Player

  RTMP Sample Player JWPlayer 是一个基于 JW Player 的 RTMP 播放器。它收录两个玩家:

  Sample Player JWPlayer 是一个支持 HTTP 点播的网络播放器。代码如下所示。

  Sample Player JWPlayerSample Player JWPlayer<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.comThis text will be replaced jwplayer('mediaspace').setup({'flashplayer': 'player.swf','file': 'sintel.mp4','controlbar': 'bottom','width': '640','height': '360' });</p>

  播放器效果如下图所示,图中正在播放的视频的URL为本地sintel.mp4

  

  RTMP 示例播放器 JWPlayer 是一个支持 RTMP 的网络播放器。代码如下所示。

  RTMP Sample Player JWPlayerRTMP Sample Player JWPlayer<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.comThis text will be replaced jwplayer('mediaspace').setup({'flashplayer': 'player.swf','file': 'flv','streamer': 'rtmp://wx.cnrmall.com/live','controlbar': 'bottom','width': '640','height': '360' });

  Sample RTMP URL (Live) is "rtmp://wx.cnrmall.com/live/flv"</p>

  播放器效果如下图所示,图中正在播放的视频网址为rtmp:///live/flv

  

  HLS Sample Player Flowplayer HLS Sample Player Flowplayer 添加 HLS Plugin 扩展后即为 FlowPlayer。添加 HLS 插件后,FlowPlayer 增加了对 HLS 的支持。代码如下所示。

  HLS Sample Player FlowplayerHLS Sample Player Flowplayer<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.com<a style="display: block; width: 660px; height: 350px;" id="flashls_vod"></a>flowplayer("flashls_vod", "flowplayer.swf", {// configure the required pluginsplugins: {flashls: {url: 'flashlsFlowPlayer.swf',}},clip: {url: "http://stream.flowplayer.org/drive.m3u8",//url: "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8",//live: true,urlResolvers: "flashls",provider: "flashls"}}).ipad();

</p>

  播放器的效果如下图所示,图中正在播放的视频的网址为

  

  HLS 视频播放器 Html5

  

  HTML5 Video 标签参考:

  HLS Video Player Html5 是一个使用 HTML5 标签的网络播放器(实际上是一个网页)。源代码如下所示。

  Video Player Html5Video Player Html5<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.comyour browser does not support the video tag</p>

  这里需要注意的是,该标签需要浏览器支持HTML。如果浏览器不支持HTML5,打开网页会显示以下信息。

  

  如果浏览器支持HTML5,打开网页的效果如下图所示。图片中正在播放的视频的网址是sintel.mp4

  

  ActiveX VLC 播放器

  

  ActiveX VLC Player 和上面的网页播放器有很大的不同,主要是为了比较。ActiveX VLC Player 是一个基于 ActiveX 控件的播放器。基于ActiveX控件意味着只有IE支持网页播放器,并且必须先在本机上安装VLC。

  以近乎“万能”的VLC媒体播放器为后盾,这款网络播放器的性能相当强大:它不仅支持上述各种播放器所支持的HTTP、RTMP、HLS,还支持彩信、RTSP和UDP。这些协议(它支持 VLC 媒体播放器支持的所有协议)。

  ActiveX VLC Player 的源代码如下所示。

  ActiveX VLC PlayerActiveX VLC Player<p>Lei Xiaohua

http://blog.csdn.net/leixiaohua1020

leixiaohua1020@126.com </p>

  播放器效果如下图所示。图中正在播放的视频网址为rtsp://58.248.254.7:9135/live/ds-mmzh。数据包

  

  下载

  最简单的 flashmedia 示例

  来源:

  GitHub:

  开源中国:

  CSDN下载:

  本项目收录以下基于Flash技术的流媒体示例:

  simple_as3_rtmp_player:最简单的RTMP播放器(基于ActionScript)

  simple_as3_rtmp_streamer:最简单的RTMP流媒体(基于ActionScript)

  rtmp_sample_player_adobe:从 Adob​​e Flash Media Sever 中提取的测试播放器

  rtmp_sample_player_wowza:从 Wowza 服务器提取的测试玩家

  rtmp_sample_player_flowplayer:基于FlowPlayer的RTMP/HTTP播放器(添加RTMP插件)

  rtmp_sample_player_videojs:基于VideoJS的RTMP/HTTP播放器

  rtmp_sample_player_jwplayer:基于JWplayer的RTMP/HTTP播放器

  hls_sample_player_flowplayer:基于FlowPlayer的HLS播放器(添加HLS插件)

  hls_video_player_html5:基于HTML5的HLS/HTTP播放器

  activex_vlc_player:基于VLC的ActiveX控件播放器

  注意:部分播放器无法直接打开html页面,需要将播放器放到web服务器上。

  (如Apache或Nginx)

  81

0 个评论

要回复文章请先登录注册


官方客服QQ群

微信人工客服

QQ人工客服


线