Millicast Unity SDK
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Properties | Events | List of all members
Dolby.Millicast.McPublisher Class Reference

The Millicast publisher. This class allows its users to publish audio and video media to the Millicast service. More...

Inheritance diagram for Dolby.Millicast.McPublisher:

Public Member Functions

delegate void DelegatePublisher (McPublisher publisher)
 
delegate void DelegateOnViewerCount (McPublisher publisher, int count)
 
delegate void DelegateOnLayerEvent (McPublisher publisher, SimulcastInfo info)
 
delegate void DelegateOnConnectionError (McPublisher publisher, string message)
 
void SetVideoSource (Camera source, StreamSize resolution=null)
 Set the video source for capture. Call with null as the source to remove the currently set video source.
 
void SetVideoSource (RenderTexture source)
 Set the video source for capture. Call with null as the source to remove the currently set video source.
 
void SetAudioSource (AudioSource source)
 Set the audio source to be captured when publishing. This will replace any previously set AudioSource through SetAudioSource
 
void SetAudioListenerAsSource ()
 Set the current AudioListener in the scene as an audio input to publishing. Resets previously set AudioSource through SetAudioSource. Throws an Exception if the game object does not contain an AudioListener.
 
void SetVideoConfig (VideoConfig config, bool simulcast=false)
 Update video configuration. Can be called while publishing; config will be applied in real-time even while publishing.

Parameters
configVideo Configuration.

 
void SetSimulcastData (SimulcastLayers layersinfo)
 Update simulcast layer's encoding parameter values. Can be called while publishing; Values will be applied in real-time even while publishing.

Parameters
layersinfoSimulcastLayers.

 
void Publish ()
 Publish a stream.
 
void UnPublish ()
 UnPublish a stream.
 
void AddVideoRenderTarget (Material material)
 Add a material to display the local video stream on. The material's main texture will be replaced with the local video stream texture. Using this to replace a GUI component's material will not work. Use the RawImage overload instead.

 
void RemoveVideoRenderTarget (Material material)
 Stop rendering the local stream on the previously given material.
 
void RemoveVideoRenderTarget (RawImage image)
 Stop rendering the local stream on the previously given RawImage.
 
void AddVideoRenderTarget (RawImage image)
 Add a UI RawImage to display the local video stream on. The RawImage's texture will be replaced with the local video stream texture when it is available. Use this when you want to use render the remote stream in a GUI.
 
void AddRenderAudioSource (AudioSource source)
 Add an audio source that will render the local audio stream.
 
void RemoveRenderAudioSource (AudioSource source)
 Remove an audio source so that it stops rendering the local stream.
 

Protected Member Functions

VideoStreamTrack CreateRenderTextureStreamTrack (RenderTexture targetTexture)
 

Properties

bool isPublishing = false [get]
 A boolean to reflect if the publisher is currently publishing.
 
string streamName [get, set]
 The stream name to publish to.
 
Credentials credentials = null [get, set]
 
VideoConfiguration videoConfigData [get]
 
string sourceid [get, set]
 The stream name to publish to.
 
PublisherOptions options [get, set]
 You have to set the publisher options before Publish is called.
 

Events

DelegatePublisher OnPublishing
 Event called when the publisher is publishing (i.e. media content is being delivered to the Millicast service.)
 
DelegateOnViewerCount OnViewerCount
 Event called when the viewer count has been updated.
 
DelegateOnLayerEvent OnSimulcastlayerInfo
 Event called when the Simulcast Layers data event triggered.
 
DelegateOnConnectionError OnConnectionError
 Event called when the there is a connection error to the service.
 

Detailed Description

The Millicast publisher. This class allows its users to publish audio and video media to the Millicast service.

Member Function Documentation

◆ AddRenderAudioSource()

void Dolby.Millicast.McPublisher.AddRenderAudioSource ( AudioSource  source)

Add an audio source that will render the local audio stream.

Parameters
sourceA Unity AudioSource instance.

◆ AddVideoRenderTarget() [1/2]

void Dolby.Millicast.McPublisher.AddVideoRenderTarget ( Material  material)

Add a material to display the local video stream on. The material's main texture will be replaced with the local video stream texture. Using this to replace a GUI component's material will not work. Use the RawImage overload instead.

Parameters
materialA Unity Material.

◆ AddVideoRenderTarget() [2/2]

void Dolby.Millicast.McPublisher.AddVideoRenderTarget ( RawImage  image)

Add a UI RawImage to display the local video stream on. The RawImage's texture will be replaced with the local video stream texture when it is available. Use this when you want to use render the remote stream in a GUI.

Parameters
imageA Unity RawImage.

◆ RemoveRenderAudioSource()

void Dolby.Millicast.McPublisher.RemoveRenderAudioSource ( AudioSource  source)

Remove an audio source so that it stops rendering the local stream.

Parameters
sourceA previously added Unity AudioSource instance.

◆ RemoveVideoRenderTarget() [1/2]

void Dolby.Millicast.McPublisher.RemoveVideoRenderTarget ( Material  material)

Stop rendering the local stream on the previously given material.

Parameters
materialA Unity Material.

◆ RemoveVideoRenderTarget() [2/2]

void Dolby.Millicast.McPublisher.RemoveVideoRenderTarget ( RawImage  image)

Stop rendering the local stream on the previously given RawImage.

Parameters
imageA Unity RawImage.

◆ SetAudioSource()

void Dolby.Millicast.McPublisher.SetAudioSource ( AudioSource  source)

Set the audio source to be captured when publishing. This will replace any previously set AudioSource through SetAudioSource

Parameters
sourceA Unity AudioSource instance

◆ SetVideoSource() [1/2]

void Dolby.Millicast.McPublisher.SetVideoSource ( Camera  source,
StreamSize  resolution = null 
)

Set the video source for capture. Call with null as the source to remove the currently set video source.

Parameters
sourceThe camera source to capture from
resolutionThe capturing resolution

◆ SetVideoSource() [2/2]

void Dolby.Millicast.McPublisher.SetVideoSource ( RenderTexture  source)

Set the video source for capture. Call with null as the source to remove the currently set video source.

Parameters
sourceThe Target Render Texture source to capture from
resolutionThe capturing resolution

The documentation for this class was generated from the following file: