Problem with Player.stopAfterEachTrack

The forum for designers and developers.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Problem with Player.stopAfterEachTrack

Postby SilverEagle » 5. Jan 09, 20:24


SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Problem with Player.stopAfterEachTrack

Postby SilverEagle » 5. Jan 09, 22:24


User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Problem with Player.stopAfterEachTrack

Postby Service-Team » 6. Jan 09, 23:39

Hello SilverEagle,

we've tested your button, and everything works as expected for us.

If we click "A", state is set to ON without showing a message
If we click "B", state is set to OFF without showing a message
If we click "C", the state TOGGLES and a message is displayed.

Some notes that may help to find the error:

- don't be confused about the message shown. It is NOT updated if you use directly. If you want a message in this case, use

- make sure NOT to use a target when using the onclick handler (unless you REALLY know what you are doing) - eg. the command <button target="stopAfterEachTrack" onclick="player.stopAfterEachTrack=true;"> will always set the state to false (as the target is exectuted after onclick)!

Best regards,
Your Silverjuke-Team

SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Problem with Player.stopAfterEachTrack

Postby SilverEagle » 7. Jan 09, 00:10

Hi Team,

Sorry, does not work the same here...

Could you try the attached "skin"?

The upper two buttons are my first post, the lower three buttons are my second post. Lets call then A-E top down.

As in first forum post:
When I click A it toggles.
When I click B nothing happens.

As in second forum post:
When I click C or D nothing happens.
When I click E it toggles (together with B).
When I click E and then C or D (depending on state which one), it toggles and after the playlist message disappears it toggles back.

Can you reproduce this behaviour?

Bye,
SilverEagle
PS: Sometimes (definitely _not_ always) I REALLY know what I'm doing now. See the repeat button trick in Shiruba/100 ;-)
Attachments
buttontest.sjs
(5.66 KiB) Downloaded 414 times

User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Problem with Player.stopAfterEachTrack

Postby Service-Team » 7. Jan 09, 00:25

We have tested your skin, and everything works as expected ... maybe you expect the wrong things?

If "stopAfterEachTrack" is ON, the little icon in the playlist blinks between "stop" (a square) and "play" (a triangle). Does it blink for you? Does it blick if you choose the item from the context menu? What happens if you enter the commands directly in the console window? Finally: Maybe there are other scripts running? You can check this in the console window startup messages.

Just some more tips that may help you - so far - best regards,
Your Silverjuke-Team

PS: We know, normally you know what you are doing, so please forgive us our stupid questions ;-)

SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Problem with Player.stopAfterEachTrack

Postby SilverEagle » 7. Jan 09, 07:58

Hi Team,

Phew. After some sleep and thanks to your questions I finally pinpointed the bug: the only thing which is wrong is that the stopaftereachtrack button does not follow its internal state.

Create a two-state button for both removeafterplayed and stopaftereachtrack. Use the console to set them false/true. The removeafter button will change visually to match the state, the stopaftereachttrack does not.

I only ran into this with the stopaftereachttrack target, I think all other targets are OK.

(And to save you some debugging: program.refreshWindows(1) or (3) correctly updates the button, so it is probably just not redrawn after its property has been changed.)

Bye,
SilverEagle

User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Problem with Player.stopAfterEachTrack

Postby Service-Team » 7. Jan 09, 14:58



[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Developer Network”