Learn about the changes in TVSDK between DHLS versions 1.4 and 2.3.

Related documents:

Namespace changes

Namespaces have changed in the TVSDK 2.3 APIs.

All classes in the TVSDK 2.3 API begin with the com.adobe.tvsdk.mediacore namespace, and the classes in the TVSDK 1.4 APIs started with the com.adobe.mediacore namespace. You need to search your code and replace the com.adobe.mediacore string with the com.adobe.tvsdk.mediacore string.

The namespaces ensure that there are no conflicts between TVSDK 1.4 and TVSDK 2.3 APIs, and that the TVSDK 1.4 APIs will continue to work with TVSDK 2.3.

Changes in the TimeRange object

There is a minor change in the TimeRange constructor. In version 2.3, the second parameter has changed from the range end to the range duration value.

If you use the TimeRange object, although your code might compile, if TimeRange usage is not repaired at the application level, an ad workflow malfunction might occur.

Here are the specific changes to the TimeRange object in version 2.3: 

Version 1.4 Version 2.3
  1. TimeRange(begin:Number,

  2. end:Number)

  1. TimeRange(start:Number,

  2. duration:Number)

Differences between empty objects and exceptions

In older TVSDK releases, you could perform a conditional test by using an object's length attribute. Starting in version 2.3, this syntax is no longer valid

The TVSDK module now reports accessing timelineItems as an error, and an exception is thrown.

Here is an example of a conditional test that uses an object's length attribute:

  1. if(mediaPlayer.timeline.timelineItems.length == 0) { }

 

In the following example, the exception that relates to the timlineItems getter must be caught and interpreted as a zero length timelineItems array: 

var timelineItemsLength:int = 0;
try {
    timelineItemsLength = mediaPlayer.timeline.timelineItems.length;
}
catch (e:Error) {
    // We expect "timelineItems" to fault when it is empty.
}
if(timelineItemsLength == 0){ }

Changes in DRM

In version 2.3, the majority of the changes are in the DRM layer. 

Table 1. Changes between versions 1.4 and 2.3

Version 1.4 Version 2.3
  DRMAuthenticationMethod
DRMContentData

DRMMetadata

DRMContentData.domain and DRMContentData.authenticationMethod have been removed and can be queried from DRMPolicy.

DRMContentData.getVoucherAccessInfo DRMMetadata.policies
DRMDeviceGroup DRMLicenseDomain

VoucherAccessInfo

DRMPolicy
VoucherAccessInfo.policyID is no longer available.  
VoucherAccessInfo.deviceGroup DRMPolicy.licenseDomain
DRMVoucher DRMLicense
DRMVoucher.offlineLeaseStartDate DRMLicense.offlineStorageStartDate
DRMVoucher.offlineLeaseEndDate DRMLicense.offlineStorageEndDate
DRMVoucher.voucherStartData DRMLicense.licenseStartDate
DRMVoucher.voucherEndDate DRMLicense.licenseEndDate
DRMVoucher.policies DRMLicense.customProperties
DRMPlaybackTimeWindow.startDate DRMPlaybackTimeWindow.playbackStartDate
DRMPlaybackTimeWindow.endDate DRMPlaybackTimeWindow.playbackEndDate
DRMPlaybackTimeWindow.period DRMPlaybackTimeWindow.playbackPeriodInSeconds
DRMManager.loadVoucher DRMManager.acquireLicense

Tip: The last parameter that was added is a listener.

DRMManager.loadPreviewVoucher DRMManager.acquirePreviewLicense

Tip: The last parameter that was added is a listener.

DRMManager.addToDeviceGroup DRMManager.joinLicenseDomain

Tip: The last parameter that was added is a listener.

DRMManager.removeFromDeviceGroup DRMManager.leaveLicenseDomain

Tip: The first parameter changes from a URL to a metadata, and the last parameter that was added is a listener.

DRMManager.resetDRMVoucher

DRMManager.resetDRM

Tip: Last parameter added is a listener.

DRMManager::returnVoucher

DRMManager::returnLicense

Tip: The sequence of parameters has changed, and last parameter that was added is a listener.

DRMManager::storeVoucher

DRMManager::storeLicenseBytes

Tip: The last parameter that was added is a listener.

  DRMManager::setMaxOperationTime
DRMDeviceGroupEvent DRMLicenseDomainEvent
DRMDeviceGroupErrorEvent DRMLicenseDomainErrorEvent

New exceptions

Exceptions are sometimes being thrown where in older releases, a NULL ActionScript object was returned.

One method where this happens is Metadata.getByteArray, but exceptions might be thrown on any method in the TVSDK API. 

Note:

The nature of how version 2.3 reports errors is different from how version 1.4 reports errors. In version 2.3, there are more exceptions thrown, but fewer NULL values are returned. 

Changes in event handling

In version 2.3, all event types are in the PSDKEventType class and are also in the event classes. 

Note:

The syntax from older TVSDK releases will work, but there were some changes. 

All event types are now in the PSDKEventType class and in the event classes. This means that the event types have a new form and the original form. You can use the valid original form or the new form: 

Version 1.4 (still valid) Version 2.3
  1. player.addEventListener(

  2. BufferEvent.BUFFERING_BEGIN,

  3. onBufferingBegin)

  1. player.addEventListener(

  2. PSDKEventType.BUFFERING_BEGIN,

  3. onBufferingBegin)

Changes in constants

In TVSDK 2.3, many constants have changed type from String to int.

For example:

  • MediaResourceType
  • ABRControlParameters
  • MediaPlayerStatusChangeEvent

If your application depends on these constants, you might have to update the application and resolve compiler errors. 

Changes in the notifyClick method

The notifyClick method is now part of MediaPlayer and not MediaPlayerView.

Here are the changes: 

Version 1.4 Version 2.3
_view.notifyClick _player.notifyClick

Changes in closed captioning

Closed captioning APIs have changed in version 2.3.

Here are the changes:

  • ClosedCaptionStylesBuilder has been renamed TextFormat.
    • All occurrences of ClosedCaptionStylesBuilder must be replaced with TextFormat.
    • The method toClosedCaptionStyles has been removed from the TextFormat class.
  • ClosedCaptionStyles has been removed.
    • You must delete occurrences that relate to ClosedCaptionStyles, because the styles it contained are now also in the TextFormat class.
    • The public static arrays that are provided by the ClosedCaptionStyles class must now be coded and localized in the application.

      For more information about to implement this change, see the new application level ClosedCaptionStyles class in ReferenceImplementation

Changes in the default PSDK classes

Classes that were previously prefaced with Default, such as DefaultMediaPlayer, DefaultNetworkConfig, DefaultContentFactory, and so on, have changed.

Here are the changes: 

Version 1.4 Version 2.3
  1. var mp:DefaultMediaPlayer =

  2. new DefaultMediaPlayer();

  1. var mp:MediaPlayer =

  2. new MediaPlayer(PSDK.pSDK.createDispatcher());

The usage of MediaPlayer and DefaultMediaPlayer is identical. The same applies to all classes that use the Default naming convention.

Some classes, such as ContentFactory, are pure interfaces with no publicly available default implementation such as DefaultContentFactory. Sometimes, the TVSDK provides a default implementation by using the convenience function PSDK.pSDK.createDefaultContentFactory: 

Version 1.4 Version 2.3
Did not exist in version 1.4.
  1. var c:ContentFactory =

  2. PSDK.pSDK.createDefaultContentFactory();

Tip: As you can see from the example above, you can call constructors directly with the exception of ContentFactory. 

Version 1.4 Version 2.3
  1. import com.adobe.mediacore.

  2. metadata.DefaultMetadataKeys;

  1. import com.adobe.mediacore.

  2. metadata.MetadataKeys;

Version 1.4 Version 2.3
DefaultMetadataKeys MetadataKeys

Changes in the IllegalStateException class

The IllegalStateException class has been removed from version 2.3. If your application uses this class, you can replace it with the Error class.

For example: 

Version 1.4 Version 2.3
  1. if (_authInProgress) {

  2. throw new IllegalStateException(

  3. "Authentication already in progress.");

  4. }

  1. if (_authInProgress) {

  2. throw new Error(

  3. "Authentication already in progress.");

  4. }

Error events

In TVSDK 2.3, the MediaError class has been replaced with the Notification class. The only difference in these classes is that the Notification does not contain a description attribute.

Here are the changes: 

Version 1.4
  1. private function generateErrorMessage(error:MediaError):String {

  2. var errorMsg:String = "";

  3. (error.code) ? errorMsg += "\nError code: #" + error.code : null;

  4. (error.description) ? errorMsg +=

  5. "\nDescription: " + error.description : null;

  6. (error.innerNotification) ? errorMsg +=

  7. "\nInner Notification: " + error.innerNotification : null;

  8. if (error.metadata) {

  9. var metadata:Metadata = error.metadata;

  10. (metadata.getValue("runtimeCode")) ? errorMsg +=

  11. "\nRuntime Error Code: #" + metadata.getValue("runtimeCode") : null;

  12. (metadata.getValue("runtimeCodeMessage")) ? errorMsg +=

  13. "\nRuntime Error Message: " +

  14. metadata.getValue("runtimeCodeMessage") : null;

  15. (metadata.getValue("resourceUrl")) ? errorMsg +=

  16. "\nResource URL: " + metadata.getValue("resourceUrl") : null;

  17. (metadata.getValue("description")) ? errorMsg +=

  18. "\nDescription: " + metadata.getValue("description") : null;

  19. }

  20. return errorMsg;

  21. }

Version 2.3
  1. private function generateErrorMessage(error:Notification):String {

  2. var errorMsg:String = "";

  3. if (!error)

  4. return null;

  5. var metadata:Metadata = error.metadata;

  6. (metadata.getValue("NATIVE_ERROR_CODE")) ? errorMsg +=

  7. "\nAVE Error code: #" + metadata.getValue("NATIVE_ERROR_CODE") : null;

  8. (metadata.getValue("PSDK_ERROR_CODE")) ? errorMsg +=

  9. "\nPSDK Error code: #" + metadata.getValue("PSDK_ERROR_CODE") : null;

  10. (metadata.getValue("PSDK_ERROR")) ? errorMsg +=

  11. "\nPSDK Error: " + metadata.getValue("PSDK_ERROR") : null;

  12. (metadata.getValue("DESCRIPTION")) ? errorMsg +=

  13. "\nDescription: " + metadata.getValue("DESCRIPTION") : null;

  14. (metadata.getValue("INNER_NOTIFICATION")) ? errorMsg +=

  15. "\nInner Notification: " +

  16. metadata.getValue("INNER_NOTIFICATION") : null;

  17. return errorMsg;

Changes to the media player

In older TVSDK releases, the constructor of the default implementation of the MediaPlayer interface (DefaultMediaPlayer) accepted a MediaPlayerContext object by parameter. In version 2.3, the MediaPlayer's constructor now takes a PSDKEventDispatcher object. 

Version 1.4 Version 2.3
  1. _player =

  2. new DefaultMediaPlayer(context);

  1. _player =

  2. new MediaPlayer(PSDK.pSDK.createDispatcher());

Changes in the ContentFactory

In previous TVSDK releases, the ContentFactory and its default implementation (DefaultContentFactory) were part of the public API and also were non-final classes. This allowed the application implementation to select which methods to customize, such as retrieveOpportunityGenerators, retrieveResolvers, and so on.

The public API in version 2.3 uses pure interfaces which makes the ContentFactory a pure interface. This means that customising it requires full implementation. However, if a null value is returned, the TVSDK will use the default implementation.

In version 2.3, to only override the retrieveAdPolicySelector, do the following: 

  1. public function retrieveResolvers(item:com.adobe.mediacore.MediaPlayerItem):

  2. Vector.<com.adobe.mediacore.timeline.resolvers.ContentResolver> {

  3. return null;

  4. }

  5.  

  6. public function retrieveOpportunityGenerators(item:com.adobe.mediacore.MediaPlayerItem):

  7. Vector.<com.adobe.mediacore.timeline.generators.OpportunityGenerator> {

  8. return null;

  9. }

  10.  

  11. public function retrieveAdPolicySelector(item:com.adobe.mediacore.MediaPlayerItem):

  12. com.adobe.mediacore.timeline.advertising.policy.AdPolicySelector {

  13. // Provide custom implementation here

  14. }

  15.  

  16. public function retrieveCustomAdPlaybackHandlers(item:com.adobe.mediacore.MediaPlayerItem):

  17. Vector.<com.adobe.mediacore.CustomAdHandler> {

  18. return null;

Changes in the syntax of the ABRControlParameters constructor

Minor changes have been made to the syntax of the ABRControlParameters constructor.

In older TVSDK releases, the parameters were passed to the constructor of the ABRControlParameters class.

Here are the changes in version 2.3: 

Version 1.4 Version 2.3
  1. ABRControlParameters(policy:String,

  2. initialBitRate:int,

  3. minBitRate:int,

  4. maxBitRate:int)

 

 

  1. ABRControlParameters(nInitialBitRate:uint = 0,

  2. nMinBitRate:uint = 0,

  3. nMaxBitRate:uint = 2147483647,

  4. eABRPolicy:int = 1,

  5. nMinTrickPlayBitRate:uint = 0,

  6. nMaxTrickPlayBitRate:uint = 2147483647,

  7. nMaxTrickPlayBandwidthUsage:uint = 2147483647,

  8. dMaxPlayoutRate:Number = 1.0)

Note:

In TVSDK 1.4, it was necessary to construct an ABRControlParameters object with all possible arguments. In version 2.3, you can construct the object by omitting all arguments and use the mutators to set the required values on the object. 

Removed classes

Some classes have been removed from TVSDK 2.3 and have no equivalents.

The following classes have been removed:

  • TimeRangeCollection
  • PSDKConfig

Utility classes

The utility classes have been moved to a separate binary.

The following classes are no longer present in TVSDK 2.3 directly:

  • StringUtils
  • NumberUtils
  • BaseLogger
  • DefaultLogger
  • Log
  • LogFactory
  • NullLogger

This code is now available from the ReferencePlayer Implementation project by using the utils.swc. 

VideoAnalytics

VideoAnalytics 1.5 is available by using an ActionScript binary (.swc). Version 1.5 is located in the deps/ directory in ReferenceImplementation. 

Note:

Both the analytics.swc and the utils.swc are required to use analytics. 

Changes in the ad-related classes

Here are the changes in the ad-related classes in version 2.3: 

Ad.as

The constructor has changed in the following way:

Version 1.4 Version 2.3
  1. public function Ad(id:String,

  2. type:String,

  3. duration:uint,

  4. primaryAsset:AdAsset,

  5. companionAssets:Vector.<AdAsset>,

  6. tracker:ContentTracker = null)

 

 

  1. public function Ad(id: String,

  2. adType: int,

  3. duration: Number,

  4. isCustomAdMarker: Boolean,

  5. primaryAsset: AdAsset,

  6. companionAssets: Vector.<AdBannerAsset>,

  7. tracker: ContentTracker,

  8. adInsertionType: int,

  9. isClickable: Boolean,

  10. isCustomAd: Boolean)

The following methods have been added:

  • public final native function get isCustomAd(): Boolean;
  • public final native function get tracker(): ContentTracker;
  • public final native function get isClickable(): Boolean;
  • public final native function get isVPAIDAd(): Boolean;

AdBreak.as

The following method has changed: 

Version 1.4 Version 2.3
public function get type():String public final native function get insertionType(): int;

The following methods were removed:

  • public static function create(ads:Vector.<Ad>, tracker:ContentTracker = null, type:String = null):AdBreak
  • public static function get allowCustomAds():Boolean

AdBreakTimeline.as

Here is the change: 

Version 1.4 Version 2.3
  1. AdBreakTimelineItem extends TimelineItem

 

 

  1. public class AdBreakTimelineItem

  2. extends TimelineItem implements TimelineMarker

AdBreakWatchedPolicy.as

The public static function isPolicySupported(policy:String):Boolean method has been removed. 

AdPolicy.as

The public static const kAPSkipAdBreak:int = 4; member variables has been added.

AdPolicyInfo.as

The following methods have changed: 

Version 1.4 Version 2.3
public function get seekIntoAd():AdTimelineItem public final native function get adTimelineItem(): AdTimelineItem;
public function get desiredSeekPosition():Number public final native function get seekToTime(): Number;

The following methods have been removed:

  • public static function createPlayPolicy(adBreakTimelineItem:AdBreakTimelineItem, currentTime:Number):AdPolicyInfo
  • public static function createTrickPlayPolicy(adBreakTimelineItem:AdBreakTimelineItem, currentTime:Number):AdPolicyInfo
  • public static function createSeekPolicy(adBreakTimelineItems:Vector.<AdBreakTimelineItem>, seekIntoAd:AdTimelineItem, currentTime:Number, desiredSeekPosition:Number):AdPolicyInfo

AdSignalingMode.as

The following changes have been made:

  • public static const kASMCustomRanges:int member has been added.
  • public static function isModeSupported(mode:String):Boolean member has been removed. 

AdvertisingMetadata.as

The following methods have been added:

  • public native function get hasLivePreroll(): Boolean;
  • public native function set livePreroll(value: Boolean): void;

The following methods have been removed:

  • public final function get adSignalingMode():String
  • public final function set adSignalingMode(value:String):void 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy