-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for capturing screen + audio (#385)
* Add AUDIO_SCREEN recording type * Add sv-perm icon (for tests, differentiation) * getRecorderMode: Improve conditionals to catch mixed modes first * Record Screencast + Audio stream This requires using .addTrack to grab the microphone from getUserMedia, the ordering / context and so on matter. * Add tests for AUDIO_SCREEN * Add example for audio-screen * README: Update for screen capturing * add changelog entry
- Loading branch information
1 parent
e6da555
commit 0943657
Showing
13 changed files
with
232 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Audio/Screen Example - Record Plugin for Video.js</title> | ||
|
||
<link href="../node_modules/video.js/dist/video-js.min.css" rel="stylesheet"> | ||
<link href="../dist/css/videojs.record.css" rel="stylesheet"> | ||
<link href="assets/css/examples.css" rel="stylesheet"> | ||
|
||
<script src="../node_modules/video.js/dist/video.min.js"></script> | ||
<script src="../node_modules/recordrtc/RecordRTC.js"></script> | ||
<script src="../node_modules/webrtc-adapter/out/adapter.js"></script> | ||
|
||
<script src="../dist/videojs.record.js"></script> | ||
|
||
<script src="browser-workarounds.js"></script> | ||
|
||
<style> | ||
/* change player background color */ | ||
#myVideo { | ||
background-color: #9ab87a; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<video id="myScreenAudio" playsinline class="video-js vjs-default-skin"></video> | ||
|
||
<script> | ||
var options = { | ||
controls: true, | ||
width: 800, | ||
height: 450, | ||
fluid: false, | ||
controlBar: { | ||
volumePanel: false, | ||
fullscreenToggle: false | ||
}, | ||
plugins: { | ||
record: { | ||
audio: true, | ||
screen: true, | ||
debug: true | ||
} | ||
} | ||
}; | ||
|
||
// apply some workarounds for opera browser | ||
applyVideoWorkaround(); | ||
applyScreenWorkaround(); | ||
|
||
var player = videojs('myScreenAudio', options, function() { | ||
// print version information at startup | ||
var msg = 'Using video.js ' + videojs.VERSION + | ||
' with videojs-record ' + videojs.getPluginVersion('record') + | ||
' and recordrtc ' + RecordRTC.version; | ||
videojs.log(msg); | ||
}); | ||
|
||
// error handling | ||
player.on('deviceError', function() { | ||
console.log('device error:', player.deviceErrorCode); | ||
}); | ||
|
||
player.on('error', function(element, error) { | ||
console.error(error); | ||
}); | ||
|
||
// user clicked the record button and started recording | ||
player.on('startRecord', function() { | ||
console.log('started recording!'); | ||
}); | ||
|
||
// user completed recording and stream is available | ||
player.on('finishRecord', function() { | ||
// the blob object contains the recorded data that | ||
// can be downloaded by the user, stored on server etc. | ||
console.log('screen+audio capture ready: ', player.recordedData); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.