Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. for (var i = 0; i < numAnnotations; i++) {
  2. var vMuted = player.video_obj.muted
  3. var vBlanked = player.video_obj.classList.contains('blanked')
  4. var vBlurred = player.video_obj.classList.contains('blurred')
  5.  
  6. var a = player.annotations[i]
  7. var aStart = a['start']
  8. var aEnd = a['end']
  9. var aType = a['type']
  10. var aDetails = a['details']
  11.  
  12. switch (a['type']) {
  13. case 'skip':
  14. if (time >= aStart && time < aEnd) {
  15. console.log('skipped to '+Number(aEnd).toFixed(3))
  16. player.skip_to(aEnd)
  17. }
  18. break
  19. case 'mute':
  20. case 'mutePlugin':
  21. if (currently.muting === -1 || currently.muting === i) { //if no annotation is currently muting or *this* current annotaiton is muting
  22. if (time >= aStart && time < aEnd) { //if within annotation time
  23. if (!vMuted) {
  24. console.log('mute on')
  25. currently.muting = i
  26. player.mute()
  27. }
  28. } else {
  29. if (vMuted) {
  30. console.log('mute off')
  31. currently.muting = -1
  32. player.unmute()
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement