Hi,

I am working with a video within my Pie that needs to pause once it hits certain key moments, then go back to playing only once I tell it to.

What triggers/responses do I need to use?


To give more details:

I have a video layer β€œvideo1” which is set to start playing automatically.

At 03:00, I want the video to pause itself.

Then I want to be able to play it, using keyboard trigger β€œβ†’β€.

At 05:00, I would like it to pause itself again.

β€œβ†’β€ to play again.

At 10:00, pause itself again.

β€œβ†’β€ to play again.


The manual playing seems to be working fine.

Trigger: Press Keyboard β†’.

Response: Playback Play Action on video1.


The part I don’t know how to do is is the pausing.

I tried:

Trigger: Detect video1 time.

Condition: Time of video1 = Value 0:03.

Response: Playback Pause Action on video1.

This doesn’t seem to work, unless I switch the = to β‰₯, which then messes up everything after that.


Thanks so much in advance for your help!

Ambassador

I think there is an easier way to achieve this.

  1. create a counter variable (n) that begins at 0

  2. create a text variable (pauses) that contains (something like) [5,3,7,9,12,1,2] - where the numbers represent the points where the video will pause (in seconds).

  3. Use a start trigger to start playback and add a second playback response that pauses the video and delay this response by parseJson(pauses,n). Add an assign response that increments the counter by 1.

  4. Use a Press trigger and give it exactly the same three responses as your Start trigger.

The video will pause and play until the array of pause times runs out, when it will no longer start. You would need to add a condition to check the result of parseJson(pauses,n) if you want the video to play on to the end.

Hi Avia Lewis . Don’t use Detect for this. Use Range instead.

The Range trigger has four options:

* the first option β€” represented by an icon pointed up and to the right β€” instructs the trigger to fire when a property becomes a value or greater (e.g., if set to 100, fires when the property transitions from 99 to 100)

* the second option - icon up and to the left β€” is the opposite of the above. Fires when a property becomes a value or less (e.g., if set to 100, fires when the property transitions from 101 to 100

* the third option - a u-shaped icon - has two values and will fire when the property transitions from below the first setting or above the second setting.

* the fourth option - two arrows facing away from each other - is the opposite. Fires when the property transitions from above the first setting or below the second setting.


Set three ranges. In all three cases, use the first option - arrow up and to the right.

* set the first range to fire when the video reaches 3:00. Use a playback trigger to pause the video.

* similarly, set the second range to fire when the video reaches 5:00. Use a playback trigger to pause the video.

* set the third range to fire when the video reaches 10:00. Use a playback trigger to pause the video.

The first trigger will fire when the video transitions from 2:59 to 3:00. The second will fire when the video transitions from 4:59 to 5:00. The third will fire when the video transitions from 9:59 to 10:00.

Jeff Clarke (Ex-ProtoPie) This worked like a charm. Thanks so much for your help, and for responding so quickly!

Hm, the pausing seems to work if I add another condition at the same time… so for example Condition: Time of video1 β‰₯ Value 0:03.0 AND Time of video1 ≀ Value 0:03.1.

Even thought this is working, Detect will work against you here. If the video pauses at, say 3.01, when you press the right arrow to resume, it might pause again at 3.05. The Range trigger is better for this scenario as will only fire at the single point your are interested in. So the video can resume without issue when you want it to.

Post a comment