From 048042a8ba0f1215cf37115a50e36af2e46e4e89 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 5 Oct 2015 14:33:51 -0500 Subject: [PATCH] fix: message-view page now correctly plays webcam videos --- ui/lib/com/message.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/lib/com/message.js b/ui/lib/com/message.js index 30bfa12..d555f0c 100644 --- a/ui/lib/com/message.js +++ b/ui/lib/com/message.js @@ -5,6 +5,7 @@ var paramap = require('pull-paramap') var mlib = require('ssb-msgs') var schemas = require('ssb-msg-schemas') var ssbref = require('ssb-ref') +var pauser = require('pause-offscreen') var app = require('../app') var ui = require('../ui') var modals = require('../ui/modals') @@ -103,6 +104,10 @@ module.exports = function (msg, opts) { msg.el.appendChild(h('.well.text-muted', { style: 'margin: 5px 0 0 88px' }, com.icon('flash'), ' Replies will auto-update in realtime.')) } + // add offscreen pausing + var unlistenPauser = pauser(msgEl) + ui.onTeardown(unlistenPauser) + return msgEl }