swf播放器源碼
❶ FLASH播放器部分源代碼解說
//var ti:Number;
function showTip(datext) { //定義showtip函數 用來顯示與解釋 按鈕的功能
ti = getTimer(); // 自 SWF 文件開始播放時起已經過的毫秒數
main.tooltip.datext.text = datext; //當此函數被調用時,把獲的的變數datext賦給tootlip文本
main.tooltip.onEnterFrame = function() {
//var tempti = getTimer();
//if (//tempti-ti<500) {
this._x = Math.round(main._xmouse); //確定tooltip出現在滑鼠附近
this._y = Math.round(main._ymouse);
main.tooltip._visible = true;//}
};}
function removeTip() { //定義removetip()函數,
main.tooltip._visible = false;
delete main.tooltip.onEnterFrame; //刪除main.tooltip.onEnterFrame 相當於隱藏tooltip
}
main.tooltip._visible = false;
main.mute.onRelease = function() { //利用mute控制聲音
if (sou.getVolume() == 0) {
sou.setVolume(myVolume);
cb.vol._x = 544+55*myVolume/100; //控制聲音條vol 復原到有聲音時的位置
} else {
myVolume = sou.getVolume();
sou.setVolume(0);
cb.vol._x = 544; //控制聲音條vol 靜音時的位置
}
main.bugle.play();};
main.mute.onRollOver = function() {
showTip("Toggle Mute");
};
main.mute.onRollOut = function() {
removeTip();
};
❷ swf的播放器代碼怎麼加
這樣的代碼是屬於FLASH或是視頻之類的代碼,和空間代碼是不一樣的,你將它莰入新建模塊中的FLASH中,就可以發
❸ swf播放器文件 代碼
這是flash的影片格式,用flash播放器就能播放,不需要代碼的。
❹ 求網頁播放SWF播放器代碼。能實現全屏功能。
在你有的flash視頻播放器代碼里加上這一條就可以了
<param name="allowFullScreen" value="true" />
❺ swf格式的播放器怎麼弄
其實不用會寫代碼,你只需要 下載一個Camtasia Studio 5的破解版。
把你的視頻通過這個軟體 錄制一下,然後自動生成FLASH,並做相應設置即可。
生成的FLASH可以包含你需要的播放控制按鈕。
❻ swf播放器修改,不是swf動畫,是SWF播放器 用什麼軟體可以打開 然後修改源碼
射手影音(開源軟體)
❼ 求as3製作的swf播放器源碼一份
mp3播放器源碼:(文件載入一個名字為song.mp3的音頻文件) package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.text.TextField;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.net.URLRequest;
import flash.text.TextFormat;
import flash.utils.Timer;
public class CookBookPlayer extends Sprite {
private var _channel:SoundChannel;
private var _displayText:TextField;
private var _sound:Sound;
private var _panControl:PanControl;
private var _playing:Boolean=false;
private var _playPauseButton:Sprite;
private var _position:int=0;
private var _spectrumGraph:SpectrumGraph;
private var _volumeControl:VolumeControl;
public function CookBookPlayer() {
init();
}
private function init():void {
// Stage alignment
stage.scaleMode=flash.display.StageScaleMode.NO_SCALE;
stage.align=flash.display.StageAlign.TOP_LEFT;
// Enter frame listener
var timer:Timer=new Timer(20);
timer.addEventListener(TimerEvent.TIMER,onTimer);
timer.start();
_playing=true;
// Display a text field
_displayText=new TextField ;
addChild(_displayText);
_displayText.x=10;
_displayText.y=17;
_displayText.width=256;
_displayText.height=14;
// Create a sound object
_sound=new Sound(new URLRequest("song.mp3"));
_sound.addEventListener(Event.ID3,onID3);
_channel=_sound.play();
// Create a bitmap for spectrum display
_spectrumGraph=new SpectrumGraph;
_spectrumGraph.x=10;
_spectrumGraph.y=33;
addChild(_spectrumGraph);
// Create the Play and Pause buttons
_playPauseButton=new PlayButton ;
_playPauseButton.x=10;
_playPauseButton.y=68;
addChild(_playPauseButton);
_playPauseButton.addEventListener(MouseEvent.MOUSE_UP,onPlayPause);
// Create volume and pan controls
_volumeControl=new VolumeControl ;
_volumeControl.x=45;
_volumeControl.y=68;
addChild(_volumeControl);
_volumeControl.addEventListener(Event.CHANGE,onTransform);
_panControl=new PanControl ;
_panControl.x=164;
_panControl.y=68;
addChild(_panControl);
_panControl.addEventListener(Event.ENTER_FRAME,onTransform);
}
private function onTransform(event:Event):void {
// Get volume and pan data from controls
// and apply to a new SoundTransform object
_channel.soundTransform=new SoundTransform(_volumeControl.volume,_panControl.pan);
}
private function onPlayPause(event:MouseEvent):void {
// If playing, stop and record that position
if (_playing) {
_position=_channel.position;
_channel.stop();
} else {
// Else, restart at the saved position
_channel=_sound.play(_position);
}
_playing=! _playing;
}
private function onID3(event:Event):void {
// Display selected id3 tags in the text field
_displayText.text=_sound.id3.artist + " : " + _sound.id3.songName;
_displayText.setTextFormat(new TextFormat("華文楷體",12,0));
}
private function onTimer(event:TimerEvent):void {
var barWidth:int=256;
var barHeight:int=5;
var loaded:int=_sound.bytesLoaded;
var total:int=_sound.bytesTotal;
var length:int=_sound.length;
var position:int=_channel.position;
// Draw a background bar
graphics.clear();
graphics.beginFill(0xFFFFFF);
graphics.drawRect(10,10,barWidth,barHeight);
graphics.endFill();
if (total > 0) {
// The percent of the sound that has loaded
var percentBuffered:Number=loaded / total;
// Draw a bar that represents the percent of
// the sound that has loaded
graphics.beginFill(0xCCCCCC);
graphics.drawRect(10,10,barWidth * percentBuffered,barHeight);
graphics.endFill();
// Correct the sound length calculation
length/= percentBuffered;
// The percent of the sound that has played
var percentPlayed:Number=position / length;
// Draw a bar that represents the percent of
// the sound that has played
graphics.beginFill(0x0000FF);
graphics.drawRect(10,10,barWidth * percentPlayed,barHeight);
graphics.endFill();
_spectrumGraph.update();
}
}
}
}
// "helper classes"
// (This is an outside package, but it's available to classes
// in the same file)
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
import flash.geom.Rectangle;
import flash.media.SoundMixer;
import flash.utils.ByteArray;class PlayButton extends Sprite {
public function PlayButton() {
init();
}
private function init():void {
// Draw the Play/Pause graphic
graphics.beginFill(0xcccccc);
graphics.drawRoundRect(0,0,20,16,4,4);
graphics.endFill();
graphics.beginFill(0x333333);
graphics.moveTo(4,4);
graphics.lineTo(8,8);
graphics.lineTo(4,12);
graphics.lineTo(4,4);
graphics.drawRect(10,4,2,8);
graphics.drawRect(14,4,2,8);
graphics.endFill();
}
}class SpectrumGraph extends Sprite {
private var _spectrumBMP:BitmapData;
public function SpectrumGraph() {
// Bitmap to draw spectrum data in
_spectrumBMP=new BitmapData(256,30,true,0x00000000);
var bitmap:Bitmap=new Bitmap(_spectrumBMP);
bitmap.filters=[new DropShadowFilter(3,45,0,1,3,2,.3,3)];
addChild(bitmap);
}
internal function update():void {
// Get spectrum data
var spectrum:ByteArray=new ByteArray;
SoundMixer.computeSpectrum(spectrum);
// Draw to bitmap
_spectrumBMP.fillRect(_spectrumBMP.rect,0xff666666);
_spectrumBMP.fillRect(new Rectangle(1,1,254,28),0x00000000);
for (var i:int=0; i < 256; i++) {
_spectrumBMP.setPixel32(i,10 + spectrum.readFloat() * 10,0xff000000);
}
for (i=0; i < 256; i++) {
_spectrumBMP.setPixel32(i,20 + spectrum.readFloat() * 10,0xff000000);
}
}
}
class VolumeControl extends Sprite {
public var volume:Number=1.0;
public function VolumeControl() {
addEventListener(MouseEvent.CLICK,onClick);
draw();
}
public function onClick(event:MouseEvent):void {
// When user clicks the bar, set the volume
volume=this.mouseX / 100;
draw();
dispatchEvent(new Event(Event.CHANGE));
}
private function draw():void {
// Draw a bar and the current volume position
graphics.beginFill(0xFF0000);
graphics.drawRect(0,0,102,16);
graphics.endFill();
graphics.beginFill(0x000000);
graphics.drawRect(volume * 100,0,2,16);
}
}
class PanControl extends Sprite {
public var pan:Number=0;
public function PanControl() {
addEventListener(MouseEvent.CLICK,onClick);
draw();
}
private function onClick(event:MouseEvent):void {
// When the user clicks bar, set pan
pan=this.mouseX / 50 - 1;
draw();
dispatchEvent(new Event(Event.ENTER_FRAME));
}
private function draw():void {
// Draw the bar and current pan position
graphics.beginFill(0x00FF00);
graphics.drawRect(0,0,102,16);
graphics.endFill();
graphics.beginFill(0x000000);
graphics.drawRect(50 + pan * 50,0,2,16);
}
}
❽ 誰幫給個最簡單的SWF播放起代碼,
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer1" width="寬度" height="高度"> classid就是class的id啦,還能怎麼解釋呢 <param name="URL" value="視頻鏈接">
要播放的url
<param name="rate" value="1">
播放速率,1.0是原本的速率
<param name="balance" value="0">
左右聲音平衡,-100全左,100全右
<param name="currentPosition" value="0">
現在位置,就是播放到多少秒了
<param name="defaultFrame" value>
用來顯示在ScriptCommand事件接受到的url的frame的name
<param name="playCount" value="1">
播放多少次,默認1次
<param name="autoStart" value="0">
是否自動開始播放
<param name="currentMarker" value="0">
設定當前使用的marker的index,你必須先設定marker,否則將error
<param name="invokeURLs" value="-1">
是否打開這個媒體文件指定的url
<param name="baseURL" value>
基礎url
<param name="volume" value="100">
音量
<param name="mute" value="0">
是否靜音
<param name="uiMode" value="full">
就是指是不是要顯示那個用戶控制媒體的panel,就是那個play/stop的那個
<param name="stretchToFit" value="-1">
是否要拉伸視頻來適應播放窗口
<param name="windowlessVideo" value="0">
是否以無窗口模式播放,如果是的話,你是可以在它前面顯示別的element的
<param name="enabled" value="-1">
是否激活
<param name="enableContextMenu" value="-1">
是否有右鍵菜單
<param name="fullScreen" value="0">
全屏
<param name="SAMIStyle" value>
指定一個定義在SAMI文件中的SAMIStyle,用在標題上
<param name="SAMILang" value>
SAMI語言
<param name="SAMIFilename" value>
SAMI文件名
<param name="captioningID" value>
顯示標題的元素的ID,必須和media player在同一個frame中
<param name="enableErrorDialogs" value="0">
是否顯示錯誤提示的對話框
<param name="_cx" value="10239"> <param name="_cy" value="1667"> </object>
❾ swf播放器代碼
qvodplayer貌似可以吧
❿ 求網頁swf播放器代碼,需要能控制進度。
1樓,最快回復的那個。滾尼瑪,下載文件後再讓你打開另外一個有病毒的網址