当前位置: 首页 > article >正文

How to play a video file?

How to play a video file?

Using VideoIO you can publish using real-time streaming (only rtmp or rtmfp URLs) but play using streaming (rtmp orrtmfp) as well as web download mode (http or https). Please see How to record and play a video message? for details on the streaming play mode. This tutorial will walk you through details on the web downloaded play mode.

If you want to play a video file that is already available on some web server, you can just set the src property with the URL of the FLV file. For example, there are some free FLV files here.

If you want to play your video files, e.g., the ones you recorded using VideoIO, you will need to serve your files from a web server. There are many free and commercial web servers in the market, e.g., Apache httpd. Information about how to set up a web server is beyond the scope of this tutorial.

Python comes with a built-in web server named SimpleHTTPServer that can server any file from your current directory or sub-directory. Suppose you have your video files in the current directory, you can start a web server as follows, then open a browser and point it to http://localhost:8080 to see the list of files in the directory where you ran this command.

$ python -m SimpleHTTPServer 8080

Suppose you have a video file named file1.flv which you can now reach using http://localhost:8080/file1.flv from a browser. For playing this file using VideoIO, just set this URL to the src property.

To programmatically set the property, use JavaScript as shown below. The example is similar to the one in How to record and play a video message? where you can set the src property of the VideoIO object named video1.


 
<object type="application/x-shockwave-flash" data="VideoIO.swf"id="video1" width="320" height="240"><param name="movie" value="VideoIO.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="flashVars" value="controls=true" />
</object>
<script>
function getFlashMovie(movieName) {var isIE = navigator.appName.indexOf("Microsoft") != -1;return (isIE) ? window[movieName] : document[movieName];  
}
</script>
<input id="src1" type="text"/>
<input value="set" type="button" οnclick="getFlashMovie('video1').setProperty('src', document.getElementById('src1').value)"/>
<input value="reset" type="button" οnclick="getFlashMovie('video1').setProperty('src', null)"/>

This type of message playback with http or https URL is called web downloaded play mode. The control panel allows you to pause or play the media, or seek to a new position of the total duration is available using the play head bar. You can create your own JavaScript and HTML based user interface to control these properties of VideoIO.

http://www.lryc.cn/news/2418350.html

相关文章:

  • AV管理 智联无限 | ATLONA全国巡回路演成功亮相济南!
  • IT男,你应该在任何行业所向披靡
  • Facebook:每天数千次配置更新,如何实现用户零干扰
  • 会议技术发展与高清视频会议系统
  • Metro风格的Java组合框(JMetro)–重新介绍
  • [2011-04-30]返现网排行榜
  • 108 道 Python 面试笔试题超强汇总 - 下部
  • Affinity Designer Beta for Mac(专业平面设计软件)
  • OMNIPAY(欧米派、欧米链)-全球领先的多链数字钱包
  • 免费资源网站大全
  • 国内外各大免费搜索引擎、导航网址提交入口
  • 如何入门编程:一份初学者的指南
  • Nginx部署代理访问网站正常,进入页面后刷新出现404问题
  • iphone6 问题总结
  • 商业模式了解
  • 一劳永逸解决VLC播放中文字幕乱码问题
  • Android编程权威指南(第4版)
  • 全自动高清录播服务器,全自动高清录播服务器 高清录播系统 一体化操作;易使用 操作简便...
  • 9家在iOS平台上收入最高的中国公司
  • udp transparent proxy
  • 15个国外最佳免费图片素材网站,快让小伙伴都知道
  • 汉字转换为拼音
  • ExtJs桌面组件
  • 介绍一个很不错的电影网站
  • 深入学习Go-7 Channel
  • 爬过这些网站才算会爬虫
  • oracle database filesystem (DBFS) 简单配置文档
  • 10个好用的免费图片网站,绝对能在2021年设计上好帮手
  • (转)新民周刊:3Q大战始末
  • Cisco3750G和H3C S5024P端口汇聚做VLAN trunk案例