You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

media_stream.js 990B

123456789101112131415161718192021222324252627282930
  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.VIDEO_TYPE = "Video";
  20. this.AUDIO_TYPE = "Audio";
  21. this.stream = data.stream;
  22. this.peerjid = data.peerjid;
  23. this.ssrc = ssrc;
  24. this.session = connection.jingle.sessions[sid];
  25. this.type = (this.stream.getVideoTracks().length > 0)
  26. ? this.VIDEO_TYPE : this.AUDIO_TYPE;
  27. }
  28. return MediaStreamProto;
  29. })();