Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow switching media players with many players loading
fixes CNVS-16057 this problem was reproducible without any canvas wrapper at all as long as we're dynamically throwing a ton of new players at the page every time we click a link. By default it's causing each new player to try to preload it's content, and that's causing issues for the browser as it tries to decide which stream to continue, and it's not great at breaking away from a queue of active downloads just beacuse a media player pauses. There are probably smart and great ways to handle this better inside mediaelement.js by improving that library, but what we have found to be effective for mitigating the issue for Canvas is to use the "preload='none'" attribute on each media element as it's added to the page. Since we immediately click on it anyway as part of activating the media comment, it still kicks off the download immediately, but the browser appears to be more conservative about trying to download all the media elements on the page at once that way giving smoother and more snappy transitions between playing various media elements also did a little dependency breaking to move away from deeply nested functions inside of "mediaComment.coffee" while we were in there anyway. TEST PLAN: - create a new page in pages - use "instructure record" tinymce plugin to insert like 20 different media comments - go to the page as a consumer (someone visiting to read, not edit) - click on the first media comment, let it just start, then open another media comment, and after it's played for a second or two, open a third, etc. - each time you open a new media element it should cleanly shift playing focus to the latest engaged element without big lag Change-Id: I13e2115f15e83fe7c367299865be2e1a16396492 Reviewed-on: https://gerrit.instructure.com/50336 Tested-by: Jenkins Reviewed-by: Jacob Fugal <jacob@instructure.com> Reviewed-by: Ryan Shaw <ryan@instructure.com> QA-Review: August Thornton <august@instructure.com> Product-Review: Ethan Vizitei <evizitei@instructure.com>
- Loading branch information