Skip to content

Conversation

@josephfrazier
Copy link
Contributor

MediaStream.stop() is deprecated and will be removed in M47, around November 2015

see https://groups.google.com/d/msg/sip_js/t7Km0p11Jpk/rMmwJTCHAAAJ

@wakamoleguy
Copy link
Contributor

That seems reasonable to me. The one odd part is adding a spy in the helpers, but we do that in at least one other place. As long as the spy methods are initialized from within the tests, rather than being statically set up beforehand, it should be fine.

@josephfrazier
Copy link
Contributor Author

Yeah, that spy was already being added, just on the stream instead of the track: josephfrazier@269865b#diff-de57ce79d9714a43d45b4fc11e14f7feL56

While we're on the subject of tests, though: I did try to have the expect calls happen within a getTracks().forEach loop, but the second test was failing, so I just tested the first audio track (the only one faked by HTML5.js). I did manually confirm in Chrome/Firefox that video tracks are stopped as well:

var SIP = require('sip.js');
var ua = new SIP.UA({traceSip: true})
var session = ua.invite('welcome@onsip.com', document.createElement('video'));
session.on('accepted', setTimeout.bind(null, session.bye.bind(session), 5000));

@wpp
Copy link
Contributor

wpp commented Sep 10, 2015

Hi,

FYI there are other changes coming up as well:

https://developers.google.com/web/updates/2015/07/mediastream-deprecations

  • MediaStream.ended
  • MediaStream.label
  • MediaStream.stop()

are all deprecated in Chrome 45. And require the following changes:

  • Use MediaStream.active to check if a MediaStream is streaming, not MediaStream.ended.
  • Use MediaStreamTrack.stop() to stop streaming, not MediaStream.stop().
  • If you need a unique identifier for a MediaStream use MediaStream.id instead of MediaStream.label. MediaStreamTrack.label provides a human-readable name for the source device for a stream, e.g. FaceTime HD Camera (Built-in) (05ac:8510).

…Stream#stop

MediaStream.stop() is deprecated and will be removed in M47, around November 2015

https://groups.google.com/d/msg/sip_js/t7Km0p11Jpk/rMmwJTCHAAAJ
…iaStream#stop

MediaStream.stop() is deprecated and will be removed in M47, around November 2015

https://groups.google.com/d/msg/sip_js/t7Km0p11Jpk/rMmwJTCHAAAJ
@josephfrazier
Copy link
Contributor Author

I did try to have the expect calls happen within a getTracks().forEach loop, but the second test was failing

I'm not sure what I was doing wrong earlier, but I got this working in josephfrazier@6a42ac5#diff-abec1c99b2499f4e85bec100d7dfc2a2

FYI there are other changes coming up as well:

Thanks for the heads-up, @wpp. This PR addresses the MediaStreamTrack.stop() change. The MediaStream.active change is unnecessary, as there are no references to MediaStream.ended in the code. Likewise, the MediaStream.id change isn't necessary, but it might be useful here:

MediaStreamManager.streamId = function (stream) {

josephfrazier pushed a commit that referenced this pull request Sep 10, 2015
WebRTC.MediaStreamManager - call MediaStreamTrack#stop instead of MediaStream#stop
@josephfrazier josephfrazier merged commit e520f53 into onsip:master Sep 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants