Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openvidu-browser: streamPropertyChanged for reason 'deviceRotated' not emitted on iOS #802

Closed
semmel opened this issue May 25, 2023 · 0 comments · Fixed by #803
Closed
Labels

Comments

@semmel
Copy link
Contributor

semmel commented May 25, 2023

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

  1. 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>
  1. 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];
   })
})
  1. Connect Safari Developer Tools
  2. Acquire MediaStream from the webcam by tapping <button>
  3. Execute the usual workflow to publish the video
    1. var OV = new OpenVidu();
    2. var session = OV.initSession();
    3. var publisher = await OV.initPublisherAsync(null, {audioSource: false, videoSource: localVideoTrack});
    4. var token = await getAccessToken(); // <-- fetch from your server
    5. await session.connect(token);
    6. session.publish(publisher);
  4. Rotate the device
  5. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant