triniwiz / nativescript-webrtc

Apache License 2.0
42 stars 25 forks source link

Missing properties of Media Tracks #17

Open ahmetceylan opened 5 years ago

ahmetceylan commented 5 years ago

Which platform(s) does your issue occur on?

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Can you please implement following properties of media track objects;

and also, it would be good to have an event that is firing when the aspect ratio is changed

triniwiz commented 5 years ago

video tracks

audio tracks

feat: https://github.com/triniwiz/nativescript-webrtc/commit/43d69a8ba1228ba7827b13827898f23cc1dfb400

abhayastudios commented 4 years ago

@triniwiz so in alpha22, what is the best way to get access to the aspect ratio of the local video stream? For example, in the main page of the ng-demo-firestore I am showing a preview of the local video stream, where I set the width to screen.mainScreen.widthDIPs/4. However, I want to set the height to something that respects the aspectRatio, so how do I get the relative height?

In the context of these lines, I tried to do the following: console.dir(mediaStream.videoTracks[0].settings);

On Android I got the following output:

JS: ==== object dump start ====
JS: _mediaTrackSettings: co.fitcom.fancywebrtc.FancyRTCMediaTrackSettings@c70e655
JS: width: "640"
JS: height: "480"
JS: frameRate: "30000"
JS: aspectRatio: "1"
JS: facingMode: "user"
JS: ==== object dump end ====

Some questions:

Thanks!

triniwiz commented 4 years ago
  1. Milliseconds value (we could try returning seconds)
  2. This should be showing the correct ratio because (noticed I commented this
  3. Might be related to no.2 but those are the default values of non was specified when get usermedia was called also it would check if the device does support that size or get the closest supported size