| 패키지 | org.osmf.elements |
| 클래스 | public class DurationElement |
| 상속 | DurationElement ProxyElement MediaElement EventDispatcher Object |
| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | OSMF 1.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
The DurationElement class is especially useful for creating delays in the presentation of a media composition. For example, the following code presents a sequence of videos, separated from each other by five-second delays.
var sequence:SerialElement = new SerialElement();
sequence.addChild(new VideoElement(new URLResource("http://www.example.com/video1.flv")));
sequence.addChild(new DurationElement(5));
sequence.addChild(new VideoElement(new URLResource("http://www.example.com/ad.flv")));
sequence.addChild(new DurationElement(5));
sequence.addChild(new VideoElement(new URLResource("http://www.example.com/video2.flv")));
// Assign the SerialElement to the MediaPlayer.
player.media = sequence;
The following example presents a sequence of rotating banners. The delays separating the appearances of the banners are created with DurationElements. In addition, the images themselves are wrapped in DurationElements to enable them to support a duration.
// The first banner does not appear for five seconds.
// Each banner is shown for 20 seconds.
// There is a 15-second delay between images.
var bannerSequence:SerialElement = new SerialElement();
bannerSequence.addChild(new DurationElement(5));
bannerSequence.addChild(new DurationElement(20,new ImageElement(new URLResource("http://www.example.com/banner1.jpg")));
bannerSequence.addChild(new DurationElement(15));
bannerSequence.addChild(new DurationElement(20,new ImageElement(new URLResource("http://www.example.com/banner2.jpg")));
bannerSequence.addChild(new DurationElement(15));
bannerSequence.addChild(new DurationElement(20,new ImageElement(new URLResource("http://www.example.com/banner3.jpg")));
clipStartTime and clipEndTime properties.
관련 API 요소
공용 속성
보호 속성
공용 메서드
| 메서드 | 정의 주체 | ||
|---|---|---|---|
Constructor. | DurationElement | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | |
![]() |
Adds a Metadata object to this MediaElement under the specified namespace URL. | MediaElement | |
![]() |
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | |
![]() |
Returns the Metadata object that is stored under this MediaElement with
the specified namespace URL. | MediaElement | |
![]() |
Returns the media trait of the specified type. | MediaElement | |
![]() |
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | |
![]() |
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | |
![]() |
Determines whether this media element has a media trait of the
specified type. | MediaElement | |
![]() |
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | |
![]() |
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | |
![]() |
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | |
![]() |
Removes the Metadata object that was stored under this MediaElement with
the specified namespace URL. | MediaElement | |
![]() |
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | |
![]() |
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 프리미티브 값을 반환합니다. | Object | |
![]() |
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | |
보호 메서드
생성자 세부 정보
DurationElement | () | 생성자 |
public function DurationElement(duration:Number, mediaElement:MediaElement = null)| 언어 버전: | ActionScript 3.0 |
| 제품 버전: | OSMF 1.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
Constructor.
매개 변수duration:Number — Duration of the DurationElement's TimeTrait, in seconds.
| |
mediaElement:MediaElement (default = null) — Optional element to be wrapped by this DurationElement.
|
예제 예제 사용 방법
DurationElementExample.as
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import org.osmf.elements.BeaconElement;
import org.osmf.elements.DurationElement;
import org.osmf.elements.ImageElement;
import org.osmf.elements.VideoElement;
import org.osmf.media.MediaPlayer;
import org.osmf.media.MediaPlayerSprite;
import org.osmf.media.URLResource;
public class DurationElementExample extends Sprite
{
public function DurationElementExample()
{
super();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
var imageElement:ImageElement = new ImageElement();
imageElement.resource = new URLResource("http://mediapm.edgesuite.net/strobe/content/test/train.jpg");
// Shows the image for 10 seconds.
var durationElement:DurationElement = new DurationElement(10, imageElement);
addChild(mediaPlayerSprite);
mediaPlayerSprite.media = durationElement;
}
}
}
Tue Jun 12 2018, 03:17 PM Z
상속되는 공용 속성 숨기기
상속되는 공용 속성 표시