Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/298 client-side loading amends #305

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/mediaLibrariesOverrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ Object.assign(window.mejs.MediaElementPlayer.prototype, {
},

/**
* because the fullscreen events and properties are still vendor-prefixed in some browsers...
*/
* because the fullscreen events and properties are still vendor-prefixed in some browsers...
*/
getVendorPrefix() {
const browser = device.browser;

Expand Down
25 changes: 15 additions & 10 deletions js/mediaView.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import Adapt from 'core/js/adapt';
import wait from 'core/js/wait';
import offlineStorage from 'core/js/offlineStorage';
import a11y from 'core/js/a11y';
// import device from 'core/js/device';
import logging from 'core/js/logging';
import ComponentView from 'core/js/views/componentView';
import 'libraries/mediaelement-and-player';
import './mediaLibrariesOverrides';
import('libraries/mediaelement-and-player')
.then(() => {
import('libraries/plugins/speed');
import('libraries/plugins/speed-i18n');
import('libraries/plugins/jump-forward');
import('libraries/plugins/jump-forward-i18n');
import('libraries/plugins/skip-back');
import('libraries/plugins/skip-back-i18n');
});

// instruct adapt to wait whilst loading client-side libraries
wait.for(async done => {
// wait for window.mejs to load
await import('libraries/mediaelement-and-player');
// load plugins
import('libraries/plugins/speed');
import('libraries/plugins/speed-i18n');
import('libraries/plugins/jump-forward');
import('libraries/plugins/jump-forward-i18n');
import('libraries/plugins/skip-back');
import('libraries/plugins/skip-back-i18n');
done();
});

class MediaView extends ComponentView {

Expand Down
Loading