summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-09-14 10:18:24 -0700
committerCorey Hulen <corey@hulen.com>2015-09-14 10:18:24 -0700
commit8d021a13f8509372f3deeb6a3513872b0d0b5427 (patch)
tree35c1962f9495b7ca377b21fd02336f380ccf9fb7 /web/react
parentc3742aef71801544172cf77a46d52835594096a4 (diff)
parent543ce8b4bea6f432ae26846d2f1de8b5f330df83 (diff)
downloadchat-8d021a13f8509372f3deeb6a3513872b0d0b5427.tar.gz
chat-8d021a13f8509372f3deeb6a3513872b0d0b5427.tar.bz2
chat-8d021a13f8509372f3deeb6a3513872b0d0b5427.zip
Merge pull request #668 from nickago/MM-1958
MM-1958 please read comment, base video player
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/view_image.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index b0eaba5d6..8d3495e3b 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -105,6 +105,14 @@ export default class ViewImageModal extends React.Component {
this.loadImage(this.state.imgId);
}.bind(this));
+ $('#' + this.props.modalId).on('hidden.bs.modal', function onModalHide() {
+ if (this.refs.video) {
+ var video = React.findDOMNode(this.refs.video);
+ video.pause();
+ video.currentTime = 0;
+ }
+ }.bind(this));
+
$(React.findDOMNode(this.refs.modal)).click(function onModalClick(e) {
if (e.target === this || e.target === React.findDOMNode(this.refs.imageBody)) {
$('.image_modal').modal('hide');
@@ -211,6 +219,16 @@ export default class ViewImageModal extends React.Component {
/>
</a>
);
+ } else if (fileType === 'video' || fileType === 'audio') {
+ content = (
+ <video
+ ref='video'
+ data-setup='{}'
+ controls='controls'
+ >
+ <source src={Utils.getWindowLocationOrigin() + '/api/v1/files/get' + filename} />
+ </video>
+ );
} else {
// non-image files include a section providing details about the file
var infoString = 'File type ' + fileInfo.ext.toUpperCase();