0

I have a video website with videos from youtube, I use facebook api to post via open graph to a profile that the user viewed the video. So as facebook policy said: If the person watches more than 50% of a video, but does not complete it, the action instance should be updated to reflect that the person has stopped watching by updating expires_in to the length of time the video was actually watched.

I have 2 missunderstandings:

  1. How can I do a action if user stop the player and didn`t play 50% of video? For example a user acces video page, press play and without stop or pause the video will go to another page. When the update should be done?
  2. I use the script from this Listening for Youtube Event in JavaScript or jQuery link for capture the youtube event.

In this part of code we have all events of youtube player.

function stopCycle(event) {
alert("onStateChange has fired!\nNew state:" + event.data);

}

How can I capture only the first play of player?

Community
  • 1
  • 1
  • What I would do is weave in some kind of event. Possibly and onfocus event that triggers a counter. If you can extract the youtube video duration, you can then create an equation that gives you a true false boolean to give you 50% or more of the video minus the duration. Hope this helps. – Frank Tudor Apr 15 '13 at 20:06
  • Ok I have the video duration, how can I check when user stop view the video? – Sebastian Corneliu Vîrlan Apr 15 '13 at 23:03
  • Here is a link that explains what you can do. http://guerillashowrunner.com/2011/03/how-to-learn-where-your-youtube-viewers-stop-watching-your-videos-when-they-start-where-they-come-from-and-more/ – Frank Tudor Apr 16 '13 at 00:45
  • This is a good information but is about my own videos, or I have a video website with embed videos so if user doesn`t watch 50% I must call a function in javascript. So I didn`t found yet a solution. – Sebastian Corneliu Vîrlan Apr 16 '13 at 07:05
  • Ok so this is your website, the videos are populating from youtube? The facebook tie in is that you want to show the user somewhere near the video that they watched it? but you can't do this unless the user watches 50% or more of the video? So are you trying to tease out people who don't get to 50% mark so you can get them past that threshold and display them next to the video? Is this correct? – Frank Tudor Apr 16 '13 at 12:39
  • If I am understand good what you written there NO is not corect! You as user visit my website, login with facebook and view a embed youtube video . You press play and after 10 seconds conform facebook policy website can post to your profile that you viewed the video. But if you doesn`t watch 50% of the video I must delete the action from your timeline. This is all. – Sebastian Corneliu Vîrlan Apr 16 '13 at 19:13

0 Answers0