Sha256: 164c36837f1bbc8a78b1df2544bc1db469889613a2aa478d48be218b86b52779

Contents?: true

Size: 839 Bytes

Versions: 32

Compression:

Stored size: 839 Bytes

Contents

pageflow.VideoPlayer.filterSources = function(playerElement) {
  if (!$(playerElement).is('video')) {
    return playerElement;
  }

  var changed = false;

  if (pageflow.browser.has('mp4 support only')) {
    // keep only mp4 source
    $(playerElement).find('source').not('source[type="video/mp4"]').remove();
    changed = true;
  }
  else if (pageflow.browser.has('mse and native hls support')) {
    // remove dash source to ensure hls is used
    $(playerElement).find('source[type="application/dash+xml"]').remove();
    changed = true;
  }

  if (changed) {
    // the video tags initially in the dom are broken since they "saw"
    // the other sources. replace with clones
    var clone = $(playerElement).clone(true);
    $(playerElement).replaceWith(clone);

    return clone[0];
  }
  else {
    return playerElement;
  }
};

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
pageflow-14.0.0.rc1 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-14.0.0.beta3 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-14.0.0.beta2 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-14.0.0.beta1 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-13.6.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-13.5.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-13.4.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-13.3.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-13.2.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-12.6.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-13.1.0 app/assets/javascripts/pageflow/video_player/filter_sources.js
pageflow-12.5.0 app/assets/javascripts/pageflow/video_player/filter_sources.js