function backward_trigger(event) {
  if (event.fragment.matches(".fv-fragment")) {
    var time_start = event.fragment.getAttribute("time_start");
    var time_end = event.fragment.getAttribute("time_end");
    var fragment_type = event.fragment.getAttribute("fragment_type");
    var background_video = event.fragment.getAttribute("background_video") == "true";
    
    if (background_video) {
      var current_slide = Reveal.getCurrentSlide();
      var video_elem = current_slide.slideBackgroundElement
        .getElementsByTagName("video")[0];
    }
    else {
      var video_elem = event.fragment.parentElement;
    }
      
    video_elem.currentTime = time_start;
    video_elem.pause();

    if (event.fragment.matches(".fv-final-fragment")) {
      // go on the previous one, this was a dummy fragment
      // since this is inside 'fragmenthidden', we know we're going backward
      Reveal.prev();
    }
  }
}
// triggered by revealjs's fragmenthidden event -> indicates we're going through the slides backwards
triggered by revealjs's fragmenthidden event -> indicates we're going through the slides backwards
triggered by revealjs ' s fragmenthidden event - > indicates we ' re going through the slides backwards
function backward_trigger(event) {
  if (event.fragment.matches(".fv-fragment")) {
    var time_start = event.fragment.getAttribute("time_start");
    var time_end = event.fragment.getAttribute("time_end");
    var fragment_type = event.fragment.getAttribute("fragment_type");
    var background_video = event.fragment.getAttribute("background_video") == "true";
    if (background_video) {
      var current_slide = Reveal.getCurrentSlide();
      var video_elem = current_slide.slideBackgroundElement
        .getElementsByTagName("video")[0];
    }
    else {
      var video_elem = event.fragment.parentElement;
    }
    video_elem.currentTime = time_start;
    video_elem.pause();
    if (event.fragment.matches(".fv-final-fragment")) {
      Reveal.prev();
    }
  }
}
function backward_trigger ( event ) { if ( event . fragment . matches ( ".fv-fragment" ) ) { var time_start = event . fragment . getAttribute ( "time_start" ) ; var time_end = event . fragment . getAttribute ( "time_end" ) ; var fragment_type = event . fragment . getAttribute ( "fragment_type" ) ; var background_video = event . fragment . getAttribute ( "background_video" ) == "true" ; if ( background_video ) { var current_slide = Reveal . getCurrentSlide ( ) ; var video_elem = current_slide . slideBackgroundElement . getElementsByTagName ( "video" ) [ 0 ] ; } else { var video_elem = event . fragment . parentElement ; } video_elem . currentTime = time_start ; video_elem . pause ( ) ; if ( event . fragment . matches ( ".fv-final-fragment" ) ) { Reveal . prev ( ) ; } } }
triggered by revealjs's fragmenthidden event -> indicates we're going through the slides backwards
triggered by revealjs ' s fragmenthidden event - > indicates we ' re going through the slides backwards
// go on the previous one, this was a dummy fragment // since this is inside 'fragmenthidden', we know we're going backward