0
votes

*Situation is -*I have to design a webpage that works on both desktop and on mobile devices, that plays an embeded youtube video (not autostarted) which then i can use interact with the video to get the play state etc (using this to count the total time watched, excluding pause/buffer/stop time)

I've managed to build the website using both the IFrame API and Javascript API from Youtube.

*However the problem is-*With Javascript API, the player on the desktop works and the view gets counted too but it doesnt work when i view it on a mobile device. The place where it should show the video (the div tag) doesnt react.

With the IFrame API, everything works in terms of functionality but when i press play on the video, the views do not get counted - accessed from both desktop and mobile. I've tested the viewcount several times, with different IP etc but while javascript API web gets counted instantly, IFrame API web is still not getting counted..

Does anyone have any suggestion to this problem?

Just to remind you, the crucial aspect of the webpage that i need are:

  • Embeded Youtube player
  • Being able to interact with the player (e.g. getState() or getDuration())
  • Website fully functional with mobile access
  • Valid view count

Thank you all in advance!! :)

1

1 Answers

0
votes

Are you sure that the views are really being counted via the javascript api? I have always read that view counts only are considered valid when initiated using the actual YT play button. Meaning you can't initiate play via any API call and have the view count.

Here is a a somewhat dated blog post from Google/Youtube team explaining - https://groups.google.com/forum/#!msg/youtube-api-gdata/7SsbvOJMWL0/rBCBqnFaxRgJ

I'm trying to find something that says this has changed but so far no luck.

** EDIT **

So I went back to the iFrame and Javascript API pages and if you do a search for 'view count' the first piece of content you'll find is a line stating --

"Note: A playback only counts toward a video's official view count if it is initiated via a native play button in the player."

Re-reading your post I'm not sure if you are using the API's to play the video or just to get data from its current state. If you are using it to actually initiate play then the view counts are not actually being counted. If you are seeing something different I'd love to see and learn from it.