Pakiet org.osmf.traits udostępnia elementy składowe do tworzenia cech materiałów multimedialnych.
Cechy definiują możliwości elementów multimedialnych.
W różnych implementacjach elementów multimedialnych agregowane są różne
zestawy cech w zależności od własności elementów.
Na przykład: element audio może agregować cechy IAudible, IPlayable, ITemporal i ILoadable.
Poszczególne cechy definiują możliwości elementu multimedialnego nie zależnie od konkretnej implementacji danego elementu.
Cecha ILoadable zapewnia elementowi multimedialnemu funkcję ładowania i wyładowywania.
I podobnie: implementacja cechy IPlayable sprawia, że element może sam siebie odtwarzać.
Cecha jest dodawana do elementu multimedialnego za pośrednictwem metody MediaElement.addTrait()
elementu.
Implementacja cech multimediów jest oparta na następujących zasadach:
- Cechy są od siebie nie zależne. Dlatego jedna cecha nie powoduje rozszerzenia innej cechy.
- Cechy wywołują własne zdarzenia. Implementacje cech mogą wywodzić się z klasy MediaTraitBase, która rozszerza
klasę EventDispatcher i implementuje IMediaTrait, w celu obsługiwania wywołań zdarzeń.
- Cechy są identyfikowane przez klasę wyliczeniową MediaTraitType.
- Cechy powinny być implementowane jako osobne klasy.
Interfejsy cech są przeznaczone do użytku przez klasy elementów multimedialnych.
Są to podstawowe obiekty uzewnętrznione, zawierające głównie funkcje pobierające bez
ustawiających — z wyjątkiem tych cech, które wymagają właściwości ustawianych zewnętrznie,
np. głośność lub panoramowanie cechy IAudible.
Klasy bazowe cech są przeznaczone do użytku przez implementacje podklasy MediaElement.
Zwykle zawierają funkcje ustawiające i pobierające.
Klasy
| Klasa | Opis |
---|
| AlternativeAudioTrait |
AlternativeAudioTrait defines the trait interface for media supporting alternative
audio streams. |
| AudioTrait |
AudioTrait defines the trait interface for media that have audio. |
| BufferTrait |
BufferTrait defines the trait interface for media that can use a data buffer. |
| DisplayObjectTrait |
DisplayObjectTrait defines the trait interface for media that expose a DisplayObject,
and which may have intrinsic dimensions. |
| DRMState |
DRMState is the enumeration of possible DRM-specific states that a
piece of media can be in. |
| DRMTrait |
DRMTrait defines the trait interface for media which can be
protected by digital rights management (DRM) technology. |
| DVRTrait |
DVRTrait defines the trait interface for media that can be played
while in the process of being recorded, as if with a digital video
recorder (DVR). |
| DynamicStreamTrait |
DynamicStreamTrait defines the trait interface for media supporting dynamic stream
switching. |
| LoaderBase |
LoaderBase is the base class for objects that are capable of loading
and unloading LoadTraits. |
| LoadState |
LoadState is the enumeration of possible states that a LoadTrait
can be in. |
| LoadTrait |
LoadTrait defines the trait interface for media that must be loaded before it
can be presented. |
| MediaTraitBase |
A MediaTraitBase is the encapsulation of a trait or capability that's
inherent to a MediaElement. |
| MediaTraitType |
MediaTraitType is the enumeration of all possible media trait types. |
| PlayState |
PlayState is the enumeration of possible states that a PlayTrait
can be in. |
| PlayTrait |
PlayTrait defines the trait interface for media whose playback can be started
and stopped. |
| SeekTrait |
SeekTrait defines the trait interface for media that can be instructed
to jump to a position in time. |
| TimeTrait |
TimeTrait defines the trait interface for media that have a duration and
a currentTime. |
| TraitEventDispatcher |
TraitEventDispatcher is a utility class that exposes a uniform
interface for receiving trait events from a MediaElement. |
© 2015 Adobe Systems Incorporated. All rights reserved.
Tue Jun 12 2018, 12:20 PM Z