Method Summary |
|
double |
getStreamingPosition() Returns the current position of the stream (in seconds). |
bool |
isPlaying() Checks whether the stream is playing. |
static StreamedVideo |
loadFromFile(String path) Create a streamed sound file using a file path |
static StreamedVideo |
loadFromResource(ResourcePath path) Create a streamed video file using a resource path. |
void |
play() Starts playback of video stream. Will automatically stop after video ended. |
void |
playLoop() Starts playback of video stream. Will automatically restart after video ended. |
void |
setAudioGain(float gain) Sets the audio's gain. |
void |
stop() Stops playback of video stream. |
Method Detail |
public double getStreamingPosition()
Returns the current position of the stream (in seconds).
Returns:
Stream position in seconds, -1 when not playing.
Since:
2.6.2.0
public bool isPlaying()
Checks whether the stream is playing.
Since:
2.6.2.0
public static StreamedVideo loadFromFile(String path)
Create a streamed sound file using a file path
path is relative to the classpath. The path should be a constant string expression so that the park package tool can detect used files. If the path is not a constant string expression, the compiler will show a warning and the file will not be detected by the package tool and will therefore not automatically be added to the park package. Will return null if path is null or the file could not be opened.
public static StreamedVideo loadFromResource(ResourcePath path)
Create a streamed video file using a resource path.
The resource path can be obtained from Script.getResourcePathForId Will return null if the resource path is unknown or the video file could not be opened.
public void play()
Starts playback of video stream. Will automatically stop after video ended.
public void playLoop()
Starts playback of video stream. Will automatically restart after video ended.
public void setAudioGain(float gain)
Sets the audio's gain.
gain: 0..1
public void stop()
Stops playback of video stream.