summaryrefslogtreecommitdiffstats
path: root/web/react/components/view_image.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-14 16:59:24 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-14 16:59:24 -0700
commit3bd350dcaf65a89040f7ea395a19b620819ba03e (patch)
tree72b49e6fadfc1d513489b8938d5f73620ff2a6d8 /web/react/components/view_image.jsx
parente06e292be71ca699d90bafbd635118aa47c2d7a5 (diff)
parentbfebb41bc0c0a1c5f481617f912bdf6dd483c341 (diff)
downloadchat-3bd350dcaf65a89040f7ea395a19b620819ba03e.tar.gz
chat-3bd350dcaf65a89040f7ea395a19b620819ba03e.tar.bz2
chat-3bd350dcaf65a89040f7ea395a19b620819ba03e.zip
Merge branch 'master' into PLT-12-log
Diffstat (limited to 'web/react/components/view_image.jsx')
-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();