Sha256: a593518bdc7df07f4b7b2f8835e7d12b9d8c48203cbc09c7d8fd662248973ea3

Contents?: true

Size: 1.04 KB

Versions: 68

Compression:

Stored size: 1.04 KB

Contents

window.mediaAccessCreate = function (mediaType, mediaLink, slideId) {
  var postPath = "/participants/media_access_events"
  $('.jp-play').on("click", function (){
    $.ajax({
      type: "POST",
      url: postPath,
      data: { media_access_event: { media_type: mediaType, media_link: mediaLink, bit_core_slide_id: slideId }}
    }).
    done(function(data) {
      bindStopEvent(data.media_access_event_id);
      bindEndedEvent(data.media_access_event_id);
    });
  });
}

window.mediaAccessUpdate = function(mediaAccessEventId) {
  var putPath = "/participants/media_access_events/"+mediaAccessEventId
  $.ajax({
    type: "PUT",
    url: putPath,
    data: { media_access_event: { id: mediaAccessEventId, end_time: new Date() }}
  });
}

window.bindStopEvent = function (mediaAccessEventId) {
  $('.jp-stop').on("click", function() {
    mediaAccessUpdate(mediaAccessEventId);
  });
}

window.bindEndedEvent = function (mediaAccessEventId) {
  $("#jquery_jplayer_1").bind($.jPlayer.event.ended, function(){
    mediaAccessUpdate(mediaAccessEventId);
  });
}

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.8 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.7 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.6 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.5 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.4 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.2 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.1 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.22.0 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.21.2 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.21.1 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.21.0 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.20.1 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.9 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.8 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.7 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.6 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.5 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.4 app/assets/javascripts/think_feel_do_engine/media_access_events.js
think_feel_do_engine-3.19.3 app/assets/javascripts/think_feel_do_engine/media_access_events.js