pureweb.client. EncoderConfiguration

The EncoderConfiguration class is used to define the encoding format (mime type) and quality for each view in the application. It provides two EncoderFormat objects: one for full quality mode, and one for interactive quality mode.

The purpose of the view interactivity modes is to make it possible to send images of lower quality when the end user is interacting with a view, and to restore full quality when interaction stops. This way, the size of the view updates during interaction can be smaller, which provides a better trade-off between frame rate when interacting, and image quality when not interacting. The interactivity mode is set on the service using the SetViewInteracting method in the ViewManager class.

To set an EncoderConfiguration object as the default configuration for a view, use the setEncoderConfiguration method provided by the View class.

Method Summary

getFullQualityFormat
Returns the EncoderFormat object that defines the parameters (mime type, quality, etc.
getInteractiveFormat
Returns the EncoderFormat object that defines the parameters (mime type, quality, etc.
isEncoderSupported
Returns a Boolean value that indicates whether the supplied encoder configuration is supported in the browser.
optimize
Takes the default encoder configuration provided by the service application, and returns an EncoderConfiguration instance optimized from the default settings.

Constructor

new EncoderConfiguration(interactiveQuality, fullQuality)

Initializes a new instance of EncoderConfiguration.
Parameters:
Name Type Description
interactiveQuality pureweb.client.EncoderFormat The encoder format for the interactive quality.
fullQuality pureweb.client.EncoderFormat The encoder format for the full (non-interactive) quality.
Throws:
pureweb.NullArgumentException

Extends

  • pureweb.events.EventTarget

Members

<static> DEFAULT_SPEC_ENCODER_CONFIGURATION

Default encoder configuration to be used when one is not set by the client application.

<static> MINIMUM_SPEC_ENCODER_CONFIGURATION

Default, minimum-specification encoder configuration to be used when no default has been provided by the service application.

Method Detail

getFullQualityFormat() → {pureweb.client.EncoderFormat}

Returns the EncoderFormat object that defines the parameters (mime type, quality, etc.) to be used by the service application when sending images in full quality (non-interactive) mode.

getInteractiveFormat() → {pureweb.client.EncoderFormat}

Returns the EncoderFormat object that defines the parameters (mime type, quality, etc.) to be used by the service application when sending images in interactive mode.

<static> isEncoderSupported(encoderConfig) → {boolean}

Returns a Boolean value that indicates whether the supplied encoder configuration is supported in the browser. This provides an easy way to see if H.264 is supported by the browser configuration.
Parameters:
Name Type Description
encoderConfig pureweb.client.EncoderConfiguration The encoder configuration for which to test support.

<static> optimize(defaultConfig, ua) → {pureweb.client.EncoderConfiguration}

Takes the default encoder configuration provided by the service application, and returns an EncoderConfiguration instance optimized from the default settings.

This method is useful to accommodate differences in supported features between browsers. For example, some browsers do not support WebGL, or this support may have been disabled. Also, H.264 decoding may be too slow in some mobile browsers running on an iOS operating system, even if the browser supports the underlying technology. This method optimizes the encoder configuration as follows:
  • On non-mobile browsers that support H.264 and WebGL, it uses the default configuration provided by the service.
  • On non-mobile browsers where H.264 and WebGL is disabled, it uses image/jpeg as the mime type.
  • On Android 5 or greater, it uses the default configuration provided by the service.
  • On Android versions earlier than 5, it uses image/jpeg as the mime type.
  • On iOS, if the default provided by the service is H.264, it uses image/jpeg as the mime type instead.
Parameters:
Name Type Argument Description
defaultConfig pureweb.client.EncoderConfiguration <optional>
The default encoder configuration provided from the service.
ua string <optional>
The user agent.