Skip to content

Commit 91d3039

Browse files
Merge pull request #8 from apivideo/fix-screencast-ratio-issue
fix: screencast stream size ratio issue
2 parents efb0c73 + 061de00 commit 91d3039

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
3+
4+
## [0.1.6] - 2022-09-16
5+
- Fix screencast stream size ratio issue
6+
37
## [0.1.5] - 2022-09-14
48
- Fix stream id generation
59
- Fix mouse events when occuring outside the canvas

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.video/media-stream-composer",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "api.video media stream composer",
55
"repository": {
66
"type": "git",

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ export class MediaStreamComposer {
221221

222222
options = this.validateOptions(options);
223223

224+
225+
const video = document.createElement('video');
226+
video.srcObject = mediaStream;
227+
228+
video.onresize = (_) => this.updateStream(streamId, options);
229+
224230
const displaySettings = this.buildStreamDisplaySettings(streamId, mediaStream, options);
225231
this.streams[streamId] = {
226232
id: streamId,
@@ -490,6 +496,7 @@ export class MediaStreamComposer {
490496

491497
private buildStreamDisplaySettings(id: string, mediaStream: MediaStream, options: StreamOptions): StreamDisplaySettings {
492498
const trackSettings = mediaStream.getVideoTracks()[0].getSettings();
499+
493500
const streamResolution = { width: trackSettings.width!, height: trackSettings.height! };
494501
const containerResolution = this.options.resolution;
495502

0 commit comments

Comments
 (0)