Results 1 to 3 of 3

Thread: total playback time

  1. #1
    Join Date
    May 2012
    Posts
    8

    Default total (actual) playback time

    I've been reading some topics related to this and just want to know that i've understood correctly and the information is not outdated:

    I want to log the total time a user has been listening to a track. There is an elapsedtime variable, but this also contains the time a song has been paused. So, if i want to accurately log the total playback time, i have to subtract the pauses manually. There is no better way to do this, right?

    edit:
    If my understanding is correct, and i need to implement a custom way of recording the actual playback time, what would be the best way to do this? When i log it in the database, i want to log it with the stop event instead of later calculating it with a database query. This means i need to store it in a session; my question: is there a unique session per stream? or is there a session per user? or is there a better way to approach this?
    Last edited by themarty; 05-28-2012 at 07:44 AM.

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Take a look at IMediaStreamActionNotify3:
    http://www.wowza.com/forums/content....-of-codec-info

    Note that you should use onPauseRaw instead of onPause for your purpose.

    Also take a look at the log files, at the rows with x-event "destroy", note the sc-bytes and x-duration fields. This will not take pausing into account, but between duration and sc-bytes (server to client bytes) you can make a good PPM or PPV system.

    Richard

  3. #3
    Join Date
    May 2012
    Posts
    8

    Default

    Hi Richard.

    Thanks for taking the time to respond to my question

    Quote Originally Posted by rrlanham View Post
    Take a look at IMediaStreamActionNotify3:
    http://www.wowza.com/forums/content....-of-codec-info
    Yes, the basic outline of this i already have

    Note that you should use onPauseRaw instead of onPause for your purpose.
    from what i understood in other posts, onPauseRaw gets triggered when the stream is still loading data in the buffer and onPause is triggered when the whole stream has been read into the buffer. Don't know if this is true though.
    Anyways, i'm catching both events and handle them in the same way, so i should not have no problem there.

    Also take a look at the log files, at the rows with x-event "destroy", note the sc-bytes and x-duration fields. This will not take pausing into account, but between duration and sc-bytes (server to client bytes) you can make a good PPM or PPV system.
    It sounds like x-duration gives the same information as the ElapsedTimer object?
    sc-bytes is a nice alternative ... still, i imagine it is never accurate because you'll never know how much got buffered and not played.


    Wouldn't my first suggestion give the most accurate information? Record all the pauses in a session-variable and simple subtract this from the ElapsedTime when the stop-event occurs? My only problem with that is that i don't know where i can find such a session-variable. Does it exist?

Similar Threads

  1. OSMF 2.0 live playback stops after some time
    By xzerth in forum Media Players and Devices Discussion
    Replies: 4
    Last Post: 10-29-2012, 10:48 AM
  2. To start playback on specified time in the url
    By Sysadmin in forum AddOn: Wowza nDVR
    Replies: 1
    Last Post: 10-17-2011, 06:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •