@api.video/media-stream-composer
Advanced tools
Comparing version 0.1.4 to 0.1.5
# Changelog | ||
All changes to this project will be documented in this file. | ||
## [0.1.5] - 2022-09-14 | ||
- Fix stream id generation | ||
- Fix mouse events when occuring outside the canvas | ||
@@ -4,0 +7,0 @@ ## [0.1.4] - 2022-07-11 |
@@ -74,2 +74,3 @@ import { ProgressiveUploaderOptionsWithAccessToken, ProgressiveUploaderOptionsWithUploadToken, VideoUploadResponse } from "@api.video/media-recorder"; | ||
private drawings; | ||
private lastStreamId; | ||
constructor(options: Partial<Options>); | ||
@@ -76,0 +77,0 @@ startRecording(options: RecordingOptions): void; |
{ | ||
"name": "@api.video/media-stream-composer", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "api.video media stream composer", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -105,2 +105,3 @@ import { ApiVideoMediaRecorder, ProgressiveUploaderOptionsWithAccessToken, ProgressiveUploaderOptionsWithUploadToken, VideoUploadError, VideoUploadResponse } from "@api.video/media-recorder"; | ||
private drawings: ({ coords: [number, number][], startTime: number, } & DrawingSettings)[] = []; | ||
private lastStreamId = 0; | ||
@@ -192,3 +193,3 @@ constructor(options: Partial<Options>) { | ||
} | ||
const streamId = "audio_" + Object.keys(this.streams).length.toString(); | ||
const streamId = "audio_" + this.lastStreamId++; | ||
@@ -221,3 +222,3 @@ this.audioSources[streamId] = { | ||
} | ||
const streamId = "video_" + Object.keys(this.streams).length.toString(); | ||
const streamId = "video_" + this.lastStreamId++; | ||
@@ -224,0 +225,0 @@ options = this.validateOptions(options); |
@@ -85,8 +85,7 @@ import { StreamDetails } from "."; | ||
canvas.addEventListener("mouseup", (e) => this.mouseUp()); | ||
window.addEventListener("mouseup", (e) => this.mouseUp()); | ||
canvas.addEventListener("mousedown", (e) => this.mouseDown(fromMouseEvent(e))); | ||
canvas.addEventListener("mousemove", (e) => this.mouseMove(fromMouseEvent(e))); | ||
canvas.addEventListener("mouseleave", (e) => this.mouseUp()); | ||
canvas.addEventListener("touchend", (e) => this.mouseUp()); | ||
window.addEventListener("touchend", (e) => this.mouseUp()); | ||
canvas.addEventListener("touchstart", (e) => fromTouchEvent(e, (a) => { | ||
@@ -112,2 +111,3 @@ this.mouseMove(a); | ||
public onMove(listener: (e: MoveEvent) => void) { | ||
this.onMoveListeners.push(listener); | ||
@@ -131,2 +131,3 @@ } | ||
private mouseDown(mouseCoordinates: Coordinates) { | ||
if (this.overStream) { | ||
@@ -133,0 +134,0 @@ this.dragStart = { |
Sorry, the diff of this file is too big to display
899
226004