Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with Session.subscribe method

### Hierarchy

- Subscriber

### Implements

- EventDispatcher

## Index

### Properties

- element
- id
- stream

### Methods

- off
- on
- once
- subscribeToAudio
- subscribeToVideo

## Properties

### element

element: HTMLElement

- Defined in OpenVidu/Subscriber.ts:33

HTML DOM element in which the Subscriber's video has been inserted

### id

id: string

- Defined in OpenVidu/Subscriber.ts:38

DOM id of the Subscriber's video element

### stream

stream: Stream

- Defined in OpenVidu/Subscriber.ts:43

The Stream to which you are subscribing

## Methods

### off

- off(type: string, handler?: function): Subscriber

- - Defined in OpenVidu/Subscriber.ts:178

  See EventDispatcher.off

  #### Parameters

  - ##### type: string

  - ##### Optional handler: function

    - - (event: VideoElementEvent): void

      - #### Parameters

        - ##### event: VideoElementEvent

        #### Returns void

  #### Returns Subscriber

### on

- on(type: string, handler: function): EventDispatcher

- - Defined in OpenVidu/Subscriber.ts:94

  See EventDispatcher.on

  #### Parameters

  - ##### type: string

  - ##### handler: function

    - - (event: VideoElementEvent): void

      - #### Parameters

        - ##### event: VideoElementEvent

        #### Returns void

  #### Returns EventDispatcher

### once

- once(type: string, handler: function): Subscriber

- - Defined in OpenVidu/Subscriber.ts:136

  See EventDispatcher.once

  #### Parameters

  - ##### type: string

  - ##### handler: function

    - - (event: VideoElementEvent): void

      - #### Parameters

        - ##### event: VideoElementEvent

        #### Returns void

  #### Returns Subscriber

### subscribeToAudio

- subscribeToAudio(value: boolean): Subscriber

- - Defined in OpenVidu/Subscriber.ts:74

  Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect

  #### Parameters

  - ##### value: boolean

    `true` to subscribe to the audio stream, `false` to unsubscribe from it

  #### Returns Subscriber

### subscribeToVideo

- subscribeToVideo(value: boolean): Subscriber

- - Defined in OpenVidu/Subscriber.ts:84

  Subscribe or unsubscribe from the video stream (if available). Calling this method twice in a row passing same value will have no effect

  #### Parameters

  - ##### value: boolean

    `true` to subscribe to the video stream, `false` to unsubscribe from it

  #### Returns Subscriber

Generated using TypeDoc