Kurento-Utils, setRemoteVideo no longer working in Safari 12.1 after Mojave update to 10.14.4

120 views
Skip to first unread message

Neil Young

unread,
Apr 2, 2019, 2:13:29 PM4/2/19
to kurento

Trace is "Remote stream: undefined"

I noticed the difference in behaviour, since the Developer menu doesn't contain the menu item "WebRTC/Enable older versions" (maybe other wording in English).
This was necessary to make KurentuUtils run at all in Safari 12. It's gone, KurentoUtils gone too :)

Confirmations?


Neil Young

unread,
Apr 2, 2019, 2:48:10 PM4/2/19
to kurento
My proposal (and my local solution) would be to dry out the deprecated pc.getRemoteStream()[0] and add a handler for the onTrack callback instead:



// pc.onaddstream = options.onaddstream
pc.ontrack = options.ontrack || function (event) {
logger.debug("Remote track(s) received")
event.streams[0].getTracks().forEach(track => {
logger.debug("Remote track", track)
})

if (remoteVideo) {
if (remoteVideo.srcObject != event.streams[0]) {

remoteVideo.srcObject = event.streams[0]
logger.debug("Remote stream assigned to remote video display")

remoteVideo.onloadedmetadata = (event) => {
logger.debug("Remote video play")
remoteVideo.play().then(() => { logger.debug("Remote video playing") }).catch((err) => { logger.error("Error while trying to play remote video:", err) })
}
}
}
}

function setRemoteVideo() {
logger.debug("setRemoteVideo deprecated")
// if (remoteVideo) {
// remoteVideo.pause()

// var stream = pc.getRemoteStreams()[0]
// remoteVideo.srcObject = stream
// logger.debug('Remote stream:', stream)
// remoteVideo.load()
// }
}

This makes it work again in all recent browsers. Not sure if it is worth a PR

Neil Young

unread,
Apr 2, 2019, 3:00:46 PM4/2/19
to kurento
The pc.ontrack would probably have to be changed to avoid problems with mixed usage of old-style functions and arrow-functions:

// pc.onaddstream = options.onaddstream
pc.ontrack = options.ontrack || function (event) {
logger.debug("Remote track(s) received")
event.streams[0].getTracks().forEach(function(track) {
logger.debug("Remote track", track)
})

if (remoteVideo) {
if (remoteVideo.srcObject != event.streams[0]) {

remoteVideo.srcObject = event.streams[0]
logger.debug("Remote stream assigned to remote video display")

remoteVideo.onloadedmetadata = function () {
logger.debug("Remote video play")
remoteVideo.play().then(function() { logger.debug("Remote video playing") }).catch(function(err) { logger.error("Error while trying to play remote video:", err) })
}
}
}
}



solom...@gmail.com

unread,
Apr 3, 2019, 9:04:11 AM4/3/19
to kurento

Micael Gallego

unread,
Apr 3, 2019, 9:37:00 AM4/3/19
to kur...@googlegroups.com
Tha ks

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/6274e603-35d1-43f2-97d9-5ac554bcac97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Neil Young

unread,
Apr 3, 2019, 3:08:08 PM4/3/19
to kurento
When will it be taken over?

Tha ks

To unsubscribe from this group and stop receiving emails from it, send an email to kur...@googlegroups.com.

Micael Gallego

unread,
Apr 3, 2019, 3:10:02 PM4/3/19
to kur...@googlegroups.com
Todos los tests e2e de Kurento usan KurentoUtils under the hood. Pero no sé si se ejecutan en los browsers afectados o no.

Me parece bien ponerlo en la 6.11, pero avisa please del planning para que la gente nos vea que respondemos.

Un saludo

To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.

To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.

Neil Young

unread,
Apr 3, 2019, 3:12:18 PM4/3/19
to kur...@googlegroups.com
Ehem...??

Micael Gallego

unread,
Apr 3, 2019, 3:29:10 PM4/3/19
to kur...@googlegroups.com
Sorry ;)

We are working on it. We are going to publish 6.10 version in a few days and we will accept the PR for the next version to be able to test it.

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.

Neil Young

unread,
Apr 3, 2019, 3:47:59 PM4/3/19
to kurento
I can confirm: Your PR is working in all browsers. And it is more generic than mine.

Thanks 

solom...@gmail.com

unread,
Apr 4, 2019, 2:12:45 AM4/4/19
to kurento
glad to help :)

Carlos

unread,
Apr 14, 2020, 11:29:46 AM4/14/20
to kurento
This PR is already merged, but the line "pc.onaddstream = options.onaddstream;" is still in the code. As per what I understand, this line is not needed anymore, right? Right now it's deprecated and it throws a warning in the console.
Thanks
Reply all
Reply to author
Forward
0 new messages