Class MediaTrack

java.lang.Object
com.codename1.webrtc.MediaTrack

public final class MediaTrack extends Object

One stream of audio or video: the local camera or microphone, or what arrives from the other side.

A muted track keeps flowing as silence or black frames, so unmuting is instant and the other side's connection never notices.

  • Field Details

  • Method Details

    • getKind

      public String getKind()
    • isVideo

      public boolean isVideo()
    • isLocal

      public boolean isLocal()
      Whether this is this device's own camera or microphone.
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
      Mutes (false) or unmutes (true) the track.
    • switchCamera

      public void switchCamera()
      Switches a local video track between the front and back cameras. Does nothing for any other track.
    • release

      public void release()
      Stops the camera or microphone behind a local track. A track cannot be restarted; open new media instead. Remote tracks end with their connection, so this does nothing for them.