@api.video/media-recorder
Advanced tools
Comparing version 1.0.4 to 1.0.5
# Changelog | ||
All changes to this project will be documented in this file. | ||
## [1.0.5] - 2022-05-31 | ||
- Add `getMediaRecorderState()` method | ||
- Fix `stop()` method when the recorder is not started | ||
## [1.0.4] - 2022-05-24 | ||
@@ -5,0 +9,0 @@ - Prevent last uploaded part to be empty |
import { ProgressiveUploaderOptionsWithUploadToken, ProgressiveUploaderOptionsWithAccessToken, VideoUploadResponse } from "@api.video/video-uploader"; | ||
export { ProgressiveUploaderOptionsWithAccessToken, ProgressiveUploaderOptionsWithUploadToken } from "@api.video/video-uploader"; | ||
export { ProgressiveUploaderOptionsWithAccessToken, ProgressiveUploaderOptionsWithUploadToken, VideoUploadResponse } from "@api.video/video-uploader"; | ||
export interface Options { | ||
@@ -15,2 +15,3 @@ title?: string; | ||
}): void; | ||
getMediaRecorderState(): RecordingState; | ||
stop(): Promise<VideoUploadResponse>; | ||
@@ -17,0 +18,0 @@ pause(): void; |
{ | ||
"name": "@api.video/media-recorder", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "api.video media recorder - upload video from your webcam with ease", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -29,3 +29,4 @@ [![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video) [![badge](https://img.shields.io/github/stars/apivideo/api.video-typescript-media-recorder?style=social)](https://github.com/apivideo/api.video-typescript-media-recorder) [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video) | ||
- [Options](#options-1) | ||
- [`stop()`](#stop) | ||
- [`stop(): Promise<VideoUploadResponse>`](#stop-promisevideouploadresponse) | ||
- [`getMediaRecorderState(): RecordingState`](#getmediarecorderstate-recordingstate) | ||
- [Full example](#full-example) | ||
@@ -177,6 +178,10 @@ | ||
### `stop()` | ||
### `stop(): Promise<VideoUploadResponse>` | ||
The start() method stops the media recording. It upload the last part of content retrieved from the MediaStream (this will start the aggregation of the video parts on the api.video side). It takes no parameter. It returns a Promise that resolves with the newly created video. | ||
### `getMediaRecorderState(): RecordingState` | ||
Return the state of the underlaying [MediaRecorder](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder). | ||
**Example** | ||
@@ -183,0 +188,0 @@ |
import { ProgressiveUploader, ProgressiveUploaderOptionsWithUploadToken, ProgressiveUploaderOptionsWithAccessToken, VideoUploadResponse } from "@api.video/video-uploader"; | ||
export { ProgressiveUploaderOptionsWithAccessToken, ProgressiveUploaderOptionsWithUploadToken } from "@api.video/video-uploader"; | ||
export { ProgressiveUploaderOptionsWithAccessToken, ProgressiveUploaderOptionsWithUploadToken, VideoUploadResponse } from "@api.video/video-uploader"; | ||
@@ -48,5 +48,9 @@ export interface Options { | ||
public getMediaRecorderState(): RecordingState { | ||
return this.mediaRecorder.state; | ||
} | ||
public stop(): Promise<VideoUploadResponse> { | ||
this.mediaRecorder.stop(); | ||
return new Promise((resolve, reject) => { | ||
this.mediaRecorder.stop(); | ||
this.onVideoAvailable = (v) => resolve(v) | ||
@@ -53,0 +57,0 @@ }) |
Sorry, the diff of this file is too big to display
125578
108
272