Project

General

Profile

Support #6203

Using custom WProgressBar with WMediaPlayer

Added by Momo LALMI over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/10/2018
Due date:
% Done:

0%

Estimated time:

Description

Hello,

I am using a custom WProgressBar to handle time updated event of WMediaPlayer but there is a client-server round trip:

###################################################

WMediaPlayer * audioPlayer = new WMediaPlayer();

audioPlayer->timeUpdated().connect(this, &MyWidget::audioPlaybackTimeUpdated);

...

...

void MyWidget::audioPlaybackTimeUpdated()

{

MyProgressBar->setValue( .... calculated value ... )

}

##############################################

Is there a way to make a javascript only connection between the WProgressBar and the WMediaPlayer objects ?

thanks a lot in advance for your help,

#1

Updated by Momo LALMI over 4 years ago

Hello,

I am now using WMediaPlayer::setControlsWidget(...) to avoid client-server round trip

but I have detected a possible bug in file WMediaPlayer.C :

below: I think :

if (control_[i]) {

Should be replaced by :

if (display_[i]) {

because control_[0] is reserved for "videoPlay" button and is not related to "currentTime" WText

//########################################################

const char *displaySelectors[] =

{ "currentTime", "duration" };

for (unsigned i = CurrentTime; i < Duration; ++i) {

if (control_[i]) {

if (!first)

ss << ", ";

ss << const_cast<char *>(displaySelectors[i]) << ":\"#\"

<< display_[i]->id() << "\"\";

first = false;

}

}

//########################################################

Also available in: Atom PDF