Packs local media streams. Participants can publish it to a session. Initialized with OpenVidu.initPublisher method

### Hierarchy

- Publisher

### Implements

- EventDispatcher

## Index

### Properties

- accessAllowed
- element
- id
- session
- stream

### Methods

- off
- on
- once
- publishAudio
- publishVideo
- subscribeToRemote

## Properties

### accessAllowed

accessAllowed: boolean = false

- Defined in OpenVidu/Publisher.ts:38

Whether the Publisher has been granted access to the requested input devices or not

### element

element: HTMLElement

- Defined in OpenVidu/Publisher.ts:43

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

### id

id: string

- Defined in OpenVidu/Publisher.ts:48

DOM id of the Publisher's video element

### session

session: Session

- Defined in OpenVidu/Publisher.ts:53

The Session to which the Publisher belongs

### stream

stream: Stream

- Defined in OpenVidu/Publisher.ts:58

The Stream that you are publishing

## Methods

### off

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

- - Defined in OpenVidu/Publisher.ts:275

  See EventDispatcher.off

  #### Parameters

  - ##### type: string

  - ##### Optional handler: function

    - - (event: StreamEvent | VideoElementEvent): void

      - #### Parameters

        - ##### event: StreamEvent | VideoElementEvent

        #### Returns void

  #### Returns Publisher

### on

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

- - Defined in OpenVidu/Publisher.ts:125

  See EventDispatcher.on

  #### Parameters

  - ##### type: string

  - ##### handler: function

    - - (event: StreamEvent | VideoElementEvent): void

      - #### Parameters

        - ##### event: StreamEvent | VideoElementEvent

        #### Returns void

  #### Returns EventDispatcher

### once

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

- - Defined in OpenVidu/Publisher.ts:200

  See EventDispatcher.once

  #### Parameters

  - ##### type: string

  - ##### handler: function

    - - (event: StreamEvent | VideoElementEvent): void

      - #### Parameters

        - ##### event: StreamEvent | VideoElementEvent

        #### Returns void

  #### Returns Publisher

### publishAudio

- publishAudio(value: boolean): void

- - Defined in OpenVidu/Publisher.ts:100

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

  #### Parameters

  - ##### value: boolean

    `true` to publish the audio stream, `false` to unpublish it

  #### Returns void

### publishVideo

- publishVideo(value: boolean): void

- - Defined in OpenVidu/Publisher.ts:109

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

  #### Parameters

  - ##### value: boolean

    `true` to publish the video stream, `false` to unpublish it

  #### Returns void

### subscribeToRemote

- subscribeToRemote(): void

- - Defined in OpenVidu/Publisher.ts:117

  Call this method before Session.publish to subscribe to your Publisher's stream as any other user would do. The local video will be automatically replaced by the remote video

  #### Returns void

Generated using TypeDoc