mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-20 21:46:04 -05:00
Video.js fixes and improvements after major upgrade (#1413)
This commit is contained in:
committed by
GitHub
parent
a5e6e7b9ca
commit
2a0cb977f2
@@ -16,6 +16,7 @@ import React, { useEffect, useRef } from 'react';
|
||||
const VideoJSEmbed = ({
|
||||
data,
|
||||
useRoundedCorners,
|
||||
version,
|
||||
isPlayList,
|
||||
playerVolume,
|
||||
playerSoundMuted,
|
||||
@@ -67,6 +68,7 @@ const VideoJSEmbed = ({
|
||||
window.MEDIA_DATA = {
|
||||
data: data || {},
|
||||
useRoundedCorners: useRoundedCorners,
|
||||
version: version,
|
||||
isPlayList: isPlayList,
|
||||
playerVolume: playerVolume || 0.5,
|
||||
playerSoundMuted: playerSoundMuted || (urlMuted === '1'),
|
||||
@@ -204,14 +206,14 @@ const VideoJSEmbed = ({
|
||||
if (!existingCSS) {
|
||||
const cssLink = document.createElement('link');
|
||||
cssLink.rel = 'stylesheet';
|
||||
cssLink.href = siteUrl + '/static/video_js/video-js.css';
|
||||
cssLink.href = siteUrl + '/static/video_js/video-js.css?v=' + version;
|
||||
document.head.appendChild(cssLink);
|
||||
}
|
||||
|
||||
// Load JS if not already loaded
|
||||
if (!existingJS) {
|
||||
const script = document.createElement('script');
|
||||
script.src = siteUrl + '/static/video_js/video-js.js';
|
||||
script.src = siteUrl + '/static/video_js/video-js.js?v=' + version;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -392,6 +392,7 @@ export default class VideoViewer extends React.PureComponent {
|
||||
return React.createElement(VideoJSEmbed, {
|
||||
data: this.props.data,
|
||||
useRoundedCorners: site.useRoundedCorners,
|
||||
version: site.version,
|
||||
isPlayList: !!MediaPageStore.get('playlist-id'),
|
||||
playerVolume: this.browserCache.get('player-volume'),
|
||||
playerSoundMuted: this.browserCache.get('player-sound-muted'),
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import React from 'react';
|
||||
import { SiteConsumer } from '../utils/contexts/';
|
||||
import VideoViewer from '../components/media-viewer/VideoViewer';
|
||||
import { _VideoMediaPage } from './_VideoMediaPage';
|
||||
|
||||
export class MediaVideoPage extends _VideoMediaPage {
|
||||
viewerContainerContent(mediaData) {
|
||||
return <>Not working anymore?</>; // TODO: check this if this page not working anymore as MediaPage.js do the same work
|
||||
return <SiteConsumer>{(site) => <VideoViewer data={mediaData} siteUrl={site.url} inEmbed={!1} />}</SiteConsumer>;
|
||||
}
|
||||
|
||||
mediaType() {
|
||||
return 'video';
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export function init(settings) {
|
||||
api: '',
|
||||
title: '',
|
||||
useRoundedCorners: true,
|
||||
version: '1.0.0',
|
||||
};
|
||||
|
||||
if (void 0 !== settings) {
|
||||
@@ -29,6 +30,10 @@ export function init(settings) {
|
||||
if ('boolean' === typeof settings.useRoundedCorners) {
|
||||
SITE.useRoundedCorners = settings.useRoundedCorners;
|
||||
}
|
||||
|
||||
if ('string' === typeof settings.version) {
|
||||
SITE.version = settings.version.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ module.exports = {
|
||||
url: process.env.MEDIACMS_URL || 'UNDEFINED_URL',
|
||||
api: process.env.MEDIACMS_API || 'UNDEFINED_API',
|
||||
useRoundedCorners: true,
|
||||
version: '1.0.0',
|
||||
theme: {
|
||||
mode: 'light', // Valid values: 'light', 'dark'.
|
||||
switch: {
|
||||
|
||||
Reference in New Issue
Block a user