일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- flex3
- ajax
- 명사 뽑아내기
- php thumbnail
- 도커
- 나의 취미
- node.js web framework
- 메일왕창보내는법
- C/C++
- docker
- 명사 추출기
- 명사 분석기
- 나의 프로젝트
- scala
- Cross
- 스킨 스쿠버
- ejb
- Eclipse
- ror실행
- 주식이야기
- Lift
- 디즈니씨
- nodejs express
- 베트남어
- Node.js
- 책이야기
- express for node.js
- rss
- iBatis
- php
- Today
- Total
nkdk의 세상
간단한 동영상 플레이어 본문
간단한 동영상 플레이어입니다. 오버 롤 기능을 이용해서 플레이, 정지, 취소 볼률 조절까지 가능합니다.
유용하리라 생각되네요 ^^
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="335" width="401"
backgroundGradientAlphas="[0.79, 0.24]" backgroundGradientColors="[#040404, #E3EFEE]"
horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:states>
<mx:State name="bottomControl">
<mx:SetStyle target="{myHBox}" name="bottom" value="8" />
</mx:State>
</mx:states>
<mx:Style>
Button {
cornerRadius: 0;
paddingLeft: 1;
paddingRight: 1;
paddingTop: 0;
letterSpacing: 0;
highlightAlphas: 0.58, 0.54;
themeColor: #000000;
}
</mx:Style>
<mx:Script>
<![CDATA[
import mx.events.VideoEvent;
private var controlsTimer:Timer;
override protected function childrenCreated():void
{
super.childrenCreated();
controlsTimer = new Timer(3000, 0);
controlsTimer.addEventListener(TimerEvent.TIMER, onControlsTimeOut);
}
private function onControlsTimeOut(event:TimerEvent):void
{
controlsTimer.stop();
currentState="";
}
/***
* 롤오버
*/
private function rOver(event:MouseEvent) :void
{
if (event.relatedObject == parentDocument)
{
currentState="bottomControl";
}
else if (event.target == myHBox)
{
controlsTimer.stop();
}
}
/**
* 롤아웃
*/
private function rOut(event:MouseEvent) :void
{
if (event.relatedObject == parentDocument)
{
currentState="";
}
else if (event.target == myHBox)
{
controlsTimer.start();
}
}
private var bChk : Boolean = false ;
private function myFlvStchg(event:VideoEvent):void
{
if (event.state == VideoEvent.PLAYING)
{
btnPaly.enabled = false ;
btnPause.enabled = true ;
btnStop.enabled = true ;
}
if ((event.state == VideoEvent.PAUSED) || (event.state == VideoEvent.STOPPED))
{
btnPaly.enabled = true ;
btnPause.enabled = false ;
btnStop.enabled = false ;
}
}
import mx.events.SliderEvent;
private var bTimePass:Boolean=false;
private function fnTimeChange(e:SliderEvent):void
{
myFlv.playheadTime = e.value;
}
private function fnHeadChange(e:VideoEvent ):void
{
if(bTimePass){return;} // HSilder 드래그중이라면 위치를 변경할수 없다.
hsider.value = e.playheadTime;
}
private function fnVolumeChange(e:SliderEvent):void
{
myFlv.volume = e.value;
}
]]>
</mx:Script>
<mx:VideoDisplay id="myFlv" autoPlay="true" source="T0006174_300.flv"
right="10" left="10" top="10" bottom="10"
rollOver="rOver(event);"
rollOut="rOut(event);"
stateChange="myFlvStchg(event);"
playheadUpdate="fnHeadChange(event)"/>
<mx:HBox id="myHBox"
rollOver="rOver(event);"
rollOut="rOut(event);"
direction="horizontal"
borderStyle="solid"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"
fontFamily="굴림체" fontSize="12" visible="true"
backgroundAlpha="0.11"
horizontalAlign="right"
verticalAlign="middle"
height="40" width="358"
horizontalCenter="0"
horizontalScrollPolicy="off"
verticalScrollPolicy="off" bottom="-40" color="#FCFEFE" borderThickness="1" alpha="1.0">
<mx:HSlider id="hsider"
maximum="{myFlv.totalTime}"
change="fnTimeChange(event)"
thumbPress="{bTimePass=true}"
thumbRelease="{bTimePass=false}"/>
<mx:VSlider id="volume"
height="36"
maximum="1"
value="1"
change="fnVolumeChange(event)"
/>
<mx:Button id="btnPaly" label="▶" click="myFlv.play();"/>
<mx:Button id="btnPause" label="Ⅱ" click="myFlv.pause();" enabled="false"/>
<mx:Button id="btnStop" label="■" click="myFlv.stop();" enabled="false"/>
</mx:HBox>
<mx:transitions>
<mx:Transition id="controlTransition" fromState="*" toState="*">
<mx:Parallel>
<mx:Move target="{myHBox}" />
</mx:Parallel>
</mx:Transition>
</mx:transitions>
</mx:Application>