An expert question: How to detect someone has watched a vid

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

An expert question: How to detect someone has watched a vid

Post by kaisellgren »

Hello,

I need to create a solution where I can be 99% sure that my visitors have watched a specific video before getting registered. They must watch the 1min video ENTIRELY without going forward or skip it. I can set a timer meaning that I could log the access time of that video for all IPs and then compared that the time is right.

For example, I have 1min and 3sec video. When IP 1.1.1.1 accesses the page PHP will log into DB that IP address plus the current time and also the video ID. Once the video has ended and user presses continue (whatsoever) and then PHP will look if current time - 63 > db time. If that's true then it would continue to registration page.

It still have some leaks. Like user can wait the time and then go to the reg page. Is there any way I could include a random generated hash code inside a video somehow or someway I could make sure the video is SHOWN for 1min 3sec. I know I can not force people to look at the video, but if it least shows the entire video it would be awesome.

Any ideas are welcome!
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Why not just disable the "continue" button until the video is finished?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

A streaming solution might allow you to know if they stopped early.
(#10850)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

If you have control over the player used you can generate a one time pad and pass this along to the registration page once the video is finished.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

This sounds like a great use for flash video to me!

Mark this day in your calendar folks, it's not often I advocate flash.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Kieran Huggins wrote:This sounds like a great use for flash video to me!

Mark this day in your calendar folks, it's not often I advocate flash.
Doomsday list
[s]- Planetary alignment[/s]
[s]- Kieran advocating flash[/s]

8O Uh-oh.
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

Flash will work fine for this,

you can use myMovie.onComplete(){
your actions here
}

your actions could be a call to a php script to set a cookie or a session.

If the cokie or session is not set then they did not watch it all :)

HTH
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Yup. Flash is the way to go.

Just make it so there is no skipping feature in the movie.
And, make this javascript function:

Code: Select all

function enableBtn(){
    document.getElementById('submit_btn').disabled=false;
}

Code: Select all

<!--and the button: -->
<input type="submit" value="Submit" disabled="disabled" id="submit_btn" />
and apply this ActionScript to the last frame in the movie:

Code: Select all

getURL('javascript: enableBtn();');
wierd... it is supposed to be "javascript: enabledBtn();", not "javascript: enableBtn();"

The result:
the button is disabled;
the movie plays;
the movie finishes;
the button is enabled;
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

If having the user watch the movie is a must, I wouldn't rely on javascript at all.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

Jcart wrote:
Kieran Huggins wrote:This sounds like a great use for flash video to me!

Mark this day in your calendar folks, it's not often I advocate flash.
Doomsday list
[s]- Planetary alignment[/s]
[s]- Kieran advocating flash[/s]

8O Uh-oh.
LMAO!!!!!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Jcart wrote:
Kieran Huggins wrote:This sounds like a great use for flash video to me!

Mark this day in your calendar folks, it's not often I advocate flash.
Doomsday list
[s]- Planetary alignment[/s]
[s]- Kieran advocating flash[/s]

8O Uh-oh.
The end is most certainly nigh. If I suddenly switched to ASP we'd have mere seconds before the universe imploded.
Post Reply