Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (var i = 0; i < numAnnotations; i++) {
- var vMuted = player.video_obj.muted
- var vBlanked = player.video_obj.classList.contains('blanked')
- var vBlurred = player.video_obj.classList.contains('blurred')
- var a = player.annotations[i]
- var aStart = a['start']
- var aEnd = a['end']
- var aType = a['type']
- var aDetails = a['details']
- switch (a['type']) {
- case 'skip':
- if (time >= aStart && time < aEnd) {
- console.log('skipped to '+Number(aEnd).toFixed(3))
- player.skip_to(aEnd)
- }
- break
- case 'mute':
- case 'mutePlugin':
- if (currently.muting === -1 || currently.muting === i) { //if no annotation is currently muting or *this* current annotaiton is muting
- if (time >= aStart && time < aEnd) { //if within annotation time
- if (!vMuted) {
- console.log('mute on')
- currently.muting = i
- player.mute()
- }
- } else {
- if (vMuted) {
- console.log('mute off')
- currently.muting = -1
- player.unmute()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement