openvidu-browser: streamPropertyChanged for reason 'deviceRotated' not emitted on iOS
semmel opened this issue · comments
Describe the bug
When publishing my own video stream, no streamPropertyChanged
events are emitted when the iOS device is rotated.
Expected behavior
When changing the orientation of the iOS device a streamPropertyChanged
event with reason='deviceRotated'
and property='videoDimensions'
should be emitted.
Wrong current behavior
The onOrientationChanged
handler calls the method Publisher.getVideoDimensions()
which throws in the line document.body.removeChild(this.videoReference)
. Thus, OpenVidu.sendNewVideoDimensionsIfRequired()
cannot continue to call OpenVidu.sendVideoDimensionsChangedEvent()
.
OpenVidu tutorial where to replicate the error
- Any HTML page with a button, a video element and
openvidu-browser
v2.21–v2.27:
<video autoplay playsinline muted></video>
<button type="button">Get Cam</button>
<script src="../node_modules/openvidu-browser/static/js/openvidu-browser-2.27.0.js"></script>
- Create your own MediaStreamTrack with
kind = 'video'
and attach to<video>
button.addEventListener('click', () => {
navigator.mediaDevices.getUserMedia({video: true})
.then(mediaStream => {
videoElement.srcObject = mediaStream;
localVideoTrack = mediaStream.getVideoTracks()[0];
})
})
- Connect Safari Developer Tools
- Acquire MediaStream from the webcam by tapping
<button>
- Execute the usual workflow to publish the video
var OV = new OpenVidu();
var session = OV.initSession();
var publisher = await OV.initPublisherAsync(null, {audioSource: false, videoSource: localVideoTrack});
var token = await getAccessToken();
// <-- fetch from your serverawait session.connect(token);
session.publish(publisher);
- Rotate the device
- Observe the exception
"Unhandled Promise Rejection: NotFoundError: The object can not be found here." - Publisher.ts line 723
in the DevTools console
OpenVidu deployment info
- OpenVidu CE v2.21
- openvidu-node-client v2.21
Client device info (if applicable)
- Safari on iOS v16.5
- openvidu-browser v2.21 - v2.27
Additional context
#795 might be a related issue