当前位置:首页 » 操作系统 » swf播放器源码

swf播放器源码

发布时间: 2022-06-26 05:38:08

❶ 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楼,最快回复的那个。滚尼玛,下载文件后再让你打开另外一个有病毒的网址

热点内容
php种子怎么打开 发布:2024-11-15 06:07:01 浏览:346
密码箱的密码忘记了如何开锁 发布:2024-11-15 06:04:41 浏览:955
安卓软件和苹果系统哪个好 发布:2024-11-15 05:48:32 浏览:283
pythonwhileelse 发布:2024-11-15 05:39:10 浏览:672
java文件流上传文件 发布:2024-11-15 05:24:02 浏览:147
linux安装so 发布:2024-11-15 05:22:29 浏览:581
九游版冒险王2适合安卓哪个版本 发布:2024-11-15 05:12:33 浏览:600
iphonexsmax怎么连接服务器 发布:2024-11-15 05:11:46 浏览:776
长江存储校招 发布:2024-11-15 05:11:01 浏览:967
oraclesql函数大全 发布:2024-11-15 05:10:00 浏览:466