Project

General

Profile

Actions

Support #6203

open

Using custom WProgressBar with WMediaPlayer

Added by Momo LALMI about 6 years ago. Updated about 6 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,

Actions #1

Updated by Momo LALMI about 6 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;

}

}

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

Actions

Also available in: Atom PDF