918
Chapter 14: Properties
The following example uses the
pausedAtStart
property to buffer a RealMedia sprite off the
Stage, and then play it on the Stage once the buffering is complete. In this example, the
RealMedia member has its
pausedAtStart
property set to
TRUE
. An instance of this member is
positioned off the Stage, in sprite channel 1. The following frame script should be placed in the
sprite span:
-- Lingo syntax
on exitFrame me
if sprite(1).state > 3 then -- check to see if buffering is complete
sprite(1).locH = 162
sprite(1).locV = 118
sprite(1).play() -- position and play the sprite
end if
end
// JavaScript syntax
function exitFrame() {
var st = sprite(1).state;
if (st > 3) { // check to see if buffering is complete
sprite(1).locH = 162;
sprite(1).locV = 118;
sprite(1).play(); // position and play the sprite
}
}
The RealMedia sprite will buffer off the Stage and then appear on the Stage and play immediately
when the buffering is complete.
percentBuffered
Usage
-- Lingo syntax
memberOrSpriteObjRef
.percentBuffered
// JavaScript syntax
memberOrSpriteObjRef
.percentBuffered;
Description
RealMedia sprite or cast member property; returns the percentage of the buffer that has been
filled with the RealMedia stream that is loading from a local file or the server. When this property
reaches 100, the buffer is full, and the RealMedia stream begins to play if the
pausedAtStart
property is not set to
TRUE
. This property is dynamic during playback and cannot be set.
The buffer is a type of memory cache that contains the portion of the movie that is about to play,
usually just a few seconds. The stream enters the buffer as it streams to RealPlayer and leaves the
buffer as RealPlayer plays the clip. The buffer allows viewers to view content without
downloading the entire file, and prevents network congestion or lapses in bandwidth availability
from disrupting the playback stream.
The buffering process is initiated by the
play
command, and once the buffer is full (100%), the
portion of the stream that is in the buffer begins to play. Because the initial buffering process takes
a few seconds, there is a delay between the time when the
play
command is called and when the
stream actually begins to play. You can work around this using the
pausedAtStart
command,
starting to play the stream off the Stage during the buffering process, and then displaying the
stream on the Stage as it actually begins to play. (For more information, see the example in the
pausedAtStart (RealMedia, Windows Media)
on page 917
entry.)
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...