Skip to content

Commit

Permalink
Merge 4c95136 into 7719fa1
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Jan 7, 2019
2 parents 7719fa1 + 4c95136 commit 58fa64f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -10,12 +10,13 @@ addons:

# headless firefox dependencies (see https://bugzilla.mozilla.org/show_bug.cgi?id=1372998)
before_install:
- sudo update-alternatives --set google-chrome /usr/bin/google-chrome-beta
- sudo apt-get install -y x11-xserver-utils xserver-xorg-core xvfb dbus-x11
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

install:
- npm install opencollective-postinstall
- npm install lightercollective
- npm prune
- npm install

Expand Down
9 changes: 8 additions & 1 deletion CHANGES.md
@@ -1,11 +1,18 @@
videojs-record changelog
========================

3.2.1 - unreleased
------------------

- Fix issue with `srcObject` (#312)
- Fix shim for screen capture (#318)


3.2.0 - 2019/01/07
------------------

- Fix duration display for video.js 7.4.x (#316)
- Bump required version for recordrtc to 5.5.0 for URL.createObjectURL fixes
- Bump required version for recordrtc to 5.5.0 for `URL.createObjectURL` fixes
(#315)
- Simple upload example: make sure upload directory exists (#314)

Expand Down
3 changes: 2 additions & 1 deletion karma.conf.js
Expand Up @@ -169,7 +169,8 @@ module.exports = function(config) {
customLaunchers: {
Chrome_dev: {
base: 'Chrome',
flags: chromeFlags
flags: chromeFlags,
chromeDataDir: path.resolve(__dirname, '.chrome')
},
Chromium_dev: {
base: 'ChromiumHeadless',
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions src/js/videojs.record.js
Expand Up @@ -249,14 +249,6 @@ class Record extends Plugin {

// hide play control
this.player.controlBar.playToggle.hide();

// trigger early warning if screen-only is not supported
if (this.getRecordType() === SCREEN_ONLY &&
'getDisplayMedia' in navigator === false) {
// screen capture not supported in this browser
let errorMessage = 'getDisplayMedia is not supported';
this.player.trigger('error', errorMessage);
}
}

/**
Expand Down Expand Up @@ -412,7 +404,7 @@ class Record extends Plugin {
screen: true,
gif: false
};
navigator.getDisplayMedia({
navigator.mediaDevices.getDisplayMedia({
video: true
}).then(
this.onDeviceReady.bind(this)
Expand Down Expand Up @@ -1080,10 +1072,12 @@ class Record extends Plugin {
case ANIMATION:
case SCREEN_ONLY:
if (url instanceof Blob || url instanceof File) {
// make sure to reset it (#312)
this.mediaElement.srcObject = null;
// assign blob using createObjectURL
this.mediaElement.src = URL.createObjectURL(url);
} else {
// assign stream without createObjectURL
// assign stream with srcObject
setSrcObject(url, this.mediaElement);
}
break;
Expand Down
6 changes: 3 additions & 3 deletions test/test-helpers.js
Expand Up @@ -6,7 +6,7 @@ import document from 'global/document';

import {Player, mergeOptions} from 'video.js';

import {browserShim, browserDetails} from 'webrtc-adapter';
import adapter from 'webrtc-adapter';

import {LIBVORBISJS, RECORDERJS, LAMEJS, OPUSRECORDER} from '../src/js/engine/record-engine.js';

Expand Down Expand Up @@ -220,8 +220,8 @@ const TestHelpers = {
makeScreenOnlyPlayer(newOptions) {
// use polyfill in Firefox for now, see:
// https://blog.mozilla.org/webrtc/getdisplaymedia-now-available-in-adapter-js/
if (browserDetails.browser === 'firefox') {
browserShim.shimGetDisplayMedia(window, 'screen');
if (adapter.browserDetails.browser === 'firefox') {
adapter.browserShim.shimGetDisplayMedia(window, 'screen');
}
let opts = {
controls: true,
Expand Down

0 comments on commit 58fa64f

Please sign in to comment.