Skip to content

What is the expected behavior for play twice #6

@totty90

Description

@totty90

Let's say I have this:

var i = 0;
setInterval(function(){
    omx.play('video' + (i++));
}, 1000)

Videos are longer than 1 second. Let's say for this example that they are 5 seconds long.

The player will (A): plays right away

  • Second 0: nothing happens;
  • Second 1: omx plays video0;
  • Second 2: omx plays video1;

The player will (B): queue incoming videos

  • Second 0: nothing happens;
  • Second 1: omx plays video0;
  • Second 2: omx still plays video0 until ends;
  • Second 5: omx plays video1;

The player will (C): doesn't queue incoming videos

  • Second 0: nothing happens;
  • Second 1: omx plays video0;
  • Second 2: omx still plays video0 until ends;
  • Second 5: nothing happens

Seems that it works like in case C.

So to make it work the code should be:

var i = 0;
setInterval(function(){
    omx.stop();
    omx.play('video' + (i++));
}, 1000)

Or I have to wait for the stop event to fire before starting again?

I can't test the app, so knowing the behaviour would help me to design the app properly without seeing what happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions