Attempt 2

The problem with my previous attempt was that the video just disappeared when a face wasn’t seen so in my previous post I said I was going to try to pause the video when a face is not seen.

2

This time I have been trying to make the video pause when a face isn’t seen. I have done this by adding this extra part of code that I found in the video reference library:

if (faces.length >= 1) { react.play(); } else { react.pause(); } }

This means that once 1 or more faces is seen it will play otherwise it will pause. It pauses on the frame that it is playing and then resumes from that frame.

Next time I am going to code it so that when a face isn’t seen, it stops the video and jumps it to the beginning frame of the video.

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s