Page 1 of 1

which command to use for Play functionality

PostPosted: Mon Sep 09, 2013 9:08 am
by pbisuser
Hi,

I am confused by the play mode. It seems I can set playmode for Sequence, as well as device. I have used both SetSequenceCuePlayMode and SetParamDouble("Playback Transport") but so far I have not figured out how to mimic the functionality shown in the attached screenshot.

Which commands should I run? I am now running "SetParamDouble/Playback Transport" for all the devices in my PB project and this succesfully starts the playback. Unfortunately the playback does not continue from sequence-to-sequence but it stops after the end of my first sequence is reached. I would like for the playback to continue to next sequence automatically, like it does when I press the Play-button in my screenshot. I have tested both "Play (64)" and "Play Loop (192)" values for SetParamDouble.

So in short, which commands should I run so that I can mimic the functionality shown in my screenshot?

Re: which command to use for Play functionality

PostPosted: Mon Sep 09, 2013 9:14 am
by pbisuser
Further details of the commands I am running (this is the order I run them in)

1) Automation.SetParamDouble(1, layerID, "Opacity", 255)
This is run for all of the layers in my presentation. This brings them visible and works fine.

2) Automation.MoveSequenceToCue(1, 6);
This is run once so that I move the playhead into correct position

3) Automation.SetSequenceCuePlayMode(1, 6, 0)
This is run once so that the sequence would Play

4) Automation.SetParamDouble(1, layerID, "Playback Transport", (double)64);
This is run for all of the layers so that the playback would start

After running all these commands, everything seems to start OK but unfortunately playback stops after showing the first video clip. How can I make it continue past the first video clip?

Re: which command to use for Play functionality

PostPosted: Tue Sep 10, 2013 1:40 am
by JustynR
It sounds like you're telling PB to just play 1 layer instead of telling it to play the sequence.

Try:
Automation.SetSequenceTransportMode(sequenceNum As Interger ModeName As String)

sequenceNum: Sequence ID
ModeName: Transport mode, case sensitive (Play/Pause/Stop)

This controls the Sequence instead of the Layer.

I'm not quite sure of the syntax... But it sounds like this might solve your problem.

Re: which command to use for Play functionality

PostPosted: Sun Sep 15, 2013 8:14 am
by pbisuser
Ah, ok! I didn't realize Transport mode is related to Play functionality - maybe I am lacking some vocabulary or terminology here... I was searching for "Play" in the SDK function reference (http://www.coolux.de/root/downloads/sup ... ce_sdk.htm) and thus wasn't able to find it :D ... Thanks, this solved my problem.

Re: which command to use for Play functionality

PostPosted: Thu Dec 12, 2013 4:46 pm
by bradstallion
Hi all,
WARNING: totally newbie here!

Well, we use Pandoras Box to manage videos in a museum. Now I have to following need:

- I have a video with cue points
- I have to create a web page to send "play from cue X to X+1" command to Pandoras box
- Once cue X+1 is reached, I have to stop or go back to cue 0 (it's still not specified)

I must use PHP or Javascript (the easier to set up).
I guess I have to use the AutoSetSequenceCuePlayMode but, as said, I'm 100% newbie... could you help me? Which is the correct command sequence to play from, say, cue 4 to cue 5 and then stop (or rewind)?

Thank you very very much!

Re: which command to use for Play functionality

PostPosted: Thu Dec 12, 2013 5:12 pm
by Dennis Kuypers
Hi,

I think that function is missing...weird...

Insert the following code in PandorasAutomation.js (after the "moveSequenceToTime" block) Line 498
Code: Select all
moveSequenceToCue: function(callback, seqNum, cueId)
{
 var message = new PBUtilBytesNetwork();
 message.addShort(eAutoCmdMoveSequenceToCue);
 message.addInt(seqNum);
 message.addInt(cueId);
 PBAutoCommands.sendToHost(callback,message);
},


Then you can use
Code: Select all
PBAutoCommands.moveSequenceToCue(false,1,1); // to jump to cue 1 (sequence 1)
PBAutoCommands.setSequenceTransportMode(false,1,'Play'); // Start timeline


The jumping/pausing should be set in the second cue. (Jump Cue or a Pause Cue)

Best regards
Dennis

Re: which command to use for Play functionality

PostPosted: Thu Dec 12, 2013 5:28 pm
by bradstallion
oh this is cool!!! Thanks so much!!!

Re: which command to use for Play functionality

PostPosted: Fri Jan 24, 2014 10:00 am
by bradstallion
sorry to re-open this thread...

I've just checked Pandora's box version: it's rev 5771, pretty old, isn't it?

Is it still possible to use the provided js?
Thanks a lot...

Re: which command to use for Play functionality

PostPosted: Fri Jan 24, 2014 11:43 am
by Dennis Kuypers
Hi,

There is no webserver built into this revision, so there is nothing that can accept your ajax requests.

If you have the experience you could set up your own webserver and make it proxy the automation requests via TCP to Pandoras Box. The js-Automation creates the base package with the command and encodes it with BASE64.
I can tell you how to build the header and then you could simply decode the JS request and proxy all to PB.

Best regards
Dennis

Re: which command to use for Play functionality

PostPosted: Fri Jan 24, 2014 12:53 pm
by bradstallion
Hi Dennis,
first of all, thanks a lot for your support.

This is surely a good option for me!

At the moment, I tried to call the following js code:

Code: Select all
function playVideo(cId) {
  var ret = PBAutoCommands.moveSequenceToCue(false,1,cId); // to jump to cue cId (sequence 1)
  console.log(ret);
  ret = PBAutoCommands.setSequenceTransportMode(false,1,'Play'); // Start timeline
  console.log(ret);
  return false;
}

playVideo(1);


and in PandorasAutomation.js I've set usesProxy = true to use PandorasAutomation.php.

If I understood your suggestion, I need to change PandorasAutomation.php in order to send data to TCP port 6211 ... ? how many mistakes in my statement? :-D

Thanks again!

Re: which command to use for Play functionality

PostPosted: Fri Jan 24, 2014 1:40 pm
by Dennis Kuypers
Hi,

unfortunately the proxy script does only work with the webserver as well. It proxies the HTTP protocol to HTTP and not to TCP.

Best regards
Dennis

Re: which command to use for Play functionality

PostPosted: Fri Jan 24, 2014 1:57 pm
by bradstallion
but if you say to me how to build the header, so I could simply decode the JS request and proxy all to PB, I could try to create a TCP client on 6211... right?

If I wasn't able to do so, I'll try with C# SDK...

Re: which command to use for Play functionality

PostPosted: Fri Jan 24, 2014 3:14 pm
by Dennis Kuypers
Hi,

C# code that takes a array of bytes to send and prepends a header:

Code: Select all
private byte[] _addHeader(byte[] RawMessage)
        {
            byte[] message = new byte[17 + RawMessage.Length];
            RawMessage.CopyTo(message, 17);
            /* PBAU-Header (15 Bytes)
             * POSITION: [0123456789ABCDEFG]
             * VALUE:    [HHHHVDDDDSSIIIIFC]
             *
             * 0 HHHH | Header-ID, always "PBAU"
             * 4 V    | Version (=1)
             * 5 DDDD | Domain ID
             * 9 SS   | Message Size without header
             * B IIII | connectionId, persistent for one connection (=1)
             * F F    | Flag/Type
             * G C    | Checksum byte, sum header bytes 4-F Modulo 255 */


            /* 0 HHHH & 4 V */
            new byte[]{80,66,65,85,1}.CopyTo(message, 0);
            /* 5 DDDD */
            BitConverter.GetBytes(Domain).CopyTo(message, 5);
            Array.Reverse(message, 5, 4);
            /* 9 SS   */
            BitConverter.GetBytes((short)RawMessage.Length).CopyTo(message, 9);
            Array.Reverse(message, 9, 2);
            /* B IIII */
            BitConverter.GetBytes((int)0).CopyTo(message, 11);
            Array.Reverse(message, 11, 4);
            /* F F    */
            message[15] = 1; // TCP FLAG
            /* G C    */
            message[16] = 0;
            // Calculate Checksum
            for (int i = 4; i < 16; i++)
                message[16] = (byte)((message[16] + message[i]) % 256);
            return message;
        }


Best regards
Dennis