-
Notifications
You must be signed in to change notification settings - Fork 81
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
Safari on iPhone and MacOS cannot read the webcam but can send it. #20
Comments
instead of elem.srcObject = stream replace it with something like this // if audio
let track = stream.getAudioTracks()[0]
// if video
let track = stream.getVideoTracks()[0]
const newStream = new MediaStream()
newStream.addTrack(track)
elem.srcObject = newStream Or create a function like // call
this.attachMediaStream(elem, stream, 'audio')
this.attachMediaStream(elem, stream, 'video')
attachMediaStream(elem, stream, type) {
let track = (type == 'audio' ? stream.getAudioTracks()[0] : stream.getVideoTracks()[0])
const newStream = new MediaStream()
newStream.addTrack(track)
elem.srcObject = newStream
console.log('Success attached media ' + type)
} |
@miroslavpejic85 I solved the problem : https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms/blob/master/public/RoomClient.js#L421 About 15 days ago I modified this whole part, and I just have to put a |
@Madriix @miroslavpejic85 elem = document.createElement('video')
let track = stream.getVideoTracks()[0]
const newStream = new MediaStream()
newStream.addTrack(track)
elem.srcObject = newStream
elem.playsinline = true
elem.autoplay = true
elem.setAttribute('webkit-playsinline', 'webkit-playsinline');
elem.allowsInlineMediaPlayback = true;
elem.setAttribute('playsinline', 'playsinline')
elem.play() |
Hi
For about 15 days it has been in production on my site for the people.
I just noticed that it did not work in reception to Safari on an iPhone8. It sends the webcam fine and Safari/Chrome/Firefox can read. But when Firefox sends the camera, Safari on Iphone does not receive.
Where could the problem come from?
cordially
The text was updated successfully, but these errors were encountered: