Class Stream

    • Method Detail

      • getStreamId

        public java.lang.String getStreamId()
        Gets a unique identifier for this stream.
        Returns:
        A unique identifier for this stream.
      • getCreationTime

        public java.util.Date getCreationTime()
        Returns the time when this stream first joined the OpenTok session.
      • hasVideo

        public boolean hasVideo()
        Whether this stream has video (true) or not (false).
        Returns:
        true or false, indicating if the stream has video or not.
      • hasAudio

        public boolean hasAudio()
        Whether this stream has audio (true) or not (false).
        Returns:
        true or false, indicating if the stream has audio or not.
      • hasCaptions

        public boolean hasCaptions()
        Whether this stream has captions (true) or not (false).
        Returns:
        true or false, indicating if the stream has captions or not.
      • getConnection

        public Connection getConnection()
        Returns the Connection object corresponding to this Stream.

        Compare the Connection object returned by the getConnection() method with the Connection object returned by Sesssion.getConnection() to see if the new stream is published by your client.

        Returns:
        The Connection object corresponding to this Stream.
        See Also:
        Session.getConnection()
      • getVideoWidth

        public int getVideoWidth()
        The width of the stream, in pixels.

        For streams published using the scalable video feature, this is set to the width of the maximum resolution available for the stream. For more information on scalable video, see the documentation for the OpenTok Media Router.

        Returns:
        The width, in pixels.
      • getVideoHeight

        public int getVideoHeight()
        The height of the stream, in pixels.

        For streams published using the scalable video feature, this is set to the height of the maximum resolution available for the stream. For more information on scalable video, see the documentation for the OpenTok Media Router.

        Returns:
        The height, in pixels.
      • getSession

        @Deprecated
        public Session getSession()
        Deprecated.
        Starting in version 2.17.0, this method will return null. The SDK does not save the relation between a given stream and the session in which it was created.
        Returns:
        null
      • getStreamVideoType

        public Stream.StreamVideoType getStreamVideoType()
        Returns:
        Specifies the type of video for this stream. This is set one of the following values:

        • StreamVideoType.StreamVideoTypeScreen — The stream's video encoding is optimized for screen sharing.
        • StreamVideoType.StreamVideoTypeCamera — The stream is not optimized for screen sharing (for example, it uses a camera as the video source).
        • StreamVideoType.StreamVideoTypeCustom — The custom stream video type applies only to Web generated streams.
        See Also:
        PublisherKit.setPublisherVideoType(PublisherKit.PublisherKitVideoType type)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(java.lang.Object o)
        Specified by:
        compareTo in interface java.lang.Comparable