debate-watch / issue-tracker

1 stars 1 forks source link

Livestream Ratings #13

Open s2t2 opened 8 years ago

s2t2 commented 8 years ago

results chart does not work during livestream events.

s2t2 commented 8 years ago

EXPECTED BEHAVIOR

https://developers.google.com/youtube/iframe_api_reference

Retrieving video information

player.getDuration():Number

Returns the duration in seconds of the currently playing video. Note that getDuration() will return 0 until the video's metadata is loaded, which normally happens just after the video starts playing.

If the currently playing video is a live event, the getDuration() function will return the elapsed time since the live video stream began. Specifically, this is the amount of time that the video has streamed without being reset or interrupted. In addition, this duration is commonly longer than the actual event time since streaming may begin before the event's start time.

s2t2 commented 8 years ago

Observed behavior differs from the behavior described in the youtube documentation.

OBSERVED BEHAVIOR

screenshot 2016-01-16 15 25 59

For live-stream events, while live-streaming, player.getDuration() returns 0.

EDIT: I think player.getDuration() was 0 only because it was set before player started playing. it seems to be fine after setting it during the getRating() function

screenshot 2016-01-16 18 53 24