Skip to content
acoiro edited this page Feb 26, 2013 · 2 revisions

Cue zones

var cuezones = [{
  id: 'Paris',
  from: 0,
  to: 5
}, {
  id: 'Zurich',
  from: 10.5
}, {
  id: 'London',
  from: 50
}, {
  id: 'NYC',
  from: -10 // converted to duration - 10
}];

Notes

  • id can't contain dots
  • 'id' is optional (however you won't be able to use goTo).
  • to is optional: the from of the next zone will be used as to (the end will be the to of the last cue zone).
  • from is optional: the to of the previous zone will be used as from (the begin will be the from of the first cue zone).

Adding cuezones

sublime('video').cuezones.addGroup({
  id: 'cities',
  cuezones: cuezones,
  onenter: function(player, groupId, cuezone, index) {
    // cuezone object will also contain computedFrom and computedTo
    // these are the real values (-x is converted to duration -x).
  },
  onexit: function(player, groupId, cuezone, index) {

  }
})

Go to a cuezone

sublime('video').cuezones.goTo('cities.Zurich')

And since I love iOS, you can forget the above and just do

sublime('video').cuezones.addGroup({
  id: 'cities',
  visualFormat: '|-[Paris]-5-[]-10.5-[Zurich]-50-[London]-|',
  onenter: function(player, groupId, cuezone, index) {

  },
  onexit: function(player, groupId, cuezone, index) {

  }
})

Notes

  • negative from and to are not supported with the visual format.
  • empty zones [] will be skipped
  • | are optionals, they are used to mark the begin or the end of the playback
Clone this wiki locally