Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
update dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuochun committed Aug 8, 2013
1 parent e3a1718 commit 27a37ca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
29 changes: 21 additions & 8 deletions dist/RecordRTC.js → dist/RecordRTC-together.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ function StereoAudioRecorder(mediaStream, root) {
recorder.connect(context.destination);
}
;// Wang Zhuochun
// 20/Jul/2013 10:04 PM
// https://github.com/H0201030/record-rtc-together
// 08/Aug/2013 06:08 PM

(function() {

Expand Down Expand Up @@ -682,14 +683,23 @@ function StereoAudioRecorder(mediaStream, root) {
startVideo: function() {
console.log('started recording video frames');

// reset video blob
this.videoBlob = null;

// set canvas width, height
this.c_width = this.options.canvas_width || defaults.canvas_width;
this.c_height = this.options.canvas_height || defaults.canvas_height;
// set video width, height
this.v_width = this.options.video_width || this.videoElem.offsetWidth;
this.v_height = this.options.video_height || this.videoElem.offsetHeight;

// TODO select the min width/height btw canvas and videoElem
if (this.v_width < this.c_width) {
this.v_width = this.c_width;
}

if (this.v_height < this.c_height) {
this.v_height = this.c_height;
}

this.canvas.width = this.c_width;
this.canvas.height = this.c_height;
Expand Down Expand Up @@ -717,6 +727,9 @@ function StereoAudioRecorder(mediaStream, root) {
startAudio: function() {
console.log('started recording audio frames');

// reset audio blob
this.audioBlob = null;

var self = this,
onDataReady = {
ondataavailable: self.onAudioReady.bind(self)
Expand Down Expand Up @@ -750,24 +763,24 @@ function StereoAudioRecorder(mediaStream, root) {
// stop record all
stop: function() {
if (this.options.enable) {
if (this.options.enable.audio) this.stopAudio();
if (this.options.enable.video) this.stopVideo();
if (this.options.enable.audio) this.stopAudio();
} else if (defaults.enable) {
if (defaults.enable.audio) this.stopAudio();
if (defaults.enable.video) this.stopVideo();
if (defaults.enable.audio) this.stopAudio();
}
},
// on video ready
onVideoReady: function(callback) {
console.log('on video ready');

if (isFunction(callback)) {
this.onVideoCallback = callback;

if (this.videoBlob) {
callback(this.videoBlob);
}
} else {
console.log('on video ready');

this.videoBlob = callback;

if (this.onVideoCallback) {
Expand All @@ -777,15 +790,15 @@ function StereoAudioRecorder(mediaStream, root) {
},
// on audio ready
onAudioReady: function(callback) {
console.log('on audio ready');

if (isFunction(callback)) {
this.onAudioCallback = callback;

if (this.audioBlob) {
callback(this.audioBlob);
}
} else {
console.log('on audio ready');

this.audioBlob = callback;

if (this.onAudioCallback) {
Expand Down
Loading

0 comments on commit 27a37ca

Please sign in to comment.