youtube.settings.log

log

getYoutube(id).settings.log() (since beta 0.3)

or getYoutube(id).settings.log("play") (since beta 0.4)

or getYoutube(id).settings.log("end") (since beta 0.4)

or getYoutube(id).settings.log("pause") (since beta 0.4)

or getYoutube(id).settings.log("buffer") (since beta 0.4)

or getYoutube(id).settings.log("play", "buffer", ...) (since beta 0.4)

or getYoutube(id).settings.log("all") (since beta 0.3)

Note: since beta 0.4, blank parentheses default back "play". In beta 0.3, they default back to "all".

Will add a line for the following events in the results file, regardless of whether they result from a click/key press or from a script command.

  • The video starts playing
  • The video pauses
  • The video ends
  • The video is buffering (i.e. loading before it can play or continue playing)

Each line will report the timestamp of the event, as well as the position (in seconds) of the video at the moment of the event. Given the asynchronous mechanism behind the Youtube API, there may be delays: for instance the position of an initial play event may not be 0, and you should subtract it from the reported timestamp to get an accurate measure of when the video really started playing.

Example:

[js highlight=”2″]newYoutube(“myYoutube”, “code”)
.settings.log(“play”, “buffer”)
.play()
.wait()
[/js]

Will start playing a Youtube video without showing it. Each play and each buffer event will add a line to the results file.