Forum Discussion

Xerces77's avatar
Xerces77
Visitor
15 years ago

Way to count how many times a video has been viewed

Greetings-

Is there anyway to tally how many times a particular video has been viewed within your channel?
(Perhaps, if an XML file can be updated within the package and then downloaded by the developer to get its contents)

6 Replies

  • jbrave's avatar
    jbrave
    Channel Surfer
    every time a video is played, you could write to the registry the video name or unique ID and a counter that is incremented, along with a timestamp. You could then upload that information to your webserver periodically.

    Or just check your webserver logs, they should tell you the same thing that this would - ip address, authenticated user information, date and times a url was called, etc.

    - Joel
  • What registry are you referring to? The user's Roku, or the server where the files are stored?
  • jbrave's avatar
    jbrave
    Channel Surfer
    roku's registry. Look in the Component Reference in the SDK for info
  • Hi Xerces77 (and anyone else who might have input) -

    Any luck with this? I am looking into generating some stats for a roku channel, (eg number of views per title, amount of bandwidth used per subscriber) and in looking at the apache logs, it seems that the information stored is not going to provide accurate data, since there are multiple requests for a single viewing and it seems that there's no way to tell how much data the user actually received.

    I'm thinking about more complicated solutions like taking the ip address' first request for a given title, finding the same ip's last request for that title, subtract the time entries to find out how long they watched, divide by total time of title and multiply by title's file size to approximate the amount of data consumed by that ip address for that title. Actually, this is pretty horrible, because what if they paused it for a half hour 😞

    Hopefully there's another better way?

    thank you in advance,
    Joe
  • destruk's avatar
    destruk
    Streaming Star
    Maybe the easiest solution would be through using the "play" or "play from beginning" from the detail screen. "Play" or "Play from beginning" would increment the number of times it was viewed. You could ignore the 'resume playing' option as that would simply be picking up from where the program left off. I don't know how many people exit a video before the end credits are finished - so you could also track maybe the playback position and compare it to (length-10 minutes) and every time that position is reached, count that as one complete viewing. Your count could still be messed up by someone repeatedly watching the last 15 minutes of the program with FF and REW.
  • Please take a look at the roSystemLog component and the StreamStart event of the video player. They were designed to gather statistics about playing videos that you can upload to your server.

    The roSystemLog example in the component reference will show you how to track the bandwidth selected, http errors, rebuffering...

    You could then transfer these stats to your server via an roUrlTransfer.

    --Kevin