drbye78 / mp-onlinevideos2

Automatically exported from code.google.com/p/mp-onlinevideos2
0 stars 0 forks source link

TrackPlayback() condition for percentage watched is incorrect #108

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the g_Player_PlayBackStopped event handler there is code to check if the 
video is atleast 80% watched:

if (stoptime > 0 && (g_Player.Duration / stoptime) > 0.8) 
  TrackPlayback();

This should be the other way around otherwise this :

if (g_Player.Duration > 0 && (stoptime / g_Player.Duration) > 0.8) 

Similarly, the following should be changed in TraktPlayback():

double percent = g_Player.CurrentPosition > 0 ? g_Player.Duration / 
g_Player.CurrentPosition : 0;

to

double percent = g_Player.Duration  > 0 ? g_Player.CurrentPosition / 
g_Player.Duration : 0;

Original issue reported on code.google.com by damien.haynes@gmail.com on 13 Aug 2011 at 4:07

GoogleCodeExporter commented 8 years ago
Thanks for noticing. I keep doing the % calculation wrong, don't know why :)

Original comment by bborgsd...@gmail.com on 14 Aug 2011 at 11:01

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1494.

Original comment by bborgsd...@gmail.com on 14 Aug 2011 at 11:02