選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

media_stream.js 1.0KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Provides a wrapper class for the MediaStream.
  3. *
  4. * TODO : Add here the src from the video element and other related properties
  5. * and get rid of some of the mappings that we use throughout the UI.
  6. */
  7. var MediaStream = (function() {
  8. /**
  9. * Creates a MediaStream object for the given data, session id and ssrc.
  10. *
  11. * @param data the data object from which we obtain the stream,
  12. * the peerjid, etc.
  13. * @param sid the session id
  14. * @param ssrc the ssrc corresponding to this MediaStream
  15. *
  16. * @constructor
  17. */
  18. function MediaStreamProto(data, sid, ssrc) {
  19. this.stream = data.stream;
  20. this.peerjid = data.peerjid;
  21. this.ssrc = ssrc;
  22. this.session = connection.jingle.sessions[sid];
  23. this.type = (this.stream.getVideoTracks().length > 0)
  24. ? MediaStream.VIDEO_TYPE : MediaStream.AUDIO_TYPE;
  25. this.muted = false;
  26. }
  27. return MediaStreamProto;
  28. })();
  29. MediaStream.VIDEO_TYPE = 'Video';
  30. MediaStream.AUDIO_TYPE = 'Audio';