mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (video): set mimetype automatically
This commit is contained in:
parent
ae2ef413b3
commit
5beba70b36
1 changed files with 7 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
|
||||||
|
|
||||||
import { Pager } from './pager';
|
import { Pager } from './pager';
|
||||||
import { MenuBar } from './menubar';
|
import { MenuBar } from './menubar';
|
||||||
|
import { getMimeType } from '../../helpers/';
|
||||||
import videojs from 'video.js';
|
import videojs from 'video.js';
|
||||||
import 'videojs-contrib-hls';
|
import 'videojs-contrib-hls';
|
||||||
|
|
||||||
|
|
@ -18,9 +19,10 @@ export class VideoPlayer extends React.Component {
|
||||||
this.player = videojs(this.refs.$video, {
|
this.player = videojs(this.refs.$video, {
|
||||||
fluid: true,
|
fluid: true,
|
||||||
controls: true,
|
controls: true,
|
||||||
aspectRatio: '16:9',
|
aspectRatio: "16:9",
|
||||||
sources: [{
|
sources: [{
|
||||||
src: this.props.data
|
src: this.props.data,
|
||||||
|
type: getMimeType(this.props.data)
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -30,9 +32,10 @@ export class VideoPlayer extends React.Component {
|
||||||
this.player = videojs(this.refs.$video, {
|
this.player = videojs(this.refs.$video, {
|
||||||
fluid: true,
|
fluid: true,
|
||||||
controls: true,
|
controls: true,
|
||||||
aspectRatio: '16:9',
|
aspectRatio: "16:9",
|
||||||
sources: [{
|
sources: [{
|
||||||
src: nextProps.data
|
src: nextProps.data,
|
||||||
|
type: getMimeType(this.props.data)
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue