How to correctly handle video constraints in webrtc - webrtc

I have a simple WebRTC application that is working correctly to set calls when constraint={audio: true, video: true}.
My issue is that when I change the video constraint to 1080p, it does not work:
constraints.video = {
width: { ideal: 1920 },
height: { ideal: 1080 },
};
I have an iphone and a macbook pro. The macbook has a camera that supports up to 720p. The iphone does support 1080p. If I start the call from the iphone, the call is stablished, but the video stream will stop working locally, and will not be transmitted to the remote peer.
If I start the call from the macbook, the call works as expected, with both peers transmitting at 720.
I suspect that the sdp offer has something to do with it, because the resolution used for both videos is the same, and fails if one of the peers is unable to match it (according to my observations).
I am using safari in the iphone. In the macbook, the same issue happens with chrome and firefox (it does work on safari). In the case of safari, I get a video at 1080p, and the other one at 720p (which is what I want). In chrome and firefox, when I check the width and height of the video, I get a 0, and checking webrtc-internals it looks like nothing is being transmitted.
What may be causing this issue? Is there any way to get the desired behaviour on all browsers?

Related

How can this webm file detect my web browser?

This video spreading across Discord is very intriguing...
The same webm file behaves as follows in the following browsers:
Browser / Player
Message
Chrome
"Discord detected on Chromium/Electron"
Firefox
"Discord detected on Gecko (Firefox)"
VLC
"Discord detected on Gecko (Firefox)"
Media Player Classic
"Discord detected on Chromium/Electron"
Edge
"Discord detected on Chromium/Electron"
Safari
Play bar loads but only plays first frame of video.
Epiphany
Play bar loads but won't play at all.
Edge (Legacy)
Won't load/play
IE11
Won't load/play
Windows 10 Movies and TV
Won't load/play
I'm well aware that the "Discord" part of the message baked-in to the video, but what about the rest?
I had originally suspected that the .webm file was somehow switching to a streaming method and using server-side headers to influence the video content, but I tried in a VM in airplane mode and it still worked.
My second thought is that since .webm-capable browsers can be split up into two groups: Chromium-based and Gecko-based, that this video has multiple video sources embedded and is taking advantage of a very specific browser incompatibility, like a magic trick that forces you to select a card.

HTML5 video with RTSP stream source not playing in Chrome on iPhone ios 13.4 but working in Safari

Developing a browser based webrtc streaming system, managed to get it all working properly and allows streaming from all devices. But my problem is on playback: all desktop browsers play it fine, chrome firefox on windows, chrome firefox safari on MacOs, works fine on android devices using chrome or firefox, but on iPhone/iPad iOS 13.4 it will only play in Safari. There are plenty of users using Chrome as their preferred browser on iOS devices, so I'm trying to figure out what can be preventing the videos to play on Chrome( chrome version tested on iphone is Chrome v83.0.4103.88
here is a snippet of the video
<video autoplay muted playsinline loop type ='rtmp/mp4' preload='auto' id="testVideo" style="width:100%;height:100%;" data-setup='{"techOrder": ["html5"], "nativeControlsForTouch": false, "controlBar": { "muteToggle": false, "volumeControl": false, "timeDivider": false, "durationDisplay": false, "progressControl": false } }'></video>
video source is loaded via JS and stream type is RTSP, handled in a Wowza instance media server (V4.7.8), encoding h264 baseline profile/pcma
Can't really find much on stack, most people having similar issues have it with Safari and chrome works fine for them. My problem is Safari works, but only safari on iOS devices.
Any suggestion is much appreciated!
EDIT: streams are published in mp4 format

Safari HTML5 video no longer autoplays

Recently I have noticed that the video elements on my site no longer autoplay on iOS Safari or desktop Safari.
The current code looks something like this:
<video playsinline autoplay muted loop poster="/path/to/poster.jpg>">
<source src="/path/to/video.mp4" type="video/mp4">
</video>
From my understanding, this is enough to abide by Webkit's new video policies for iOS and MacOS to allow for a video to autoplay.
I have searched for similar questions and not come across a solution. In this question it seems like the source tag itself could be the problem.
This thread suggests that iOS blocks videos from autoplaying on low power mode as well. But I've determined this isn't causing my issue.
Has anyone come across this issue themselves? Do you have a solution? Can someone point me in the direction of some Safari change logs where this breaking change was introduced?
Details
iOS 11.4
MacOS Safari Version 11.1 (13605.1.33.1.2)
EDIT
The video isn't being loaded correctly, when I check the Network panel in Safari dev tools the MP4 shows up under 'Other' with the error "An error occurred trying to load the resource".
If I try to play the video directly in Safari (eg: go to https://my-website.com/path/to/video.mp4) I get the error Failed to load resource: Plug-in handled load
I think it's because my video is a file blob, and Safari expects videos to be from streaming servers (as mentioned in this question)
EDIT 2
Might be something to do with how Safari is introducing the ability to use videos in img tags? See this and this

Cannot view video from publisher using Chrome to iPad with OpenTok

I'm currently trying to set up a connection between my web client and my iOS app, but for some reason my iOS client only sees a black box when using Chrome (version 33). I can see the video just fine if I use Firefox (both in my app and when I put the browsers side-by-side, they can see each other).
This doesn't appear to be a documented known issue with the JavaScript SDK, and I can't see any recent discussion about this on the forums (last post was mine).
The iOS sample can be located here (samples/OpenTokHelloWorld) with the browser page in samples/OpenTokHelloWorld/browser_demo.html
I suggest cd'ing into samples/OpenTokHelloWorld and running python -m SimpleHTTPServer, as it can't be run from a file:/// path.
Here is what my iPad sees:
Chrome:
Firefox:
And Chrome/Firefox (respectively), both publishing video from the same camera
Edit: after testing on other machines, it may be something specific to my environment even though none of my extensions run in Incognito and I don't have any custom plugins installed.
It looks like the OpenTok mobile SDKs with the specific webcam I was using has issues. On Android the video stream will display for a brief moment then segfault, and on iOS there will be no video at all.
I have tested this many times and could not reproduce what you are seeing in your chrome.
Without seeing any console errors or iOS logs the best suggestion is to try clearing your cache, or maybe restarting your computer (longshot)

Blank video in Firefox (Mac) using mediaelement.js

Using mediaelement.js with great success except for Firefox on Mac OS X where the video seems to load fine and display the correct duration and the play head scrubs - the only problem is that the video is blank unlike in Firefox on Windows and all other browsers.
We are using the single h.264 option.
Sporadically we also see this error in Firefox on OS X randomly on page load - Error: this.pluginAPI.playMedia is not a function
Anybody have any ideas?