Skip to content

Commit

Permalink
COLUMBIA: Use videojs fill in a 100% container instead of fluid for r…
Browse files Browse the repository at this point in the history
…esponsive sizing

- update videojs to 8.10.0
- disable the transpiling loader for videojs with bang syntax
  • Loading branch information
barmintor committed Jun 17, 2024
1 parent b5b6fd1 commit c1ebe2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"sass": "^1.34.0",
"video.js": "^7.17.0"
"video.js": "^8.10.0"
}
}
5 changes: 3 additions & 2 deletions src/culPlugins/mirador-videojs/components/VideoJS.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import videojs from 'video.js';
// eslint-disable-next-line import/no-webpack-loader-syntax
import videojs from '!video.js';

Check failure on line 3 in src/culPlugins/mirador-videojs/components/VideoJS.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unable to resolve path to module '!video.js'
import 'video.js/dist/video-js.css';

/** */
Expand Down Expand Up @@ -46,7 +47,7 @@ export const VideoJS = (props) => {
}, [playerRef]);

return (
<div ref={videoRef} />
<div ref={videoRef} data-vjs-player style={{ width: '100%' }} />
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class VideoJSAudioViewerBase extends Component {
remainingTimeDisplay: false,
},
controls: true,
fluid: true,
fill: true,
playbackRates: [0.5, 1, 1.5, 2],
responsive: true,
sources: audioResources.filter(audio => audio.id && audio.getFormat()).map(
Expand All @@ -46,11 +46,7 @@ class VideoJSAudioViewerBase extends Component {
};

if (videoJsOptions.sources.length === 0) return <ForbiddenComponent id="this content" />;
return (
<div className="video-js vjs-fill" data-vjs-player>
<VideoJS options={videoJsOptions} />
</div>
);
return <VideoJS options={videoJsOptions} />;
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/culPlugins/mirador-videojs/components/VideoJSViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class VideoJSViewerBase extends VideoViewer {
remainingTimeDisplay: false,
},
controls: true,
fluid: true,
fill: true,
playbackRates: [0.5, 1, 1.5, 2],
responsive: true,
sources: videoResources.filter(video => video.id && video.getFormat()).map(
Expand All @@ -46,11 +46,7 @@ class VideoJSViewerBase extends VideoViewer {
};

if (videoJsOptions.sources.length === 0) return <ForbiddenComponent id="this content" />;
return (
<div className="video-js vjs-fill" data-vjs-player>
<VideoJS options={videoJsOptions} />
</div>
);
return <VideoJS options={videoJsOptions} />;
}
}

Expand Down

0 comments on commit c1ebe2a

Please sign in to comment.