Jump to content

Playback Check-ins


Luke

Recommended Posts

I have begun to add these, and they are not complete, but here is what the api looks like:

 

Playback Start:

 

/api/playbackcheckin

 

params:

 

id

userid

type=start

 

Playback Progress:

 

/api/playbackcheckin

 

params:

 

id

userid

type=progress

positionticks= {progress in ticks} -- This is optional.

 

Playback Stopped:

 

/api/playbackcheckin

 

params:

 

id

userid

type=stopped

positionticks= {progress in ticks} -- This is optional.

 

The idea is, at minimum you check-in when playback starts and stops.

 

Then, if you're able to detect it, you might also pass in the positionTicks.

 

Then you can start to use the progress check-ins. You can check-in as often as you like based on your device's performance and network conditions. For reference, the PC UI will probably check-in every 30 seconds. If you're a mobile device on 3g it might be every few minutes.

 

positionticks is always optional. Reason being, even if you can't detect this, it's still useful to check-in to the server to tell it that you're playing. (Even during progress).

Link to comment
Share on other sites

Redshirt

I hate to sound stupid, but can't the server log position ticks without the client checking them in. After all the server knows what it's feeding the client.

Link to comment
Share on other sites

ScottIsAFool
I hate to sound stupid, but can't the server log position ticks without the client checking them in. After all the server knows what it's feeding the client.

 

Not if it's being buffered on the client it can't.

Link to comment
Share on other sites

In addition to what Scott said, we also don't have a way of translating bytes transmitted into a time offset. Then you also have to remember that we're going to allow direct play access instead of streaming, if a client wishes to do so.

Link to comment
Share on other sites

  • 1 month later...
Redshirt

I'm gonna add this to my client tonight... Am I right in assuming an item will be considered watched only if I supply the ticks when I make the api call to stop playback?

Link to comment
Share on other sites

We just added the Played flag recently, so I will have to check to make sure that is properly set. If not I'll fix it tonight.

 

But fyi, you really shouldn't have any use for play count, except maybe for audio.

Link to comment
Share on other sites

When you call the playback stopped handler, if you're not able to pass in position ticks, it will just assume the whole thing was watched and will set Played to true and increment play count.

 

If you are able to pass in position ticks then it will follow the same kind of algorithm as mb2, where it looks at the current position as well as resume settings.

Link to comment
Share on other sites

Redshirt

sounds good. Java doesn't use ticks, the granularity stops at milliseconds. So I've just been multiplying (or dividing) by 10,000 to get the tick value.

Link to comment
Share on other sites

When you call the playback stopped handler, if you're not able to pass in position ticks, it will just assume the whole thing was watched and will set Played to true and increment play count.

 

If you are able to pass in position ticks then it will follow the same kind of algorithm as mb2, where it looks at the current position as well as resume settings.

 

Actually, it will be better than MB2. It will only mark the item watched if you watch it past your max resume point.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...