Fork me on GitHub

Programming Design Notes

Flash Video Player

| Comments

推介 2 款比較好用的 Video Player,JW FLV Player 和 OS FLV Player,這 2 款播放器都可以直接跳到片段任何位置,就算未下載完畢也可以。

JW FLV Player: http://www.longtailvideo.com/players/jw-flv-player/

JW Flv Player 支援的格式包括 flv, mp4, mp3, jpg, gif, png。亦支援 HTTP Streaming 和 RTMP Streaming。直接播放 youtube 影片, XML 設定面版等等。



Please enable javascript or install flash player


使用方法很簡單,在這裡我使用了 SWFObject 將 Flash 插入。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var swf = "http://programming-design-notes-file.googlecode.com/svn/trunk/file/swf/jw-player.swf";
var flashvars = {
'file': 'http://sites.google.com/site/lawrencespace/lawpronotes/file/FunnyCats.flv'
};
var params = {
'allowfullscreen': 'true',
'allowscriptaccess': 'always'
};
swfobject.embedSWF(swf, "video", "470", "320", "9.0.0.0", "http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf", flashvars, params, null, null);
</script>
<title>JW Player</title>
</head>
<body>
<div id="video">
Please enable javascript or install flash player
</div>
</body>
</html>

OS FLV Player: http://www.osflv.com/

OS FLV Player 特別之處是可以用 PHP 來控制 Flash Player。亦可以自由設定顏色,自動播放,音量,預先讀取 flv 檔案等等。


Please enable javascript or install flash player


使用方法:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var swf = "http://programming-design-notes-file.googlecode.com/svn/trunk/file/swf/OSplayer.swf";
var flashvars = {
'movie': 'http://sites.google.com/site/lawrencespace/lawpronotes/file/FunnyCats.flv',
'accentcolor': '0x20b3f7',
'btncolor': '0x333333',
'txtcolor': '0xffffff',
'previewimage': '',
'autoplay': 'off',
'autoload': 'on',
'mute': 'off'
};
var params = {
'allowfullscreen': 'true'
};
swfobject.embedSWF(swf, "os-player", "470", "320", "9.0.0.0", "http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf", flashvars, params, null, null);
</script>
<title>OS FLV Player</title>
</head>
<body>
<div id="os-player">
Please enable javascript or install flash player
</div>
</body>
</html>

相關書籍: Adobe Flash CS4 Professional Classroom in a BookFlash CS4 Professional Digital ClassroomFlash CS4 Professional for Windows and Macintosh: Visual QuickStart Guide