Brian
Brian

Reputation: 3914

Spark VideoDisplay - telling whether the video is currently playing

I'm writing a Flex video player with a "slow advance" button, and my first approach is to simply toggle between play() and pause() on a timer. I'd like to say something like

if (video.isPlaying) {
    video.pause();
} else {
    video.play();
}

But I can't find anything like an 'isPlaying' property. Am I barking up the wrong tree?

Upvotes: 0

Views: 505

Answers (2)

FTQuest
FTQuest

Reputation: 546

The property (Boolean) is not "isPlaying" but simply "playing" :) FTQuest

Upvotes: 1

JeffryHouser
JeffryHouser

Reputation: 39408

How about something like this:

if (video.currentCSSState == 'playing'){
 // is playing
} else {
 // is not playing
}

Since currentCSSState is a protected method you'll have to extend the video component and either expose it or ad your own "isPlaying" property/method.

Upvotes: 0

Related Questions