Kurento / bugtracker

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento
46 stars 10 forks source link

Use of deprecated createObjectUrl not supported in Safari 11 #186

Closed razyalov closed 3 years ago

razyalov commented 7 years ago

KMS Version: any

Other libraries versions: n/a

Client libraries

Browsers tested Add OK or FAIL, along with the version, after browsers where you have tested this issue:

System description: Beta 5 of MacOS High Sierra 10.13 What steps will reproduce the problem?

  1. Run any kurento-util-js based client on Safari 11 on MacOS High Sierra (up to and including beta 5)
  2. When attempting to create the video object and assigning the url, the use of the deprecated createObjectURL API causes an error

What is the expected result? kurent-utils-js should use the new HTMLMediaObject.srcObject instead

What happens instead? When executing line 299/300 of the kurento-utils-js:

299     this.showLocalVideo = function () {
300 ==>>        localVideo.src = URL.createObjectURL(videoStream);

Getting a "Type Error" Safari throws an error: "Type Error" Does it happen with one of the tutorials? Yes, any of the tutorials that uses the showLocalVideo function

Please provide any additional information below. This prevents using the kurento-utils-js on the new Safari browser and might fail on other browsers if they stop supporting the URL.createOjbectURL function.

mizoRC commented 7 years ago

Try using: localVideo.srcObject = videoStream;

razyalov commented 7 years ago

It is not me. This is done by the kurento-js library internally. This need to be fixed by Kurento.

On Aug 22, 2017, at 5:17 AM, miguelrcDEV notifications@github.com wrote:

Try using: localVideo.srcObject = videoStream;

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mikesheppard commented 7 years ago

Found the same issue.... also used: localVideo.srcObject = videoStream; to fixed it.

razyalov commented 7 years ago

Have you tried it on Safari 11? It seems that an internal call within the Kurento JS library is doing this and causing an error.

Raz

On Aug 23, 2017, at 11:27 PM, Mike Sheppard notifications@github.com wrote:

Found the same issue.... also used: localVideo.srcObject = videoStream; to fixed it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Kurento/bugtracker/issues/186#issuecomment-324545452, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUqCV1v0p-QIlTwjaUi5R2dLowXyMnuks5sbRfPgaJpZM4O11Tj.

mizoRC commented 7 years ago

The error is something like "Expected at least 4 fields"?

razyalov commented 7 years ago

I get a typeError when calling the showVideo API of Kurento. If I stop using the functionality of the kurento-util-js to avoid issues with modern browsers, then what's the point of using the kurento-utils-js to begin with? The whole idea is that you don't need to worry about browser compatibility etc.

mizoRC commented 7 years ago

Completely agree with you @razyalov . I was only trying to help you, But of course this issue has to be solved by the equipment that maintains this library.

razyalov commented 7 years ago

thanks :-)

Raz

On Aug 24, 2017, at 12:04 AM, miguelrcDEV notifications@github.com wrote:

Completely agree with you @razyalov https://github.com/razyalov . I was only trying to help you, But of course this issue has to be solved by the equipment that maintains this library.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kurento/bugtracker/issues/186#issuecomment-324551847, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUqCdM1x7X_enL_kFvfoLnVQLNxUci8ks5sbSCBgaJpZM4O11Tj.

mikesheppard commented 7 years ago

Hi Raz - yeah I'm trying to get Kurento working with Safari 11 on Mac OSX (and eventually wanting it to work on Safari in IOS).

I'm just making modifications to kurento-utils.js because I need a working solution ASAP. The next issue to sort out is the 'Expected at least 4 fields' one.. Will let you know if I make any progress.

fabianpie commented 7 years ago

Hi, Have you created a github branch related to Safari 11 Mac OSX and Safari/Webkit in IOS support or could you share your version of the kurento-utils.js you are working on with the issues detected ? I could help in the testing and programming. I also need a working solution and we could work together on this.

fabianpie commented 7 years ago

Probably others could be also interested to help to move forward faster ...

mizoRC commented 7 years ago

Yep, I'm working on it, trying to make that it works on safari 11. So if you create a branch for this purpose and need some help, we could try to help you @mikesheppard

mikesheppard commented 7 years ago

Sounds great guys. I've just been modifying the kurento-utils.js file directly.

I've just cloned kurento-utils-js to create a branch but it'll take me a day or to because I'm not familiar with grunt and am having trouble with npm install. Will get there though and let you know.

fabianpie commented 7 years ago

Hi @mikesheppard, If you are having problems with github upload your kurento-utils.js version anywhere send us the link to download and we could share our tests/changes of the code here.

mikesheppard commented 7 years ago

Hey guys,

Not much so far but here's a public repo: https://github.com/mikesheppard/kurento-utils

Still working on the: OperationError (DOM Exception 34): Expects at least 4 fields. (kurento-utils.js, line 38)

This is coming from pc.setRemoteDescription(answer) in ProcessAnswer

razyalov commented 7 years ago

Thanks, will look into it over the long weekend. Have you tested it on both iOS and Desktop or just one of them? Also, have you confirmed you are testing with their latest release of the beta?

Raz

On Aug 31, 2017, at 8:16 PM, Mike Sheppard notifications@github.com wrote:

Hey guys,

Not much so far but here's a public repo: https://github.com/mikesheppard/kurento-utils https://github.com/mikesheppard/kurento-utils Still working on the: OperationError (DOM Exception 34): Expects at least 4 fields. (kurento-utils.js, line 38)

This is coming from pc.setRemoteDescription(answer) in ProcessAnswer

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kurento/bugtracker/issues/186#issuecomment-326476952, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUqCZKVluExTruK52ozP4iwSlCVQyajks5sd3cOgaJpZM4O11Tj.

mikesheppard commented 7 years ago

Good news Raz - all it needs is that one change (srcObject).

Then it works on Safari 11 (on Macbook Air - not IOS yet).

If it doesn't work it's due to the Kurento Server Configuration. Safari only works with H264 whereas Chrome works with VP8. What you need to do is to setup your Kurento App to use H264 which involves running this on your server: sudo apt-get install openh264-gst-plugins-bad-1.5

You can also change this to force H264: On my kurento server I switched off V8 by modifying: /etc/kurento/modules/kurento/SdpEndpoint.conf.json and commenting out the Video Codecs like so: "videoCodecs" : [ // { // "name" : "VP8/90000" // }, { "name" : "H264/90000" } ]

Then in the code (in my case JAVA) I use: MediaProfileSpecType profile = MediaProfileSpecType.MP4; instead of MediaProfileSpecType profile = MediaProfileSpecType.WEBM;

mikesheppard commented 7 years ago

Sorry yes with the latest release of the Beta too.

fabianpie commented 7 years ago

Hi, Is remoteVideo.src = ''; OK in dispose ?

delete remoteVideo.srcObject; or any other kind of clean up ?

razyalov commented 7 years ago

you do not want to delete properties of objects in JS, and from all my research setting the src to “” is the best approach. But I wonder what’s the best approach with srcObject. since the object is a stream, I think you can end the stream and set the srcObject to null.

Need to give it a test.

raz

On Sep 2, 2017, at 12:20 AM, Fabian notifications@github.com wrote:

Hi, Is remoteVideo.src = ''; OK in dispose ?

delete remoteVideo.srcObject; or any other kind of clean up ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kurento/bugtracker/issues/186#issuecomment-326727834, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUqCW54A3At4VjEU1lfPciBfShuUEZWks5seQGigaJpZM4O11Tj.

fabianpie commented 7 years ago

Is working bi directional to you ? I can send stream from safari to kurento but not receive from kurento. I supose It's a problem with codecs. I have already disabled vp8 in sdpendpoint.conf.json. I'm trying a communication between safari and chrome and I receive the camera of safari in chrome but not the camera from chrome in safari.

mikesheppard commented 7 years ago

Sorry yes in dispose it needs to be: localVideo.srcObject = null; and remoteVideo.srcObject = null;

If you can't play back the stream then it's a codec issue for sure. It's needs to be sent to safari as MP4 (it's probably transcoding it to VP8).

I switched around my server to only record in MP4 and then it works in both Safari and Chrome. However in chrome it worked better as VP8 - the video feed is now a little pixelated as MP4. What I'm going to do is to use either VP8 or MP4 depending on the browser. Just needs a bit of logic to decide which to do.

fabianpie commented 7 years ago

I don't understand the relation between recording and codec as selecting mp4 in the recorderendpoint it only applies for the saving format. Safari would negotiate the codec with Kurento saying it only supports H264 and Kurento would transcode if the receiving streaming is VP8. Anyway I added the recorded endpoint in server selected mp4 in media type but I don't received the stream I'm sending to Kurento from Chrome. No problem with stream I send from Safari to Kurento a Kurento sends to Chrome. Yes I noticed It's pixelated. Any suggestion about you might be doing different in order to receive the streamming in safari ? By the way any tip to tell kurento utils to stream in H264 or VP8 ?

mizoRC commented 7 years ago

Hi @fabianpie! First try to activate the "Enable Legacy WebRTC API" option in Safari > Develop > WebRTC. Then is possible that throws an error in kurentoUtils.WebRtcPeer.hark inside pc.setRemoteDesciption(). If you comment this line its possible that you receive the video stream from chrome, but without audio. I'm working on this step, trying to receive audio too. Hope I helped you.

fabianpie commented 7 years ago

Hi @miguelrcDEV, I have legacy enabled but I don't find kurentoUtils.WebRtcPeer.hark call in my code. By the way I was trying just with pure webrtc without Kurento in the middle and with the same result.

mikesheppard commented 7 years ago

Hi @fabianpie your right.

Tested in Chrome, Firefox, and Android phone - all good.

Found out what's happening. In Safari 11, if I record with MP4 - the file has no audio. If I record with webm the file has audio. However when I try to play it back, both won't work unless I set audio to false in the constraints so there must be an issue with the audio codec part of the MP4 transcoding but only in Safari

mikesheppard commented 7 years ago

Eg. Do this and you'll probably receive the stream: var videoInput = document.getElementById('videoInput'); var videoOutput = document.getElementById('videoOutput');

        var options = {
            localVideo      : videoInput,
            remoteVideo     : videoOutput,
            mediaConstraints : {
                audio : false,
                video : true
            },
            onicecandidate : onIceCandidate
        }

        webRtcPeer = new kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options,
        function(error) {
            if (error) return console.error(error);
            this.generateOffer(onOfferReview);
        });
mikesheppard commented 7 years ago

Wonder if this would fix it the audio issues with MP4 on Safari: https://groups.google.com/d/msg/kurento/iCaNUnPFZ7c/bwwfNCLdAwAJ

mizoRC commented 7 years ago

If you set audio to false, in Safari you receives video stream and audio stream, or only video @mikesheppard ?

mikesheppard commented 7 years ago

@miguelrcDEV Only receive the video stream with audio set to false and video set to true.

With audio set to true and video set to true you receive nothing probably due to the issues with the audio.

mizoRC commented 7 years ago

Any progress with the audio?

fabianpie commented 7 years ago

Hi, it looks you are uploading the stream saving mp4 and then playback in Safari. Anybody have tried a vide o chat room ? I couldn't receive the video if I stream from Kurento to Safari with and webrtcendpoint the stream received from other client. Anybody could do that ?

j1elo commented 7 years ago

Hi, we have noted from this bug report that there is an API change to do and will work on it. For the issues with audio/video streams, not directly related to the deprecation of the mentioned API, the conversation continues in the google groups thread: https://groups.google.com/forum/#!msg/kurento/5-bSZXsTpa0/a8FrPrZhAQAJ

regards, Juan

mizoRC commented 7 years ago

@mikesheppard I tryied changin the line mentioned in this post https://groups.google.com/d/msg/kurento/iCaNUnPFZ7c/bwwfNCLdAwAJ but doesn't do anything. Still getting black video and no audio.

fabianpie commented 7 years ago

I have tried without Kurento just browser webrtc to browser webrtc and it's not working for me. Anybody has a reference of any webrtc code example compatible with new version of Safari, just browser to browser ? I suposse it might work but I couldn't get any working example.

mizoRC commented 7 years ago

Try this samples @fabianpie: https://github.com/webrtc/samples Specially this: https://webrtc.github.io/samples/src/content/peerconnection/pc1/

rgordeev commented 7 years ago

@fabianpie yes, you may try it for example here https://safari.opentokrtc.com By the way does kurento still not working with Safari? I tried to run some examples from here https://github.com/Kurento/kurento-tutorial-java and that attempt wasn't succeed.

micaelgallego commented 7 years ago

It is in out roadmap, but we haven't got time to test Safari compatibility.

On Tue, Oct 17, 2017 at 4:57 PM, Roman Gordeev notifications@github.com wrote:

@fabianpie https://github.com/fabianpie yes, you may try it for example here https://safari.opentokrtc.com By the way does kurento still not working with Safari? I tried to run some examples from here https://github.com/Kurento/kurento-tutorial-java and that attempt wasn't succeed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Kurento/bugtracker/issues/186#issuecomment-337257830, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBdKJZxXgVIHnve7MCRcpy0qBhRHeOVks5stMBXgaJpZM4O11Tj .

tobisaki commented 7 years ago

It is an operation status report of safari 11 (iPhone OS 11 0 3). application is based on https://github.com/lulop-k/kurento-rtsp2webrtc.

The result is that the probability of normal operation is about 30%. In case of error, the video is blank and only the play start mark is displayed, and it will be normal if the page reloading is repeated several times. Repeated tracking of the display with the iPhone vertically / horizontally hung.

Turnserver, web, kurento are secure (wss / https) environment.

gunjot-mansa commented 6 years ago

The basic Hello world (http://doc-kurento.readthedocs.io/en/stable/tutorials/node/tutorial-helloworld.html) is not working for me in Safari 11.

Send and Receive both connections are working fine, but Safari is not receiving own video stream. It is working fine on all other browsers.

I followed all the suggestions:

Thoughts: In this case, sender and receiver streams, both are using H264 encoding and should have worked fine.

Any help!

tobisaki commented 6 years ago

video tag in tutorial's html code has autoplay. are you try remove it? In my experience, <video id="videoOutput" autoplay></video> is unable in safari 11. change to <video id="videoOutput" playsinline></video> and add "videoOutput.play();" to hideSpinner() function.

sorry, I have not tried it.

gunjot-mansa commented 6 years ago

Hi @tobisaki Thank you for your suggestion. Autoplay doesn't seem the issue here. Video Autoplay works, if MediaStream is used as source. I verified it in safari with p2p.

Here is the source : Media Capture and Autoplay Video

bansalritesh18 commented 6 years ago

@mikesheppard @micaelgallego Is this issue fixed? I am still getting error Expected at least 4 fields. on Safari. However, it is working fine on Chrome, Firefox and IE 11. The video is getting displayed in Safari but it is not being received in any other browser due to this issue.

Kukunin commented 6 years ago

Have the similar issues as well. Safari 11 is released already for five months, it's good to support it. Thanks

Kukunin commented 6 years ago

Fixed Expected at least 4 fields problem with installing apt-get install openh264-gst-plugins-bad-1.5 package. There is also 4.7.0-dev version of kurento-utils-js in git branch, which has better support of Safari.

micaelgallego commented 6 years ago

We plan to publish a new release of Kurento in the following days with Safari support.

On Thu, Feb 15, 2018 at 8:08 PM, Sergey Kukunin notifications@github.com wrote:

Fixed Expected at least 4 fields problem with installing apt-get install openh264-gst-plugins-bad-1.5 package. There is also 4.7.0-dev version of kurento-utils-js in git branch, which has better support of Safari.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kurento/bugtracker/issues/186#issuecomment-366029802, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBdKFnsXpF4v0fK5yJOa7BwQkcAP5mEks5tVIDBgaJpZM4O11Tj .

j1elo commented 6 years ago

I just posted a call for help to test the Safari support in different Apple devices: https://groups.google.com/forum/#!topic/kurento/rWZroM3SBWk

Please, anyone who wants to volunteer a bit of time can test the provided applications and let us know of any problems going on with them. This will allow to improve our compatibility with Safari 11, which is going to be announced in the official announcement for the version 6.7.0 release.

JefferyHus commented 6 years ago

not yet fixed as im still facing the same problem Expected at least 4 fields

skgith1 commented 6 years ago

+1 Also having this issue @JefferyHus - Clean install of 6.7.1 on Ubuntu 16.04

JefferyHus commented 6 years ago

@skgith1 yes still same issue I traced and tried many things but still getting this issue, this is only on IOS, works fine in MacOS