Skip to content

Commit

Permalink
feat: allow specifying a mimeType
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaiodias committed Nov 28, 2018
1 parent 1158f12 commit 3a96703
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,14 @@ export default class VideoRecorder extends Component {
isDataHealthOK (event) {
if (!event.data) return this.onDataIssue(event)

const mimeType = this.props.mimeType || getMimeType()

// in some browsers (FF/S), data only shows up
// after a certain amount of time ~everyt 2 seconds
const blobCount = this.recordedBlobs.length
if (blobCount > dataCheckInterval && blobCount % dataCheckInterval === 0) {
const blob = new window.Blob(this.recordedBlobs, {
type: getMimeType()
type: mimeType
})
if (blob.size <= 0) return this.onDataIssue(event)
}
Expand Down

0 comments on commit 3a96703

Please sign in to comment.