Many method signatures and API element names have changed for 2.0. Review these tables to see all API change details.

Advertising workflow API element changes for 2.0

These tables compare the advertising workflow API elements for the C++ Browser TVSDK between versions 1.3 and 2.0.

Tables in this topic:

  • TimedMetadata
  • AdSignalingMode
  • AdvertisingMetadata
  • CustomRangeMetadata/CustomRangeType
  • ReplaceTimeRange
  • Placement / PlacementType
  • Opportunity
  • Reservation
  • Timeline / TimelineItem / TimelineMarker
  • ContentTracker
  • AdBreak
  • Ad / AdType / AdAsset / AdClick /AdBannerAsset
  • AdBreakTimelineItem / AdTimelineItem
  • AdBreakPolicy / AdBreakWatchedPolicy / AdPolicy / AdPolicyMode / AdPolicyInfo / AdPolicySelector
  • OpportunityGenerator / OpportunityGeneratorClient
  • ContentResolver / ContentResolverClient
  • TimelineOperation
  • AdBreakPlacement
  • DeleteRangeTimelineOperation
  • AuditudeSettings
  • CustomAdHandler / CustomAdHandlerClient

TimedMetadata

2.0 API 1.3 API
TimedMetadata

class TimedMetadata : :  
         public PSDKRefCountBase, public IUserData {
public:
    TimedMetadataType getType() 
    const;TimeMS getTime() const;
    const PSDKString& getId() 
    const;const PSDKString& getName() const;

    const PSDKString& getContent() const;

    PSDKErrorCode getMetadata( 
         const Metadata* & out)  
         const;
    int32_t compareTo(
          const TimedMetadata* timedMetadata) const; const;
    
   bool equals(const TimedMetadata *other)
    const;


};

class TimedMetadata
          {
public:
    const TimedMetadata::Type getType();
    const TIMEMS64 getTime();
    const uint32_t getId();
    const PSDKReturnString getName();


    
PSDKErrorCode getMetadata(
         PSDKSharedPointer<Metadata>& out);
    int32_t compareTo(
         const PSDKSharedPointer<TimedMetadata>& timedMetadata);



    const int32_t getMetadataHashcode();
};

TimedMetadataType

(No change for 2.0)

enum TimedMetadataType {
        kTMTTag = 0,
        kTMTID3 = 1
    };

AdSignalingMode

2.0 API 1.3 API
AdSignalingMode

enum AdSignalingMode {
    kASMDefault = 0,
    kASMManifestCues = 1,
    kASMServerMap 2,
    kASMCustomRanges = 3
};

New in 2.0; replaces 
MetadataKeys::MANIFEST_CUES key

AdvertisingMetadata

2.0 API 1.3 API
AdvertisingMetadata

class AdvertisingMetadata: 
     public Metadata {
public:
    AdSignalingMode getAdSignalingMode() const;
    PSDKErrorCode setAdSignalingMode(
       AdSignalingMode mode);

    AdBreakWatchedPolicy getAdBreakAsWatched();
    PSDKErrorCode setAdBreakAsWatched(
         AdBreakWatchedPolicy policy);

   bool hasLivePreroll() const;
   psdkutils::PSDKErrorCode setLivePreroll(
       bool value);

   bool hasDelayAdLoading() const;
   psdkutils::PSDKErrorCode setDelayAdLoading(
      bool value);
};

New in 2.0; 
replaces  MetadataKeys::ADVERTISING_METADATA key

CustomRangeMetadata/CustomRangeType

2.0 API 1.3 API
CustomRangeMetadata  

class CustomRangeMetadata : public 
psdkutils::PSDKInterfaceWithUserData  {
   public:
        CustomRangeType getType() const ;
        PSDKErrorCode setType(CustomRangeType 
            value);
        bool getAdjustSeekPosition() const;
        PSDKErrorCode setAdjustSeekPosition(
            bool value);
        
         PSDKErrorCode getTimeRangeList
        (psdkutils::PSDKImmutableValueArray
           <ReplaceTimeRange>*& out) 
         const;

        PSDKErrorCode setTimeRangeList
       (psdkutils::PSDKImmutableValueArray
           <ReplaceTimeRange>* value);
};

New in 2.0

CustomRangeType  

enum  CustomRangeType {
        kCRTMarkRange = 1,
        kCRTDeleteRange= 2,
        kCRTReplaceRange = 3
};

New in 2.0

ReplaceTimeRange

2.0 API 1.3 API
ReplaceTimeRange  

class ReplaceTimeRange : public 
        TimeRange {
    public:
   psdkutils::TimeMS getReplaceDuration() const;
   ReplaceTimeRange(TimeMS begin, TimeMS 
       duration, TimeMS replaceDuration);
   ReplaceTimeRange();
   explicitReplaceTimeRange(const 
       ReplaceTimeRange &range);
};

New in 2.0

Placement / PlacementType

2.0 API 1.3 API
Placement

class Placement {
public:
    static const TimeMS 
         UNKNOWN_DURATION;
    PlacementType getType() const; 
    TimeMS getTime() const;
    TimeMS getDuration() const;

    PlacementMode getMode() const; 
    PSDKErrorCode getRange(
                  TimeRange& out) const;

    int32_t compareTo(
         const Placement& otherPlacement) 
             const;
    Placement(PlacementType type = kPTPreRoll, 
         TimeMS time = UNKNOWN_DURATION, 
         TimeMS duration = UNKNOWN_DURATION, 
         PlacementMode mode = kPMDefault);
};

class Placement  {
public:
    static const TIMEMS64 UNKNOWN_DURATION;
    PlacementType getType() const; 
    TIMEMS64 getTime();
    TIMEMS64 getDuration() 

   

    
   int32_t compareTo(
         const Placement& otherPlacement);
    Placement(PlacementType type = kPTPreRoll, 
         TimeMS64 time = UNKNOWN_DURATION, 
         TIMEMS64 duration = UNKNOWN_DURATION);

};

Placement::PlacementType

enum PlacementType {
   kPTPreRoll,
   kPTMidRoll,
   kPTPostRoll,
   kPTServerMap,
   kPTCustomRange,
};

enum PlacementType {
   kPTPreRoll,
   kPTMidRoll,
   kPTPostRoll,
   kPTServerMap

};

Placement:: PlacementMode

enum PlacementMode {
    kPMDefault,
    kPMInsert,
    kPMReplace,
    kPMDelete,
    kPMMark,
    kPMFreeReplace
};

New in 2.0

Opportunity

2.0 API 1.3 API
Opportunity

class Opportunity {
public:    
    const PSDKString& getId() const; 
    PSDKErrorCode getPlacement(
         Placement &placement) const; 

    PSDKErrorCode getSettings(
         const Metadata* & out) const;
    PSDKErrorCode getCustomParameters(
         const Metadata* & out) const;    

   Opportunity(const PSDKString& id, 
         const Placement &placement, 
          const Metadata* settings, 
         const Metadata* customParams);
};

class Opportunity {
public:    
    PSDKString getId(); 
    Placement getPlacement();


    PSDKErrorCode getSettings(
         PSDKSharedPointer<Metadata>& out);
    PSDKErrorCode getCustomParameters(
         PSDKSharedPointer<Metadata>& out);
    
Opportunity(PSDKString id, 
         Placement placement, 
         const PSDKSharedPointer<Metadata>& settings, 
         const PSDKSharedPointer<Metadata>& customParams);
};

Reservation

2.0 API 1.3 API
Reservation

class Reservation: public psdkutils::IUserData {
public:
    PSDKErrorCode getRange(TimeRange &out) const;
    TimeMS getHol () const;
private:
     Reservation(const TimeRange &range);
};

New in 2.0

Timeline / TimelineItem / TimelineMarker

2.0 API 1.3 API
Timeline

class Timeline: 
         public PSDKInterface {
public:     
    virtual PSDKErrorCode getTimelineMarkers(
         PSDKImmutableRefArray<TimelineMarker> 
         *&out) = 0;

virtual PSDKErrorCode getTimelineItems(
         PSDKImmutableRefArray<AdTimelineItem> *&out) = 0; 
    virtual TimeMS convertToLocalTime(TimeMS time) const = 0; 
    virtual TimeMS convertToVirtualTime(TimeMS time) const = 0; 
    virtual bool checkIfPositionIsReserved(
        psdkutils::TimeMS position)  const = 0;   


    virtual ~Timeline() {}
};

class Timeline : 
         public CanHaveUserData {
public:
    virtual PSDKErrorCode getTimelineMarkers(
         PSDKPtrImmutableArray<TimelineMarker>::type& 
         out) = 0; 









   virtual ~Timeline() {}
};

TimelineItem

class TimelineItem : 
         public TimelineMarker {
public:

template <typename T>  static int sortFunc(
         T * const &entry1, T * const &entry2); 
public:  




    int32_t getId() const;   
    virtual TimeMS getTime() const;
   virtual TimeMS getDuration();
        PSDKErrorCode getVirtualRange(TimeRange& out)
const;
    PSDKErrorCode getLocalRange(TimeRange& out) const;
    bool isWatched() const;
    bool isTemporary() const;

protected:
   PSDKErrorCode updateLocalRange(
         const TimeRange& localRange);
   PSDKErrorCode updateVirtualRange(
         const TimeRange& virtualRange);
   PSDKErrorCode setIsWatched(bool isWatched);

    virtual ~TimelineItem();
};

class TimelineItem : 
         public CanHaveUserData {
public:




    PSDKErrorCode getMediaResource(
         PSDKSharedPointer<MediaResource>& out);




         const TimeMS64 getDuration();














};

TimelineMarker

class TimelineMarker :   
         public psdkutils::PSDKInterfaceWithUserData {
public:
    virtual TimeMS getTime() const = 0;
    virtual TimeMS getDuration() const = 0;
    virtual ~TimelineMarker() {}
};

class TimelineMarker : 
         public CanHaveUserData {
public:
    virtual const TIMEMS64 getTime() = 0;
    virtual const TIMEMS64 getDuration() = 0;
    virtual ~TimelineMarker() {}
};

ContentTracker

2.0 API 1.3 API
ContentTracker

class ContentTracker : 
         public PSDKInterfaceWithUserData {
public:
    virtual void onAdStart(const Ad *ad) = 0;

    virtual void onAdComplete (const Ad *ad) = 0;

    virtual void onAdProgress (const Ad *ad, 
        float percent)() = 0;

    virtual void onAdClick (constAd *ad) = 0;


    virtual void onAdBreakStart (const AdBreak *
         adBreak = 0;
    virtual void onAdBreakComplete (const Adbreak *
        adBreak) = 0;

    virtual ~ContentTracker() {}
};

class ContentTracker : 
         public psdkutils::PSDKInterface {
public:
    virtual void onAdStart(
         const PSDKSharedPointer<Ad> &ad) = 0;
    virtual void onAdComplete(
         const PSDKSharedPointer<Ad> &ad) = 0;
    virtual void onAdProgress(
         const PSDKSharedPointer<Ad> &ad, float percent) = 0;

    virtual void onAdClick(
         const PSDKSharedPointer<Ad> &ad) = 0;

    virtual void onAdBreakStart(
         const PSDKSharedPointer<AdBreak>& adBreak) = 0;
    virtual void onAdBreakComplete(
         const PSDKSharedPointer<AdBreak>& adBreak) = 0; 

    virtual ~ContentTracker() {}
};

AdBreak

2.0 API 1.3 API
AdBreak

class AdBreak : 
         public psdkutils::PSDKRefCountBase, 
         public psdkutils::IUserData {
public:
    TimeMS getDuration() const;
    PSDKErrorCode getAds(
         PSDKPtrImmutableArray<Ad>*& out) 
        const;

    PSDKErrorCode getTracker(
         const ContentTracker*& out) const;




   AdInsertionType getInsertionType() const;












    ~AdBreak() {}
};

class AdBreak : 
         public TimelineMarker{

public:
    const TIMEMS64 getDuration();
    PSDKErrorCode getAds(
         PSDKPtrImmutableArray<Ad>::type& out);




    const TIMEMS64 getTime();
    const TIMEMS64 getReplaceDuration();
    const PSDKReturnString getData();

    AdInsertionType getInsertionType();

   int32_t getRestoreId();
    void setRestoreId(int32_t restoreId);
    bool isWatched();
    void setIsWatched(bool watched);

    PSDKErrorCode cloneFor(Placement placement, 
         PSDKSharedPointer<AdBreak>& out);
    int compareTo(
         const PSDKSharedPointer<AdBreak>& adBreak);
    bool equals(const PSDKSharedPointer<AdBreak>& adBreak);

    ~AdBreak() {}
};

Ad / AdType / AdAsset / AdBannerAsset / AdClick

2.0 API 1.3 API
Ad

class Ad {
public:
    PSDKErrorCode getPrimaryAsset(
         AdAsset& out) const;
    PSDKErrorCode getCompanionAssets(
         PSDKImmutableValueArray<AdBannerAsset> * &out) const; 

    TimeMS getDuration() const;
    const PSDKString& getId() const; 
    AdType getAdType() const;
    bool isCustomAdMarker () const;
    AdInsertionType getAdInsertionType() const;

    PSDKErrorCode getTracker(
         const ContentTracker* &out)  const;

    bool isClickable() const;

    bool equals(const Ad* ad) const;
    virtual ~Ad()    
};

class Ad {
public:
    PSDKErrorCode getPrimaryAsset(
         PSDKSharedPointer<AdAsset>& out);
    PSDKErrorCode getCompanionAssets(
         PSDKPtrImmutableArray<AdAsset>::type &out);

    const TIMEMS64 getDuration();
    const int32_t getId();
    const AdType getAdType();
    const bool getIsCustomAdMarker();
    const AdInsertionType getAdInsertionType();

    PSDKErrorCode getTracker(
         PSDKSharedPointer<ContentTracker> &out);



    bool equals(const PSDKSharedPointer<Ad>& ad);
    virtual ~Ad()    
};

AdType

enum AdType {
    kATLinear,
    kATNonLinear
};

enum AdType {
    kAdType_Linear,
    kAdType_NonLinear
};

AdAsset

class AdAsset {
public:
    const PSDKString& getId() const;
    TimeMS getDuration() const;
    PSDKErrorCode getResource(
           MediaResource& out) const;
    PSDKErrorCode getAdClick(AdClick& out) const;
    PSDKErrorCode getMetadata(Metadata*& out) const;

    bool isValid () const;
};

class AdAsset {
public:
    PSDKReturnString getId() const;
    TIMEMS64 getDuration() const;
    PSDKSharedPointer<MediaResource> getResource() const;
    PSDKSharedPointer<AdClick> getAdClick() const;
    PSDKSharedPointer<Metadata> getMetadata() const;



};

AdBannerAsset

class AdBannerAsset : public AdAsset {
public: 
   uint32_t getWidth() const;
   uint32_t getHeight() const;
   const PSDKString getResourceType() const;
   const PSDKString& getStaticUrl() const;
   const PSDKString& getBannerData() const;

   AdBannerAsset(const PSDKString &id, TimeMS duration, 
         const MediaResource &resource const PSDKString 
         &staticUrl, 
         const AdClick &adClick, uint32_t width,
         uint32_t height, const PSDKString &resourceType, 
         const Metadata *metadata)
}

New in 2.0

AdClick

class AdClick {
public:
    const PSDKString& getId() const;
    const PSDKString& getTitle() const;
    const PSDKString& getUrl() const;

    AdClick(const PSDKString &id, const PSDKString &title, 
         const PSDKString &url);
};

class AdClick {
public:
    const PSDKString& getId() const;
    const PSDKString& getTitle();
    const PSDKString& getUrl() const;

    AdClick(const PSDKString &id, const PSDKString &title, 
         const PSDKString &url);
};

AdBreakTimelineItem / AdTimelineItem

2.0 API 1.3 API
AdBreakTimelineItem

class AdBreakTimelineItem : public TimelineItem {
{
public:
    PSDKErrorCode getAdBreak(const AdBreak*& out) const;
    PSDKErrorCode getItems(
         PSDKImmutableRefArray<AdTimelineItem> *&out) const;

    AdBreakTimelineItem(int32_t id, 
         PSDKImmutableRefArray<AdTimelineItem>* items);
};

New in 2.0

AdTimelineItem

class AdTimelineItem : public TimelineItem {
public:
    PSDKErrorCode getAdBreak( const AdBreak*& out) const;
    PSDKErrorCode getAd( const Ad*& out) const;

    AdTimelineItem(int32_t id, TimeRange virtualRange, 
         TimeRange localRange, const AdBreak* adBreak, 
         const Ad* ad);
};

New in 2.0

AdBreakPolicy / AdBreakWatchedPolicy / AdPolicy / AdPolicyMode / AdPolicyInfo / AdPolicySelector

2.0 API 1.3 API
AdBreakPolicy

enum AdBreakPolicy {
    kABPPlay = 0,
    kABPSkip,
    kABPRemove,
    kABPRemoveAfterPlay
};

enum AdBreakPolicy {
    kAdBreakPolicySkip,
    kAdBreakPolicyPlay,
    kAdBreakPolicyRemove,
    kAdBreakPolicyRemoveAfterPlay
};

AdBreakWatchedPolicy

enum AdBreakWatchedPolicy { 
    kABWPOnBegin,
    kABWPOnEnd,
    kABWPNever,
};

enum AdBreakAsWatched { 
    kAdBreakAsWatchedOnBegin,
    kAdBreakAsWatchedOnEnd,
    kAdBreakAsWatchedNever,
};

AdPolicy

enum AdPolicy {
    kAPPlay,
    kAPPlayFromAdBegin,
    kAPPlayFromAdBreakBegin,
    kAPSkipToNextAdInBreak,
    kAPSkipAdBreak
};

enum AdPolicy {
    kAdPolicyPlay,
    kAdPolicyPlayFromAdBegin,
    kAdPolicyPlayFromAdBreakBegin,
    kAdPolicySkipToNextAdInBreak,
    kAdPolicySkipAdBreak
};

AdPolicyMode

enum AdPolicyMode {
    kAPMPlay,
    kAPMSeek,
    kAPMTrickPlay
};

enum AdPolicyMode {
    kAdPolicyModePlay,
    kAdPolicyModeSeek,
    kAdPolicyModeTrickPlay
};

AdPolicyInfo

class AdPolicyInfo {
public:   
    PSDKErrorCode getAdBreakTimelineItems(
         PSDKRefArray<AdBreakTimelineItem> *&out) const;





     PSDKErrorCode getAdTimelineItem
            (const AdTimelineItem *&out) const;




    TimeMS getCurrentTime() const;
    TimeMS getSeekToTime() const;
    float getRate() const;
    AdPolicyMode getMode() const;
};

class AdPolicyInfo {
public:




    PSDKPtrArray<AdBreakPlacement>::type 
         getAdBreakPlacements();




   PSDKSharedPointer<Ad> getAd();


    TIMEMS64 getCurrentTime();
    TIMEMS64 getSeekToTime() ;
    float getRate();
    AdPolicyMode getMode();
};

AdPolicySelector

class AdPolicyInfo : public PSDKInterface {
public:
    virtual AdBreakPolicy selectPolicyForAdBreak(
         const AdPolicyInfo & 
         adPolicyInfo) = 0;
    virtual PSDKErrorCode selectAdBreaksToPlay(
         const AdPolicyInfo & 
         adPolicyInfo), 
         PSDKRefArray<AdBreakTimelineItem> * &out) = 0;
    virtual AdPolicy selectPolicyForSeekIntoAd(
         const AdPolicyInfo &
         adPolicyInfo) = 0;
    virtual AdBreakWatchedPolicy 
         selectWatchedPolicyForAdBreak(
          const AdPolicyInfo& adPolicyInfo) = 0;
};

class AdPolicyInfo : public PSDKInterface {
public:
    virtual AdBreakPolicy selectPolicyForAdBreak(
         const PSDKSharedPointer<AdPolicyInfo>& 
         adPolicyInfo) = 0;
    virtual PSDKErrorCode selectAdBreaksToPlay(
         const PSDKSharedPointer<AdPolicyInfo>& 
         adPolicyInfo, 
         PSDKPtrArray<AdBreakPlacement>::type& out) = 0;
    virtual AdPolicy selectPolicyForSeekIntoAd(
         const PSDKSharedPointer<AdPolicyInfo>& 
         adPolicyInfo) = 0;
    virtual AdBreakAsWatched 
         selectWatchedPolicyForAdBreak(
         const PSDKSharedPointer<AdPolicyInfo>& adPolicyInfo) = 0;
};

OpportunityGenerator / OpportunityGeneratorClient

2.0 API 1.3 API
OpportunityGenerator

class OpportunityGenerator: 
         public PSDKInterface {
public:
     virtual PSDKErrorCode configure (
         const MediaPlayerItem* item, 
         OpportunityGeneratorClient* client, 
         AdSignalingMode mode, 
         TimeMS playhead, 
         const TimeRange &playbackRange) = 0;

    virtual PSDKErrorCode update (TimeMS playhead, 
         const TimeRange &playbackRange) = 0;



    virtual PSDKErrorCode cleanup() = 0;

    virtual ~OpportunityDetector() {}
};

class OpportunityDetector : public PSDKInterface {
public:
    virtual PSDKErrorCode config(
         const PSDKSharedPointer<MediaPlayerItem>& item, 


         TIMEMS64 initialPosition) = 0;


    virtual PSDKErrorCode process(
         PSDKPtrImmutableArray<TimedMetadata>::type
             timedMetadatas, 
         PSDKPtrImmutableArray<Opportunity>::type& out) = 0;

    virtual PSDKErrorCode cleanup() = 0;

    virtual ~OpportunityDetector() {}
};

OpportunityGeneratorClient

class OpportunityGeneratorClient: public 
         PSDKInterfaceWithUserData {
public:
    virtual PSDKErrorCode resolve(
         const Opportunity* opportunity) = 0;
    virtual PSDKErrorCode hold(
         const TimeRange& timeRange, Reservation *&out) = 0;
    virtual void cancel(const Reservation* reservation) = 0;

    virtual ~OpportunityGeneratorClient() {}
};

New in 2.0

ContentResolver / ContentResolverClient

2.0 API 1.3 API
ContentResolver

class ContentResolver : public PSDKInterface {
public:


    virtual PSDKErrorCode configure(
         const MediaPlayerItem* item , 
         ContentResolverClient* client) = 0;
    virtual bool canResolve(
          const Opportunity* opportunity) = 0;
    virtual PSDKErrorCode resolve(
         const Opportunity* opportunity) = 0;
    virtual PSDKErrorCode cleanup() = 0;

    virtual ~ContentResolver() {}
};

class ContentResolver : public PSDKEventDispatcherInterface {
public:

   virtual void config(
         const PSDKSharedPointer<MediaPlayerItem>& item

       )  = 0;
   virtual bool canResolve(
         const PSDKSharedPointer<Opportunity>& opportunity) = 0;
    virtual void resolve(
         const PSDKSharedPointer<Opportunity>& opportunity) = 0;
    virtual void cleanup() = 0;

    virtual ~ContentResolver() {}
};

ContentResolverClient

class ContentResolverClient : public PSDKInterface { 
public:
     virtual PSDKErrorCode process(
         PSDKImmutableRefArray<TimelineOperation> *operations) = 0;
     virtual PSDKErrorCode notifyCompleted(
         const Opportunity* opportunity) = 0;
     virtual PSDKErrorCode notifyFailed(
         const Opportunity* opportunity, const Notification* notification) = 0; 
     virtual ~ContentResolverListener () {} 
};

In 2.0, the following 1.3 events are now called in ContentResolverClient:

  • kEventResolvingCompleted (type ContentResolverEvent), dispatched when the content resolution has completed successfully.
  • kEventResolvingFailed (type ContentErrorEvent), dispatched when an error has occurred during resolving process. )

 

TimelineOperation

2.0 API 1.3 API
TimelineOperation

class TimelineOperation : public PSDKInterface {
public:
    virtual PSDKErrorCode getPlacement(
        Placement& out) = 0;

   static int sortFunc(TimelineOperation * const &op1, 
         TimelineOperation * const &op2);   

   virtual ~TimelineOperation () {}
};

class TimelineOperation : public PSDKInterface {
public:
    virtual Placement getPlacement() = 0;





    virtual ~TimelineOperation () {}
};

AdBreakPlacement

2.0 API 1.3 API
AdBreakPlacement

class AdBreakPlacement : public TimelineOperation, 
         {
public:
    psdkutils:: PSDKErrorCode getAdBreak(
         const AdBreak* & out) const;

     bool isValid () const;
     void setInvalid ();
     virtual psdkutils::TimeMS getTime () const;
     virtual psdkultils::TimeMS getDuration () const;

};

class AdBreakPlacement : public TimelineOperation, 
         public TimelineMarker {
public:
    PSDKErrorCode getAdBreak(
         PSDKSharedPointer<AdBreak>& out);





   void setPlacement(Placement placement);
};

DeleteRangeTimelineOperation

2.0 API 1.3 API
DeleteRangeTimelineOperation  

class DeleteRangeTimelineOperation :
public DeleteRangeTimelineOperation

{
public:

       PSDKErrorCode getPlacement(Placement*& out);
       void setPlacement(const Placement &placement);

};

class DeleteRange : public TimelineOperation{








{
};
}

AuditudeSettings

2.0 API 1.3 API
AuditudeSettings

class AuditudeSettings : public 
          AdvertisingMetadata 
{
public:
    const PSDKString& getZoneId() const;
    PSDKErrorCode setZoneId(const PSDKString &value);
    const PSDKString& getMediaId() const;
    PSDKErrorCode setMediaId(const PSDKString &value);
    const PSDKString& getDefaultMediaId() const;
    PSDKErrorCode setDefaultMediaId(const PSDKString &value);

    const PSDKString& getDomain() const;
    PSDKErrorCode setDomain(const PSDKString &value);
    PSDKErrorCode getTargetingInfo(
      const Metadata*& out);
    PSDKErrorCode setTargetingInfo(
      const Metadata* value);
    PSDKErrorCode getCustomParameters( 
      const Metadata*& out);
    
    PSDKErrorCode setCustomParameters(
      const Metadata* value);

    bool getCreativeRepackagingEnabled() const;
    void setCreativeRepackagingEnable(
       bool value);

    bool getShowStaticBanners () const;
    void setShowStaticBanners (bool value);
};

(replaces 
      MetadataKeys::AUDITUDE_METADATA_KEY key)

CustomAdHandler / CustomAdHandlerClient

2.0 API 1.3 API
CustomAdHandler

class CustomAdHandler : 
         public psdkutils::PSDKInterfaceWithUserData 
{
public:
   virtual psdkutils::PSDKErrorCode configure(
         MediaPlayerItem* item, 
         CustomAdHandlerClient* client) = 0;

   virtual psdkutils::PSDKErrorCode initAd(const Ad* ad) = 0;
   virtual psdkutils::PSDKErrorCode startAd(Ad* ad) = 0;
   virtual psdkutils::PSDKErrorCode pauseAd(Ad* ad) = 0;
   virtual psdkutils::PSDKErrorCode resumeAd(Ad* ad) = 0;
   virtual psdkutils::PSDKErrorCode stopAd(Ad* ad) = 0;
   virtual psdkutils::PSDKErrorCode dispose() = 0;
};

New in 2.0

CustomAdHandlerClient

CustomAdHandlerClient: 
         public psdkutils::PSDKInterfaceWithUserData 
{
public: 
   virtual psdkutils::PSDKErrorCode onAdBegin() = 0;
   virtual psdkutils::PSDKErrorCode onAdPaused() = 0;
   virtual psdkutils::PSDKErrorCode onAdResumed() = 0;
   virtual psdkutils::PSDKErrorCode onAdError() = 0;   
   virtual psdkutils::PSDKErrorCode onAdEnd() = 0;
};

New in 2.0

Customization API element changes for 2.0

These tables compare the customization API elements for the C++ Browser TVSDK between versions 1.3 and 2.0.

Tables in this topic:

  • MediaPlayerItemConfig
  • ContentFactory
  • NetworkConfiguration
  • Tag Decoders/DefaultSCTE35TagDecoder

MediaPlayerItemConfig

2.0 APIs 1.3 APIs

class MediaPlayerItemConfig : 
         public PSDKRefCountBase {
public:
            AdSignalingMode getAdSignalingMode() const;
                 PSDKErrorCode setSignalingMode
                  (AdSignalingMode mode); 

                 PSDKErrorCode getAdvertisingMetadata(
                AdvertisingMetadata *&out) const;
            PSDKErrorCode setAdvertisingMetadata(
                AdvertisingMetadata *data);

            PSDKErrorCode getAdvertisingFactory(
                ContentFactory*& out) const;
            PSDKErrorCode setAdvertisingFactory(
                      ContentFactory* actory);

            PSDKErrorCode getCustomRangeMetadata(
                CustomRangeMetadata*& out) const;
         PSDKErrorCode setCustomRangeMetadata(
                CustomRangeMetadata* data); 

            PSDKErrorCode getSubscribeTags (
                PSDKImmutableArray<PSDKString>*& out) const;
            PSDKErrorCode setSubscribeTags(
                PSDKImmutableArray <PSDKString> * tags);

            PSDKErrorCode getAdTags (PSDKImmutableArray
                      <PSDKsTRING> *& out) const; 
            PSDKErrorCode setAdTags (PSDKImmutableArray
                     <PSDKString>* tags);

           PSDKErrorCode getNetworkConfiguration
            (NetworkConfiguration & out) const;
            PSDKErrorCode setNetworkConfiguration(
                const NetworkConfiguration& params);

             bool getUseHardwareDecoder() const;

            PSDKErrorCode setUserHardwareDecoder(bool value)
   };

class MediaPlayerConfig : 
         public CanHaveUserData {
public:











             void setMediaPlayerClientFactory( 
                const PSDKSharedPointer<MediaPlayerClientFactory>& 
                clientFactory);
         






            void setSubscribedTags( 
                const PSDKPodArray<PSDKString>::type& subscribedtags);
         


             void setAdTags( 
                const PSDKPodArray<PSDKString>::type& adTags);









   };

ContentFactory

2.0 APIs 1.3 APIs

class ContentFactory: 
         public PSDKInterface {
public:



      virtual PSDKErrorCode retrieveResolvers(
           const MediaPlayerItem* item , 
          PSDKImmutableArray<PSDKSharedPointer 
                   <ContentResolver> >* & out) = 0;

      virtual PSDKErrorCode retrieveGenerators(
           const MediaPlayerItem* item , 
          PSDKImmutableArray < PSDKSharedPointer
            <OpportunityGenerator> >* & out) = 0;

      virtual PSDKErrorCode retrieveAdPolicySelector(
          const MediaPlayerItem* item, 
          AdPolicySelector*& out) = 0;

          virtual psdkutils::PSDKErrorCode retrieveCustomAd
                   PlaybackHandlers(const MediaPlayerItem *item,
                   psdkutils::PSDKImmutableRefArray<CustomAdHandler>
                   *&out) = 0;

  protected:
      virtual ~ContentFactory() {} 
    };

class MediaPlayerClientFactory : 
         public PSDKInterface {
public: 
      virtual PSDKErrorCode retreiveTrackers(
          PSDKPtrImmutableArray<TrackerInterface>::type& out) = 0;

      virtual PSDKErrorCode retrieveResolvers(
          const PSDKSharedPointer<MediaPlayerItem>& item, 
          PSDKPtrImmutableArray
            <ContentResolver>::type& out) = 0;

      virtual PSDKErrorCode retrieveDetectors(
          const PSDKSharedPointer<MediaPlayerItem>& item, 
          PSDKPtrImmutableArray<OpportunityDetector>
         ::type& out) = 0;

      virtual PSDKErrorCode retrieveAdPolicySelector(
          const PSDKSharedPointer<MediaPlayerItem>& item, 
          PSDKSharedPointer<AdPolicySelector>& out) = 0;
         
        





  
    };

NetworkConfiguration

2.0 APIs 1.3 APIs

class NetworkConfiguration {
public: 
            bool getForceNativeNetworking() const;
            PSDKErrorCode setForceNativeNetworking(
                bool value);

            bool getUseRedirectedUrl() const;
            PSDKErrorCode setUseRedirectedUrl(
                bool value);

            PSDKErrorCode getCookieHeaders(
                const Metadata*& out);
            PSDKErrorCode setCookieHeaders(
                const Metadata* metadata);

            bool getReadSetCookieHeader() const;
            PSDKErrorCode setReadSetCookieHeader(
                bool value);

            int getMasterUpdateInterval() const;
            PSDKErrorCode setMasterUpdateInterval(
                int minutes)

            bool getUseCookieHeaderForAllReqeusts() 
             const;
            PSDKErrorCode setUseCookieHeaderForAllReqeusts(
                bool value);

            int getReadLimit() const;
            PSDKErrorCode setReadLimit(
                int numFragment); 
    };

New in 2.0; however, some of this functionality was achieved in 1.3 using MetadataKeys.)

Tag Decoders

2.0 APIs 1.3 APIs
TagDecoder

class TagDecoder : public PSDKInterface {
public:     
            virtual PSDKErrorCode process(
                const PSDKString& content, Metadata*& out) = 0;

        protected:
            virtual ~TagDecoder();
    };

New in 2.0
SCTE35TagDecoder

class SCTE35TagDecoder : 
         public TagDecoder {
    };

New in 2.0

DRM API element changes for 2.0

These tables compare the DRM API elements for the C++ Browser TVSDK between versions 1.3 and 2.0.

Tables in this topic:

  • DRM Workflow Initialization
  • DRMAcquireLicenseSettings / DRMAuthenticationMethod
  • DRMMetadata
  • DRMPlaybackTimeWindow
  • DRMLicense
  • DRMLicenseDomain
  • DRMPolicy
  • DRMManager

DRM Workflow Initialization

2.0 APIs 1.3 APIs
Application needs to call psdk::initiateDRMWorkflow to initiate the DRM workflow. Without this call, DRM videos will not play. Initialization was done internally and no explicit call was required.

DRMAcquireLicenseSettings / DRMAuthenticationMethod

2.0 APIs 1.3 APIs
DRMAcquireLicenseSettings
No change for 2.0

enum DRMAcquireLicenseSettings {
        kDRMLicenseForceRefresh,
        kDRMLicenseLocalOnly,
        kDRMLicenseAllowServer,
    };

DRMAuthenticationMethod
No change for 2.0

enum DRMAuthenticationMethod {
    kDRMAMUnknown,
    kDRMAMAnonymous,
    kDRMAMUserNameAndPassword
};

DRMMetadata

2.0 APIs 1.3 APIs

class DRMMetadata {
public:
            const PSDKString& getServerUrl ();

            const PSDKString& getLicenseId();

            PSDKErrorCode getPolicies(
                PSDKImmutableArray<DRMPolicy> 
                *& out);

            ~DRMMetadata()
    };

class DRMMetadata {
public:
            const PSDKReturnString getServerURL ();

            const PSDKReturnString getLicenseId();

            PSDKErrorCode getPolicies(
                PSDKPtrImmutableArray<DRMPolicy>::type& out);

            ~DRMMetadata()
    };

DRMPlaybackTimeWindow

2.0 APIs 1.3 APIs

class DRMPlaybackTimeWindow
{
public:
    int32_t getPlaybackPeriodInSeconds() const; 
    uint64_t getPlaybackStartDate() const;
    uint64_t getPlaybackEndDate() const;
    DRMPlaybackTimeWindow(int32_t periodInSeconds, 
         uint64_t startDate, uint64_t endDate);
    DRMPlaybackTimeWindow();
};

class DRMPlaybackTimeWindow
{
public:
    const int32_t getPlaybackPeriodInSeconds(); 
    const uint64_t getPlaybackStartDate();
    const uint64_t getPlaybackEndDate();
    DRMPlaybackTimeWindow(int32_t periodInSeconds, 
         uint64_t startDate, uint64_t endDate);
    DRMPlaybackTimeWindow();
};

DRMLicense

2.0 APIs 1.3 APIs

class DRMLicense{  
public:  
    PSDKErrorCode getCustomProperties(
         const PSDKHashTable<PSDKString>,
          PSDKByteArray* & retVal const);

    uint64_t getLicenseStartDate() const;
    uint64_t getLicenseEndDate() const;

    uint64_t getOfflineStorageEndDate() const;
    uint64_t getOfflineStorageStartDate() const;

    const PSDKString& getserverUrl () const;
    const PSDKString & getLicenseID() const;
    const PSDKString & getPolicyID() const; 
   

    PSDKErrorCode getPlaybackTimeWindow(
         DRMPlaybackTimeWindow& out) const;

    PSDKErrorCode toBytes(
         PSDKImmutableByteArray*& retVal) const;
};

class DRMLicense{  
public:  
    PSDKErrorCode getCustomProperties(
         PSDKSharedPointer<PSDKHashTable<PSDKString, 
         PSDKArray<uint8_t> > > &retVal);

    const uint64_t getLicenseStartDate();
    const uint64_t getLicenseEndDate();

    const uint64_t getOfflineStorageEndDate();
    const uint64_t getOfflineStorageStartDate();

    const PSDKReturnString getServerURL ();
    const PSDKReturnString  getLicenseID();
    const PSDKReturnString  getPolicyID();

    PSDKErrorCode getPlaybackTimeWindow(
         DRMPlaybackTimeWindow& out);

    PSDKErrorCode toBytes(
         PSDKPodArray<uint8_t>::type &retVal);
};  

DRMLicenseDomain

2.0 APIs 1.3 APIs

class DRMLicenseDomain{
public:
    const PSDKString& getAuthenticationDomain();
         const;
    DRMAuthenticationMethod 
         getAuthenticationMethod() const;
    const PSDKString& getServerUrl() 
    const;
};

class DRMLicenseDomain{
public:
    const PSDKReturnString getAuthenticationDomain();

    const DRMAuthenticationMethod 
         getAuthenticationMethod();
    const PSDKReturnString getServerURL();
};

DRMPolicy

2.0 APIs 1.3 APIs

class DRMPolicy{ 
public:
    const PSDKString& getAuthenticationDomain() 
       const; DRMAuthenticationMethod 
         getAuthenticationMethod() const;
    const PSDKString& getDisplayName() const;
    PSDKErrorCode getLicenseDomain(
         DRMLicenseDomain & out) const; 
};

class DRMPolicy{ 
public:
    const PSDKReturnString getAuthenticationDomain();
    const DRMAuthenticationMethod 
         getAuthenticationMethod();
    const PSDKReturnString getDisplayName();
    PSDKErrorCode getLicenseDomain(
         PSDKSharedPointer<DRMLicenseDomain>& out); 
};

DRMManager

2.0 APIs 1.3 APIs

class DRMManager : public 
      PSDKEventTargetInterface { 
public:
            virtual PSDKErrorCode acquireLicense(
                 const DRMMetadata& 
                      metadata, 
                DRMAcquireLicenseSettings setting, 
                DRMAquireLicenseListener* listener) = 0;

            virtual PSDKErrorCode acquirePreviewLicense(
                 const DRMMetadata&   
                     metadata, 
                DRMAquireLicenseListener* listener) = 0;

            virtual PSDKErrorCode authenticate(
                 const DRMMetadata &  
                    metadata, 
                const PSDKString& url, 
                const PSDKString& authenticationDomain, 
                const PSDKString& user, 
                const PSDKString& password, 
                DRMAuthenticateListener* listener) = 0;

            virtual PSDKErrorCode createMetadataFromBytes(
                PSDKImmutableByteArray* bytes, 
                DRMMetadata& out, 
                DRMErrorListener* listener) = 0;

            virtual int32_t getMaxOperationTime() = 0;

            virtual PSDKErrorCode initialize(
                DRMOperationCompleteListener* listener) = 0;

            virtual PSDKErrorCode joinLicenseDomain(
                 const DRMLicenseDomain & 
                        licenseDomain, 
                bool forceRefresh, 
                DRMOperationCompleteListener* listener) = 0;

            virtual PSDKErrorCode leaveLicenseDomain(
                 const DRMLicenseDomain& licenseDomain, 
                  DRMOperationCompleteListener* listener) = 0;

            
            virtual PSDKErrorCode resetDRM(
                    DRMOperationCompleteListener* listener) = 0;

            virtual PSDKErrorCode returnLicense(
                const PSDKString& serverURL, 
                const PSDKString& licenseID, 
                const PSDKString& policyID, 
                bool commitImmediately, 
                DRMReturnLicenseListener* listener) = 0;

            virtual PSDKErrorCode setAuthenticationToken(
                const DRMMetadata & metadata, 
                const PSDKString& authenticationDomain, 
                PSDKImmutableByteArray* token ,  
                DRMOperationCompleteListener* listener) = 0;

            virtual PSDKErrorCode setMaxOperationTime(
                int32_t maxOperationTime) = 0;

            virtual PSDKErrorCode storeLicenseBytes(
                PSDKImmutableByteArray* licenseBytes, 
                DRMOperationCompleteListener* listener) = 0;

            virtual ~DRMManager() {}
    };

class DRMManager : public 
      PSDKEventDispatcherWithCtxInterface { 
public:
            virtual PSDKErrorCode acquireLicense(
                const PSDKSharedPointer<DRMMetadata>& 
                      contentData, 
                DRMAcquireLicenseSettings setting, 
                EventContext context) = 0;

            virtual PSDKErrorCode acquirePreviewLicense(
                const PSDKSharedPointer<DRMMetadata>& 
                     contentData, 
                EventContext context) = 0;

            virtual PSDKErrorCode authenticate(
                const PSDKSharedPointer<DRMMetadata>& 
                    metadata, 
                const PSDKString& url, 
                const PSDKString& authenticationDomain, 
                const PSDKString& user, 
                const PSDKString& password, 
                EventContext context) = 0;

            virtual PSDKErrorCode createMetadataFromBytes(
                const PSDKPodArray<uint8_t>::type &bytes, 
                PSDKSharedPointer<DRMMetadata>& out, 
                EventContext context) = 0;

            virtual int32_t getMaxOperationTime() = 0;

            virtual PSDKErrorCode initialize(
                EventContext eventContext) = 0;

            virtual PSDKErrorCode joinLicenseDomain(
                const PSDKSharedPointer<DRMLicenseDomain>& 
                      licenseDomain, 
                bool forceRefresh, 
                EventContext context) = 0;

            virtual PSDKErrorCode leaveLicenseDomain(
                const PSDKSharedPointer<DRMLicenseDomain>& 
                     licenseDomain, 
                EventContext context) = 0;

            virtual PSDKErrorCode resetDRM(
                EventContext context) = 0;

            virtual PSDKErrorCode returnLicense(
                const PSDKString& serverURL, 
                const PSDKString& licenseID, 
                const PSDKString& policyID, 
                bool commitImmediately, 
                EventContext context) = 0;

            virtual PSDKErrorCode setAuthenticationToken(
                const PSDKSharedPointer<DRMMetadata>& metadata, 
                const PSDKString& authenticationDomain, 
                const PSDKPodImmutableArray<uint8_t>::type &token,  
                EventContext context) = 0;

            virtual PSDKErrorCode setMaxOperationTime(
                int32_t maxOperationTime) = 0;

            virtual PSDKErrorCode storeLicenseBytes(
                const PSDKPodArray<uint8_t>::type &licenseBytes, 
                EventContext context) = 0;

            virtual ~DRMManager() {}
    };

Events supported by DRMManager

 

Version 2.0 uses listeners. All 1.3 
events are folded into the following listener:
DRMOperationCompleteListener

 

New event listener mechanism for 2.0 replaces 1.3 events as shown in the following rows.

DRMErrorListener

class DRMErrorListener : 
  public psdkutils::PSDKInterfaceWithUserData {
    public:
        virtual void onDRMError(
          uint32_t major, uint32_t minor, 
          const psdkutils:: PSDKString& errorString, 
          const psdkutils::PSDKString& errorServerUrl) = 0;
     
    protected:
        virtual ~DRMErrorListener() {}
}

Event Name / Triggering Event / Description
  • kEventDRMOperationError

    / DRMOperationErrorEvent

    When an error occurs during one of the asynchronous methods of DRMManger.

DRMOperationCompleteListener

class DRMOperationCompleteListener : 
  public DRMErrorListener {
    public:
        virtual void onDRMOperationComplete() = 0;
     
    protected:
        virtual ~DRMOperationCompleteListener() {}
};

Event Name / Triggering Event / Description
  • kEventDRMInitializationComplete

    / PSDKEvent

    When Initialization of DRM is complete.

  • kEventDRMJoinLicenseDomainComplete

    / PSDKEvent

    )

    When joinLicenseDomain() action completes successfully.

  • kEventDRMLeaveLicenseDomainComplete

    / PSDKEvent

    When leaveLicenseDomain() action completes successfully.

  • kEventDRMResetCompletePSDKEvent

    / PSDKEvent

    When resetDRM() action completes successfully.

  • kEventDRMAuthenticationTokenSet

    / PSDKEvent

    When setAuthenticationTokenSet() action completes successfully.

  • kEventDRMLicenseStored

    / PSDKEvent

    When storeLicenseBytes() action completes successfully.

DRMAuthenticateListener

class DRMAuthenticateListener : 
  public DRMErrorListener {
    public:
        virtual void onAuthenticationComplete(
          psdkutils::PSDKImmutableByteArray* 
          authenticationToken) = 0;
     
    protected:
        virtual ~DRMAuthenticateListener() {}
}

Event Name / Triggering Event / Description
  • kEventDRMAuthenticationComplete

    / DRMAuthenticationCompleteEvent

    When DRMManager::authenticate method call is successful.

DRMAquireLicenseListener

class DRMAquireLicenseListener : 
  public DRMErrorListener {
    public:
        virtual void onLicenseAcquired(
          const DRMLicense*) = 0;
     
    protected:
        virtual ~DRMAquireLicenseListener() {}
};

Event Name / Triggering Event / Description
  • kEventDRMPreviewLicenseAcquired

    / DRMLicenseAcquiredEvent

    When DRMManager::acquirePreviewLicense method call is successful.

  • kEventDRMLicenseAcquired

    / DRMLicenseAcquiredEvent

    When DRMManager::acquireLicense method call is successful.

DRMReturnLicenseListener

class DRMReturnLicenseListener : 
  public DRMErrorListener {
    public:
        virtual void onLicenseReturnComplete(
          uint32_t numReturned ) = 0;
     
    protected:
        virtual ~DRMReturnLicenseListener() {}
};

Event Name / Triggering Event / Description
  • kEventDRMLicenseReturnComplete

    / DRMLicenseReturnCompleteEvent

    When DRMManager::returnLicense method call is successful.

Generic playback API element changes for 2.0

These tables compare the generic playback API elements for the C++ Browser TVSDK between versions 1.3 and 2.0.

Tables in this topic:

  • MediaResource class
  • MediaPlayer class
  • ABRControlParameters and ABRControlParametersBuilder
  • BufferControlParameters and BufferControlParametersBuilder
  • TextFormat and TextFormatBuilder
  • MediaPlayerItemLoader

MediaResource class

2.0 API 1.3 API
MediaResource

class MediaResource {
public:
         const PSDKString& getUrl() const;
         MediaResourceType getType() const;
         PSDKErrorCode getMetadata(
                const Metadata* & out) const;

         bool equals(const MediaResource &resource) const;
         bool isValid () const;
         MediaResource(const psdkutils::PSDKString& url,
                MediaResourceType type, 
                const psdkutils::Metadata *metadata);
         MediaResource();
         explicit MediaResource(const MediaResource& other);

       ~MediaResource();
};

class MediaResource {
public:
      const PSDKReturnString getUrl();
      const PSDKReturnString getType();
      PSDKErrorCode getMetadata(
            PSDKSharedPointer<Metadata>& out) ;

    







      ~MediaResource();
};

MediaResourceIntent

enum MediaResourceIntent{
       kMRILinearPlayback = 1,
       kMRICustomLinearPlayback = 2,
       kMRINonLinearPlayback = 3,
       kMRIExternal = 4 
   };

New in 2.0

MediaResourceType

enum MediaResourceType { 
       kMRTHDS = 1, 
       kMRTHLS = 2,
       kMRTDASH = 3,
       kMRTCustom = 4, 
      kMRTUnknown = 5 
    };

New in 2.0

MediaPlayer class

2.0 API 1.3 API
MediaPlayer

class MediaPlayer : public PSDKEventDispatcherInterface {
public:


   virtual PSDKErrorCode prepareToPlay(
         TimeMS position
         =  LIVE_POINT) = 0;       

    virtual PSDKErrorCode prepareBuffer() = 0;

    virtual PSDKErrorCode play() = 0;   
    virtual PSDKErrorCode pause() = 0;   
    virtual PSDKErrorCode seek(TimeMS 
              position) = 0;   
    virtual PSDKErrorCode seekToLocal(
         TimeMS position) = 0;   
    virtual PSDKErrorCode reset() = 0;   
    virtual PSDKErrorCode release() = 0;   
    virtual PSDKErrorCode replaceCurrentResource(
          const MediaResource & mediaResource, 
         const MediaPlayerItemConfig* config = NULL) = 0;

    virtual void registerCurrentItemin 
                    Background(const MediaPlayer
                    ItemConfig *config) = 0;
    virtual void unregisterCurrent
                    BackgroundItem() = 0;  

    virtual PSDKErrorCode replace
             CurrentItem(const MediaPlayerItem* 
             mediaPlayerItem) = 0;   

    virtual PSDKErrorCode getPlaybackRange(
         TimeRange &range) const = 0;   
    virtual PSDKErrorCode getSeekableRange(
         TimeRange &range) const = 0;   
    virtual PSDKErrorCode getBufferedRange(
         TimeRange &range) const = 0;   
    virtual PSDKErrorCode getPlaybackMetrics(
         const PlaybackMetrics*& out) 
        const = 0;   

    virtual TimeMS getCurrentTime() 
      const = 0;
    virtual TimeMS getLocalTime() 
      const = 0;
    virtual PSDKErrorCode getCurrentItem(
      MediaPlayerItem* & out) 
      const = 0;

    virtual MediaPlayerStatus getStatus() const = 0;   
    virtual PSDKErrorCode getDRMManager(
         const DRMManager*& out) 
        const = 0;  
    virtual PSDKErrorCode getTimeline(
         const Timeline*& out) const = 0;   

    virtual PSDKErrorCode getView(
         const View* & out const)  = 0;   
    virtual PSDKErrorCode setView(
         View *view) = 0; 

    virtual float getVolume() const = 0;
    virtual PSDKErrorCode setVolume(
        float volume) = 0;

    virtual PSDKErrorCode getABRControlParameters(
         ABRControlParameters& out) const = 0;
    virtual PSDKErrorCode setABRControlParameters(
         const ABRControlParameters& params) = 0;
    virtual PSDKErrorCode getBufferControlParameters(
         BufferControlParameters& out) const = 0;
    virtual PSDKErrorCode setBufferControlParameters(
         const BufferControlParameters& params) = 0;

  virtual PSDKErrorCode setCCVisibility(
         Visibility visibility) = 0;
    virtual MediaPlayer::Visibility getCCVisibility() 
        const = 0;
    virtual PSDKErrorCode setCCStyle(
         const TextFormat& textFormat) = 0; 
    virtual PSDKErrorCode getCCStyle(
         TextFormat& out) const = 0; 

   virtual float  getRate() const = 0;
    virtual PSDKErrorCode setRate(float rate) = 0;





     virtual TimeMS getCurrentTime
               UpdateInterval() = 0;
               
            
     virtual PSDKErrorCode suspend() = 0;
     virtual PSDKErrorCode restore() = 0;

protected:
    virtual ~MediaPlayer() {}

public:
    static int32_t DEFAULT_VOLUME;

               // Following moved to ABRControlParameters:
                      // DEFAULT_ABR_INITIAL_BITRATE 
                      // DEFAULT_ABR_MIN_BITRATE  
                      // DEFAULT_ABR_MAX_BITRATE 
                      // ABRControlParameters::ABRPolicy 
                           DEFAULT_ABR_POLICY 

                // Following moved to BufferControlParameters:
                      // DEFAULT_INITIAL_BUFFER_TIME 
                      // DEFAULT_PLAY_BUFFER_TIME 

    static MediaPlayer::Visibility DEFAULT_CC_VISIBILITY
    static int32_t INVALID_STATE;
    static const TimeMS LIVE_POINT;
     static const TimeMS INVALID_TIME;
};

class MediaPlayer : public PSDKEventDispatcherInterface {
public:

    virtual PSDKErrorCode prepareToPlay() = 0;
    virtual PSDKErrorCode prepareToPlay(
         TIMEMS64 position) = 0;




    virtual PSDKErrorCode play() = 0;
    virtual PSDKErrorCode pause() = 0;
    virtual PSDKErrorCode seek(TIMEMS64 position) 
          = 0;
    virtual PSDKErrorCode seekToLocalTime(
         TIMEMS64 position) = 0;
    virtual PSDKErrorCode reset() = 0;
    virtual PSDKErrorCode release() = 0;
    virtual PSDKErrorCode replaceCurrentResource(
         const PSDKSharedPointer<MediaResource> 
         &mediaResource) = 0;











   virtual PSDKErrorCode getPlaybackRange(
         TimeRange &range) = 0;
    virtual PSDKErrorCode getSeekableRange(
         TimeRange &range) = 0;
    virtual PSDKErrorCode getBufferedRange(
         TimeRange &range) = 0;
    virtual PSDKErrorCode getPlaybackMetrics(
         PSDKSharedPointer<PlaybackMetrics> &metrics)
         = 0;

   virtual const TIMEMS64 getCurrentTime() = 0;

    virtual const TIMEMS64 getLocalTime() = 0;

    virtual PSDKErrorCode getCurrentItem(
         PSDKSharedPointer<MediaPlayerItem>& out) = 0;


    virtual MediaPlayerState getState() = 0; // 
    virtual  PSDKErrorCode getDRMManager(
         PSDKSharedPointer<DRMManager>& out) = 0;

    virtual PSDKErrorCode getTimeline(
         PSDKSharedPointer<Timeline>& out) = 0;

    virtual PSDKErrorCode getView(
         PSDKSharedPointer<View>& out) = 0;
    virtual PSDKErrorCode setView(
         const PSDKSharedPointer<View>& view) = 0;

    virtual int32_t getVolume() = 0;
    virtual PSDKErrorCode setVolume(int32_t volume) = 0;


    virtual PSDKErrorCode getABRControlParameters(
         ABRControlParameters& out) = 0;
    virtual PSDKErrorCode setABRControlParameters(
         const ABRControlParameters& params) = 0;
    virtual PSDKErrorCode getBufferControlParameters(
         BufferControlParameters& out) = 0;
    virtual PSDKErrorCode setBufferControlParameters(
         const BufferControlParameters& params) = 0;

   virtual PSDKErrorCode setCCVisibility(
         MediaPlayer::Visibility visibility) = 0;
    virtual MediaPlayer::Visibility getCCVisibility() = 0;

    virtual PSDKErrorCode setCCStyle(
         const PSDKSharedPointer<TextFormat> &textFormat) = 0;
    virtual PSDKErrorCode getCCStyle(
         PSDKSharedPointer<TextFormat> &textFormat) = 0;

virtual float getRate() = 0;
    virtual PSDKErrorCode setRate(float rate) = 0;

  virtual PSDKErrorCode getMediaPlayerConfig(
         PSDKSharedPointer<MediaPlayerConfig>& out) = 0;

    virtual PSDKErrorCode setMediaPlayerConfig(
         const PSDKSharedPointer<MediaPlayerConfig>& config) = 0;

  





   virtual ~MediaPlayer() {}

public:
    static int32_t DEFAULT_VOLUME;


static uint32_t DEFAULT_ABR_INITIAL_BITRATE;
    static uint32_t DEFAULT_ABR_MIN_BITRATE;
    static uint32_t DEFAULT_ABR_MAX_BITRATE;
    static ABRControlParameters::ABRPolicy 
                           DEFAULT_ABR_POLICY;


    static TIMEMS64 DEFAULT_INITIAL_BUFFER_TIME;
    static TIMEMS64 DEFAULT_PLAY_BUFFER_TIME;

   static MediaPlayer::Visibility DEFAULT_CC_VISIBILITY;
    static int32_t INVALID_STATE;
    static TIMEMS64 LIVE_POINT;

};

MediaPlayer::Visibility

(no change for 2.0)

class MediaPlayer {
       enum Visibility {
           kVisible = 0,
           kInvisible
       };
  };

MediaPlayerStatus

enum MediaPlayerStatus {

    kPSIdle = 0,
    kPSInitializing = 1,
    kPSInitialized = 2,
    kPSPreparing = 3,
    kPSPrepared = 4,
    kPSPlaying = 5,
    kPSPaused = 6,
    kPSSeeking = 7,
    kPSComplete = 8,
    kPSError = 9,
    kPSReleased = 10,

    kPSSuspended = 11
};

enum MediaPlayerState {

    kPSIdle = 0,
    kPSInitializing = 1,
    kPSInitialized = 2,
    kPSPreparing = 3,
    kPSPrepared = 4,
    kPSPlaying = 5,
    kPSPaused = 6,
    kPSSeeking = 7,
    kPSComplete = 8,
    kPSError = 9,
    kPSReleased = 10


};

MediaPlayer events

2.0 Event name 2.0 Interface   1.3 Event name 1.3 Interface
      kEventPrepared PSDKEvent

kEventItemUpdated

When a media player item is updated.

MediaPlayerItemEvent  

kEventUpdated

When the media player has successfully updated the media.

PSDKEvent
kEventTimedMetadataAvailable TimedMetadataEvent   kEventTimedMetadata TimedMetadataEvent
kEventTimelineUpdated PSDKEvent   kEventTimelineUpdated PSDKEvent
      kEventPlayStart PSDKEvent
      kEventPlayComplete PSDKEvent
kEventStatusChanged StatusEvent   kEventStateChanged StateEvent
kEventSizeAvailable SizeEvent   kEventSizeAvailable SizeEvent
kEventAdBreakStarted AdBreakEvent   kEventAdBreakStart AdBreakEvent
kEventAdStarted AdEvent   kEventAdStart AdEvent
kEventAdProgress AdProgressEvent   kEventAdProgress AdProgressEvent
kEventAdCompleted AdEvent   kEventAdComplete AdEvent
kEventAdBreakCompleted AdBreakEvent   kEventAdBreakComplete AdBreakEvent
kEventTimeChanged TimeEvent   kEventProgress ProgressEvent
kEventBufferingBegin PSDKEvent   kEventBuffer PSDKEvent
kEventBufferingEnd PSDKEvent   kEventBufferComplete PSDKEvent
kEventSeekBegin SeekEvent   kEventSeekStart PSDKEvent
kEventSeekEnd SeekEvent   kEventSeekComplete TimeEvent
kEventLoadInformationAvailable LoadInformationEvent   kEventLoadInfo LoadInfoEvent
kEventOperationFailed NotificationEvent   kEventOperationFailed ErrorEvent
kEventDRMMetadataInfoAvailable DRMMetadataEvent   kEventDRMMetadata DRMMetadataEvent
kEventReservationReached ReservationEvent   kEventTimelineHolderReached TimelineHolderEvent
      kEventBitrateChanged BitrateChangedEvent
kEventRateSelected PlaybackRateEvent   kEventRateSelected PlaybackRateEvent
kEventRatePlaying PlaybackRateEvent   kEventRatePlaying PlaybackRateEvent
kEventAdBreakSkipped AdBreakEvent   kEventAdBreakSkipped AdBreakEvent
kEventAdClicked

When user clicks on an Ad.

AdClickedEvent  

New in 2.0

 
kEventProfileChanged

When the playback profile changes.

ProfileEvent  

New in 2.0

 
kEventSeekPositionAdjusted

When seek position adjusts due to internal or external rules.

SeekEvent  

New in 2.0

 
kEventAudioUpdated

When a media player item is updated. For certain streams that contain audio tracks that are detectable only at playback time, this event is fired when new audio tracks are available.

MediaPlayerItemEvent  

New in 2.0

 
kEventCaptionsUpdated

When a media player item is updated. For live/linear streams, the client must periodically refresh the media resource to detect the new available content. When this happens, certain media characteristics might change.

MediaPlayerItemEvent  

New in 2.0

 
kEventMainManifestUpdated

When a media player item is updated. For live/linear streams, the client must periodically refresh the media resource to detect the new available content. When this happens, certain media characteristics might change.

MediaPlayerItemEvent  

New in 2.0

 
kEventItemCreated

When a new media player item is created.

MediaPlayerItemEvent  

New in 2.0

 
kEventBufferPrepared

Sent after prepareBuffer() is called, when the buffer is full.

PSDKEvent  

New in 2.0

 
kEventTimedEvent

Sent when timed events are generated.

TimedEvent  

New in 2.0

ABRControlParameters and ABRControlParametersBuilder

2.0 API 1.3 API
ABRControlParameters

struct ABRControlParameters {

   //Following moved here from MediaPlayer:
    static const uint32_t DEFAULT_ABR_INITIAL_BITRATE;
    static const uint32_t DEFAULT_ABR_MIN_BITRATE;
    static const uint32_t DEFAULT_ABR_MAX_BITRATE;
    static const ABRPolicy DEFAULT_ABR_POLICY;

    uint32_t initialBitRate;
    uint32_t minBitRate;
    uint32_t maxBitRate;
    ABRControlParameters::ABRPolicy abrPolicy;
    ABRControlParameters();
    ABRControlParameters(uint32_t nInitialBitRate, 
         uint32_t nMinBitRate,  uint32_t nMaxBitRate, 
         ABRPolicy eABRPolicy);

   explicit ABRControlParameters(
         const ABRControlParameters& other);

}

class ABRControlParameters {
public:






    const uint32_t getInitialBitRate() const;
    const uint32_t getMinBitRate() const;
    const uint32_t getMaxBitRate() const;
    ABRControlParameters::ABRPolicy getABRPolicy() const;
    ABRControlParameters();
    ABRControlParameters(uint32_t initialBitRate,
          uint32_t minBitRate, uint32_t maxBitRate, 
          ABRControlParameters::ABRPolicy abrPolicy);



    ~ABRControlParameters();
}

ABRControlParameters::ABRPolicy

No change for 2.0

struct ABRControlParameters {
    enum ABRPolicy    {
        kABRConservative = 0,
        kABRModerate = 1,
        kABRAggressive = 2
    };
};

BufferControlParameters and BufferControlParametersBuilder

2.0 API 1.3 API
BufferControlParameters

struct BufferControlParameters {
public:
  //Following moved here from MediaPlayer:
    static const TimeMS DEFAULT_INITIAL_BUFFER_TIME;
    static const TimeMS DEFAULT_PLAY_BUFFER_TIME;

    TimeMS initialBufferTime ; 
    TimeMS playBufferTime ; 
    BufferControlParameters(TimeMS initialBufferTime, 
          TimeMS playBufferTime);
    BufferControlParameters();

   explicit BufferControlParameters(
         const BufferControlParameters& other);
};

class BufferControlParameters {
public:




    const TIMEMS64 getInitialBufferTime() const;
    const TIMEMS64 getPlayBufferTime() const;
    BufferControlParameters(TIMEMS64 initialBufferTime, 
         TIMEMS64 playBufferTime);
    BufferControlParameters();



};

TextFormat and TextFormatBuilder

2.0 API 1.3 API
TextFormat

struct TextFormat :  {
public:
    static int32_t DEFAULT_OPACITY;
    TextFormat::Font font;
     TextFormat::Size  size;
     TextFormat::Color fontColor;
     TextFormat::FontEdge fontEdge;
     TextFormat::Color backgroundColor;
     TextFormat::Color fillColor;
     TextFormat::Color edgeColor;
     int32_t fontOpacity;
     int32_t  backgroundOpacity;
    int32_t  fillOpacity;
    TextFormat();

    TextFormat(Font eFont, Color eFontColor, 
              Color eEdgeColor, FontEdge eFontEdge, Color, 
              Color eBackgroundColor, Color eFillColor, 
              Color eEdgeColor, Size eSize, int32_t nFontOpacity, 
              int32_t nBackgroundOpacity, int32_t nFillOpacity);

    explicit TextFormat(const TextFormat& other);
};

class TextFormat : public psdkutils::CanHaveUserData {
public:
    static int32_t DEFAULT_OPACITY);    
    virtual const TextFormat::Font getFont() = 0;
    virtual const TextFormat::Size getSize() = 0;
    virtual const TextFormat::Color getFontColor() = 0;
    virtual const TextFormat::FontEdge getFontEdge() = 0;
    virtual const TextFormat::Color getBackgroundColor() = 0;
    virtual const TextFormat::Color getFillColor() = 0;
    virtual const TextFormat::Color getEdgeColor() = 0;
    virtual const int32_t getFontOpacity() = 0;
    virtual const int32_t getBackgroundOpacity() = 0;
    virtual const int32_t getFillOpacity() = 0;
    virtual ~TextFormat() {}








};

TextFormat::Font

No change in 2.0

class TextFormat {
enum Font     {
        kFontDefault,
        kFontMonospacedWithSerifs,
        kFontProportionalWithSerifs,
        kFontMonspacedWithoutSerifs,
        kFontProportionalWithoutSerifs,
        kFontCasual,
        kFontCursive,
        kFontSmallCapitals,
    };
};

TextFormat::Color

No change in 2.0

class TextFormat { 
enum Color   {
        kColorDefault = 0,
        kColorBlack,
        kColorGray,
        kColorWhite,
        kColorBrightWhite,
        kColorDarkRed,
        kColorRed,
        kColorBrightRed,
        kColorDarkGreen,
        kColorGreen,
        kColorBrightGreen,
        kColorDarkBlue,
        kColorBlue,
        kColorBrightBlue,
        kColorDarkYellow,
        kColorYellow,
        kColorBrightYellow,
        kColorDarkMagenta,
        kColorMagenta,
        kColorBrightMagenta,
        kColorDarkCyan,
        kColorCyan,
        kColorBrightCyan
    };
};

TextFormat::Size

No change in 2.0

class TextFormat {
    enum Size    {
        kSizeDefault = 0,
        kSizeSmall,
        kSizeMedium,
        kSizeLarge,
    };
};

TextFormat::FontEdge

No change in 2.0

class TextFormat{
    enum FontEdge   {
        kFontEdgeDefault,
        kFontEdgeNone,
        kFontEdgeRaised,
        kFontEdgeDepressed,
        kFontEdgeUniform,
        kFontEdgeDropShadowLeft,
        kFontEdgeDropShadowRight,
    };
};

MediaPlayerItemLoader

2.0 API 1.3 API
MediaPlayerItemLoader  

class MediaPlayerItemLoaderEvents:
public PSDKInterfaceWithUserData

virtual PSDKErrorCode load(const MediaResource& resource, 
int32_t resourceId, ItemLoaderListener* listener = NULL, 
const MediaPlayerItemConfig* config = NULL) = 0;

virtual PSDKErrorCode cancel() = 0;
    virtual PSDKErrorCode getCurrentItem(MediaPlayerItem*& out) = 0;
virtual PSDKErrorCode prepareBuffer() = 0;
virtual PSDKErrorCode getBufferControlParameters
(BufferControlParameters &out) = 0;
virtual PSDKErrorCode setBufferControlParameters
(const BufferControlParameters &param) = 0;
protected:
    virtual ~MediaPlayerItemLoader();
}

New in 2.0
ItemLoaderListener  

class ItemLoaderListener :
public PSDKInterfaceWithUserData

        {
         public:
         virtual void onError(PSDKErrorCode error) = 0;
         virtual void onLoadComplete(MediaPlayerItem* item) = 0;

};

Replaces 1.3 MediaPlayerItemLoaderEvents
  • kEventItemLoaderError in ErrorEvent - When an error occurs in Loading
  • kEventItemLoadComplete in ItemLoadCompleteEvent - When the load is successful

Media characteristics API element changes for 2.0

These tables compare the media characteristic API elements for the C++ Browser TVSDK between versions 1.3 and 2.0.

Tables in this topic:

  • MediaPlayerItem
  • Track, AudioTrack, ClosedCaptionsTrack
  • Profile
  • DRMMetadataInfo

MediaPlayerItem

2.0 API 1.3 API
MediaPlayerItem

class MediaPlayerItem : 
  public PSDKInterface {
    public:
    virtual PSDKErrorCode getResource(
         MediaResource & resource) const = 0;
    virtual int32_t getResourceId() const = 0;
    virtual bool isLive() const = 0;

    virtual bool hasAlternateAudio() const = 0;
    virtual PSDKErrorCode getAudioTracks(
         PSDKImmutableArray<AudioTrack>*& out) const = 0;
    virtual PSDKErrorCode getSelectedAudioTrack(
         AudioTrack & out) const = 0;
    virtual PSDKErrorCode selectAudioTrack(
         const AudioTrack& audioTrack) = 0;

    virtual bool hasClosedCaptions() const = 0;
    virtual PSDKErrorCode getClosedCaptionsTracks(
         PSDKImmutableArray<ClosedCaptionsTrack> *& out) 
         const = 0;
    virtual PSDKErrorCode getSelectedClosedCaptionsTrack(
         ClosedCaptionsTrack*& out) const = 0;
    virtual PSDKErrorCode selectClosedCaptionsTrack(
          const ClosedCaptionsTrack &closedCaptionsTrack 
            ) = 0;

    virtual bool hasTimedMetadata() const = 0;
    virtual PSDKErrorCode getTimedMetadata(
         PSDKImmutableArray <TimedMetadataInfo>*& 
         out) const = 0;
    virtual bool isDynamic() const = 0;
    virtual bool isProtected() const = 0;
    virtual PSDKErrorCode getDRMMetadataInfos(
         PSDKImmutableArray <DRMMetadataInfo>*&
            out) const = 0;

    virtual PSDKErrorCode getProfiles(
         PSDKImmutableArray<Profile>*& out) 
         const = 0;

    virtual PSDKErrorCode getSelectedProfile(
         Profile& out) = 0;

    virtual bool isTrickPlaySupported() const = 0;
    virtual PSDKErrorCode getAvailablePlaybackRates(
         PSDKImmutableArray<float>*& out) 
         const = 0;
    
    virtual float getSelectedPlaybackRate() = 0;

    

    virtual PSDKErrorCode getMediaPlayer(
         const MediaPlayer*&out) const = 0;

    virtual PSDKErrorCode getConfig(
         const MediaPlayerItemConfig*& out) const = 0;

protected:
    virtual ~MediaPlayerItem() {}
};

class MediaPlayerItem : 
   public CanHaveUserData {
    public:
    virtual PSDKErrorCode getResource(
         PSDKSharedPointer<MediaResource>& resource) = 0;
    virtual int32_t getResourceId() = 0;
    virtual bool isLive() = 0;

   virtual bool hasAlternateAudio() = 0;
    virtual PSDKErrorCode getAudioTracks(
         PSDKPtrImmutableArray<AudioTrack>::type & out) = 0;
    virtual PSDKErrorCode getSelectedAudioTrack(
         PSDKSharedPointer<AudioTrack>& out) = 0;
    virtual PSDKErrorCode selectAudioTrack(
         const PSDKSharedPointer<AudioTrack> &audioTrack) = 0;

    virtual bool hasClosedCaptions() = 0;
    virtual PSDKErrorCode getClosedCaptionsTracks(
         PSDKPtrImmutableArray<ClosedCaptionsTrack>::type& out) 
         = 0;
    virtual PSDKErrorCode getSelectedClosedCaptionsTrack(
         PSDKSharedPointer<ClosedCaptionsTrack>& out) = 0;
    virtual PSDKErrorCode selectClosedCaptionsTrack(
         const PSDKSharedPointer<ClosedCaptionsTrack> 
            &closedCaptionsTrack) = 0;

    virtual bool hasTimedMetadata() = 0;
    virtual PSDKErrorCode getTimedMetadata(
         PSDKPtrImmutableArray<TimedMetadata>::type& out)
               = 0;
    virtual bool isDynamic() = 0;
    virtual bool isProtected() = 0;
    virtual PSDKErrorCode getDRMMetadataInfos(
         PSDKPtrImmutableArray<DRMMetadataInfo>::type& out)
             = 0;

     virtual PSDKErrorCode getProfiles(
         PSDKPodImmutableArray<Profile>::type& out) = 0;




   
    virtual bool isTrickPlaySupported() = 0;
    virtual PSDKErrorCode getAvailablePlaybackRates(
         PSDKPodImmutableArray<float>::type& out) = 0;



   virtual PSDKErrorCode getAdTags(
         PSDKPodImmutableArray<PSDKString>::type& out) = 0;

    virtual PSDKErrorCode getMediaPlayer(
         PSDKSharedPointer<MediaPlayer>& out) = 0;





     virtual ~MediaPlayerItem() {}
};

Track, AudioTrack, ClosedCaptionsTrack

2.0 API 1.3 API
Track

class Track {
    public:
    const PSDKString& getName() const;
    const PSDKString& getLanguage() const;
    bool isDefault() const;
    bool isAutoSelect() const;   
    Track();
    Track(const psdkutils::PSDKString& name, 
             const psdkutils::PSDKString& language,
             bool isDefault, 
             bool autoSelect)
    explicit Track(const Track &track);
    virtual ~Track();
};

New in 2.0

AudioTrack

class AudioTrack : public Track {
    public:
    const PSDKString& getName() const; //From Track
    const PSDKString& getLanguage() const; //From Track  
    bool isDefault() const; //From Track
    bool isAutoSelect() const; //From Track 

    

     int32_t getPID() const;

        bool isValid()const;
        bool equals (const AudioTrack &track) const;

    AudioTrack(const PSDKString& name, 
            const PSDKString& language, 
            bool isDefault, bool isAutoSelect, int32_t pid);
    AudioTrack();
    explicit AudioTrack(const AudioTrack &track);

    virtual ~AudioTrack();
};

class AudioTrack {
    public:
    const PSDKReturnString getName();
    const PSDKReturnString getLanguage();
    bool isDefault();
    bool isAutoSelect();

    bool isForced();












    ~AudioTrack();
};

ClosedCaptionsTrack

class ClosedCaptionsTrack :  public Track {
public:    
    const PSDKString& getName() const; //From Track
    const PSDKString& getLanguage() const; //From Track  
    bool isDefault() const; //From Track

    bool isAutoSelect() const; //From Track 

    

    ServiceType getServiceType() const;     
    bool isForced() const;
    bool isValid() const;

    ClosedCaptionsTrack(
          const PSDKString& name,
          const PSDKString& language, 
          bool isDefault, 
          bool isAutoSelect, 
          ServiceType serviceType, 
          bool isForced);

    ClosedCaptionsTrack();

    explicit ClosedCaptionsTrack(
         const ClosedCaptionsTrack &track);

    virtual ~ClosedCaptionsTrack();
};

class ClosedCaptionsTrack {
public:   
    const PSDKReturnString getName();
    const PSDKReturnString getLanguage();
    bool isDefault();



   bool isActive();


















    ~ClosedCaptionsTrack();
};

ClosedCaptionTrack::ServiceType

class ClosedCaptionTrack : public Track {
public:
enum ServiceType{
    kST608Captions,
    kST708Captions,
    kSTWebVTTCaptions
};

(new for 2.0)

Profile

2.0 API 1.3 API
Profile

class Profile {
    public:
    uint32_t getBitrate() const;
    uint32_t getWidth() const;
    uint32_t getHeight() const;

   Profile();
    explicit Profile(const Profile& other);
};

class Profile {
    public:
    const int32_t getBitrate();
    const int32_t getWidth();
    const int32_t getHeight();



};

DRMMetadataInfo

2.0 API 1.3 API
DRMMetadataInfo

class DRMMetadataInfo {
    public:
    static TimeMS INVALID_TIME_RANGE_START_POSITION_AVE;
    static TimeMS INVALID_TIME_RANGE_START_POSITION_PSDK;
    static TimeMS MAX_TIME;

    PSDKErrorCode getDRMMetadata(
         const DRMMetadata& out) const;
    TimeMS getPrefetchTimestamp() const;
    PSDKErrorCode getTimeRange(TimeRange& out) const;



    DRMMetadataInfo();
    explicit DRMMetadataInfo(const DRMMetadataInfo &metadata);
};

class DRMMetadataInfo {
    public:
    static TIMEMS64 INVALID_TIME_RANGE_START_POSITION_AVE;
    static TIMEMS64 INVALID_TIME_RANGE_START_POSITION_PSDK;
    static TIMEMS64 MAX_TIME;

    PSDKErrorCode getDRMMetadata(
         PSDKSharedPointer<DRMMetadata>& out);
    const TIMEMS64 getPrefetchTimestamp();
    PSDKErrorCode getTimeRange(TimeRange& out);

   PSDKErrorCode setTimeRange(
         const TimeRange &timeRange);


};

Utility and Helper API element changes for 2.0

These tables compare the utility and helper API elements for the C++ Browser TVSDK between versions 1.3 and 2.0.

Tables in this topic:

  • Version
  • Metadata
  • TimeRange
  • PSDKStringUtils.Base64Decoder
  • QOSProvider
  • DeviceInformation
  • LoadInformation
  • View
  • PlaybackInformation
  • PSDK

Version

2.0 APIs 1.3 APIs
Version

class Version {
public:
            static const PSDKString& getVersion() 
                     const;
            staticconst PSDKString& getDescription() 
                     const;
            static uint32_t getMajor() const;
            static uint32_t getMinor() const;
            static uint32_t getRevision() const;
            uint32_t getAPIVersion() const;
};

class Version {
        public:
            const PSDKString& getVersion();

            const PSDKString& getDescription();

            const PSDKString& getMajor();
            const PSDKString& getMinor();
            const PSDKString& getRevision();
            const PSDKString& getAPIVersion();
    };

Metadata

2.0 APIs 1.3 APIs
Metadata

class Metadata : public PSDKInterface {
    public:
            virtual bool containsKey(
               const PSDKString& key) const = 0;

            virtual bool isEmpty() const = 0;

            virtual PSDKErrorCode getKeySet(
              PSDKImmutableArray<PSDKString>*&out) 
              const= 0;

            
            virtual PSDKErrorCode clone(
              PSDKSharedPointer<Metadata> &out) 
              const = 0;

            virtual const PSDKReturnString& getValue(
              const PSDKString& key) const = 0;   

            virtual PSDKErrorCode setValue(
              const PSDKString& key, 
              const PSDKString& value) = 0;  

            virtual PSDKErrorCode getMetadata(
              const PSDKString& key, 
              const Metadata*& out) 
              const = 0;

            virtual PSDKErrorCode setMetadata(
              const PSDKString& key, 
               const Metadata* value) = 0;

            virtual PSDKErrorCode getObject(
              const PSDKString &key, 
              PSDKInterface *&out) const = 0; 

            virtual PSDKErrorCode setObject(
              const PSDKString &key, 
              PSDKInterface *obj) = 0;    

            virtual PSDKErrorCode getByteArray(
              const PSDKString &key, 
              PSDKImmutableByteArray*& out) const = 0;

            virtual PSDKErrorCode setByteArray(
              const PSDKString &key, 
              PSDKImmutableByteArray* obj) = 0;

      protected:
            virtual ~Metadata();
    };

class Metadata : public CanHaveUserData {
     public:
            virtual bool containsKey(
              const PSDKString& key) = 0;

            virtual bool isEmpty() = 0;

            virtual PSDKErrorCode getKeySet(
              PSDKPodArray<PSDKReturnString>::type& out) = 0;

            virtual bool containsNode(
              const PSDKString& key) = 0;



  
            virtual const PSDKReturnString getValue(
              const PSDKString& key) = 0;   

            virtual PSDKErrorCode setValue(
              const PSDKString& key, 
              const PSDKString& value) = 0; 

           virtual PSDKErrorCode getNode(
              const PSDKString& key, 
              PSDKSharedPointer<Metadata>& out) = 0;


            virtual PSDKErrorCode setNode(
              const PSDKString& key, 
              const PSDKSharedPointer<Metadata>& value) = 0;



















};

TimeRange

2.0 APIs 1.3 APIs
TimeRange

class TimeRange {
public:
    TimeMS getBegin() const; 
    TimeMS getEnd() const;
    TimeMS getDuration() const;
    bool contains(TimeMS time) const;

    void expand TimeRange(const TimeRange &timeRange);
    int32_t compareTo(const TimeRange &timeRange) const;


    TimeRange(TimeMS begin, TimeMS duration);
    TimeRange();

   TimeRange(const TimeRange &range);

    bool isValid() const;
};

class TimeRange{
public:
    const TIMEMS64 getBegin(); 
    const TIMEMS64 getEnd();
    const TIMEMS64 getDuration();
    bool contains(TIMEMS64 time) ;





    TimeRange(TIMEMS64 begin, TIMEMS64 duration);
    TimeRange();




};

PSDKStringUtils.Base64Decoder

2.0 APIs 1.3 APIs
Base64Decoder

class PSDKStringUtils : PSDKInterface
{  
public:  
    static PSDKErrorCode base64Decode(
      const PSDKString& encoded, PSDKImmutableByteArray*& out);   
};

New in 2.0

QOSProvider

2.0 APIs 1.3 APIs
QOSProvider

class QOSProvider : public PSDKInterface {
    public:
        virtual PSDKErrorCode attachMediaPlayer(
          const MediaPlayer*& player) = 0;
        virtual PSDKErrorCode detachMediaPlayer() = 0;

        virtual PSDKErrorCode getDeviceInformation(
          const DeviceInformation*& out) = 0;
        virtual PSDKErrorCode getPlaybackInformation( 
          PlaybackInformation& out) = 0;

        virtual ~QOSProvider() {}
};

class QOSProvider : public PSDKInterface {
    public:
        virtual PSDKErrorCode attachMediaPlayer(
          const PSDKSharedPointer<MediaPlayer> &player) = 0;
        virtual PSDKErrorCode detachMediaPlayer() = 0;

        virtual PSDKErrorCode getDeviceInformation(
            PSDKSharedPointer<DeviceInformation>& out) = 0;
        virtual PSDKErrorCode getPlaybackInformation(
            PlaybackInformation &out) = 0;

        virtual ~QOSProvider() {}
};

DeviceInformation

2.0 APIs 1.3 APIs
DeviceInformation

class DeviceInformation : public PSDKInterface { 
    public:
    virtual const PSDKString& getOS() const = 0;





    virtual const PSDKString& getId() const = 0; 

    virtual int32_t getDensityDPI() const = 0; 
    virtual int32_t getHeightPixels() const = 0;
    virtual int32_t getWidthPixels() const = 0; 




    virtual bool isSeekToKeyFrame() const = 0;
    virtual ~DeviceInformation() {}
};

class DeviceInformation : public CanHaveUserData { 
    public:
    virtual PSDKReturnString getOS() = 0;

   virtual int32_t getSDK() = 0;
    virtual PSDKReturnString getModel() = 0;
    virtual PSDKReturnString getManufacturer() = 0; 

    virtual PSDKReturnString getId() = 0; 

    virtual int32_t getDensityDPI() = 0; 
    virtual int32_t getHeightPixels() = 0;
    virtual int32_t getWidthPixels() = 0; 

virtual PSDKReturnString getRuntimeVersion() = 0; 
    virtual PSDKReturnString getRuntimeType() = 0;

    virtual bool isSeekToKeyFrame() = 0;
    virtual ~DeviceInformation() {}
};

LoadInformation

2.0 APIs 1.3 APIs
LoadInformation

class LoadInformation : public PSDKInterface{ 
    public:
   LoadInformation Type getType() const;
    const PSDKString& getUrl() const;
    int32_t getPeriodIndex() const;
    int32_t getSize() const;

    TimeMS getMediaDuration() const;
    TimeMS getDownloadDuration() const;

    const PSDKString& getTrackName() const;
    const PSDKString& getTrackType() const;
    int32_t getTrackIndex() const; 
};

class LoadInfo : public CanHaveUserData{ 
    public:
    Type getType();
    const PSDKReturnString getUrl();
    const int32_t getPeriodIndex();
    const int32_t getSize();

    const TIMEMS64 getMediaDuration();
    const TIMEMS64 getDownloadDuration();

    const PSDKReturnString getTrackName();
    const PSDKReturnString getTrackType();
    const int32_t getTrackIndex(); 
};

LoadInformation::Type
No change in 2.0

class LoadInformation{
    enum Type    {
        kTypeFragment = 0,
        kTypeTrack = 1,
        kTypeManifest = 2
    };
};

View

2.0 APIs 1.3 APIs
View

Unchanged for 2.0

class View : public PSDKInterface {
    public:
        virtual int32_t getX() = 0;
        virtual int32_t getY() = 0;
        virtual int32_t getWidth() = 0;
        virtual int32_t getHeight() = 0;

        virtual PSDKErrorCode setSize(
            int32_t width, 
            int32_t height) = 0;

        virtual PSDKErrorCode setPos(
            int32_t x, 
            int32_t y) = 0;

        virtual Surface getNativeSurface() = 0;

        virtual SurfaceType getNativeSurfaceType() = 0;

        virtual ~View() {}
};

PlaybackInformation

2.0 APIs 1.3 APIs
PlaybackInformation

class PlaybackInformation {

    TimeMS getTimeToFirstByte() const;
   TimeMS getTimeToLoad() const;
   TimeMS getTimeToStart() const;
   TimeMS getTimeToFail() const;

   int32_t getTotalSecondsPlayed() const;
    int32_t getTotalSecondsSpent() const;

   float getFrameRate() const;
   int32_t getDroppedFrameCount() const;
   int32_t getPerceivedBandwidth() const;
   const int32_t getBitrate() const;

   TimeMS getBufferTime() const;
    int32_t getBufferLength() const;
   int32_t getEmptyBufferCount() const;
   TimeMS getBufferingTime() const;

    PlaybackInformation();

    PlaybackInformation(
        TimeMS timeToFirstByte, 
        TimeMS timeToLoad, 
        TimeMS timeToStart, 
        TimeMS timeToFail, 
        int32_t secondsPlayed, 
        int32_t secondsSpent, 
        float frameRate, 
        int32_t droppedFrameCount,         
        int32_t bitrate, 
        TimeMS bufferTime, 
        int32_t bufferLength, 
        int32_t emptyBufferCount, 
        TimeMS bufferingTime);
};

class PlaybackInformation {

    const TIMEMS64 getTimeToFirstByte();
    const TIMEMS64 getTimeToLoad();
    const TIMEMS64 getTimeToStart();
    const TIMEMS64 getTimeToFail();

    const int32_t getTotalSecondsPlayed();
    const int32_t getTotalSecondsSpent();

    const float getFrameRate();
    const int32_t getDroppedFrameCount();

    const int32_t getBitrate();

    const TIMEMS64 getBufferTime();
    const int32_t getBufferLength();
    const int32_t getEmptyBufferCount();
    const TIMEMS64 getBufferingTime();

    PlaybackInformation();

    PlaybackInformation(
        TIMEMS64 timeToFirstByte, 
        TIMEMS64 timeToLoad, 
        TIMEMS64 timeToStart, 
        TIMEMS64 timeToFail, 
        int32_t secondsPlayed, 
        int32_t secondsSpent, 
        float frameRate, 
        int32_t droppedFrameCount, 
        int32_t bitrate, 
        TIMEMS64 bufferTime, 
        int32_t bufferLength, 
        int32_t emptyBufferCount, 
        TIMEMS64 bufferingTime);
};

PSDK

2.0 APIs 1.3 APIs
PSDK

class PSDK : public PSDKSingletonInterface {
    public:
        static PSDKErrorCode getPSDK(
            PSDK*& out);

        virtual PSDKErrorCode release() = 0;

       virtual psdkutils::PSDKErrorCode initiateDRMWorkFlow (
             DRMworkflowInitializationType type, void *corePlayer,
             const psdkutils::PSDKString &appStoragePath, 
             const psdkutils::PSDKString&publisherId,
             const psdkutils::PSDKString & appId, 
             const psdkutils::PSDKString &appVersion,
             bool privacyModeOn)=0;

         virtual psdkutils::PSDKErrorCode createDispatcher (
             PSDKEventManager*manager, PSDKEventDispatcher 
             *&out)=0;

         virtual PSDKErrorCode createMediaPlayer(
              PSDKEventDispatcher *dispatcher, 
             ::DRMManager *drmmanager, 
             MediaPlayer*& out) = 0;






















         virtual psdkutils::PSDKErrorCode 
              createMediaPlayerItemLoader (
              PSDKEventDispatcher *dispatcher, 
              MediaPlayerItemLoader *&out)=0;
        virtual psdkutils::PSDKErrorCode create TagDecoder (
                 TagDecoderType type, TagDecoder *&out)=0;

        virtual PSDKErrorCode createAdAsset(
            const PSDKString &id, 
            const TimeMS duration, 
             const MediaResource* & resource,  
             const AdClick* & adClick,  
             const Metadata* metadata,  
            AdAsset* & out) = 0;

            virtual PSDKErrorCode createAd(
               const PSDKString& id,
                AdType adType, 
                TimeMS duration, 
                bool isCustomAdMarker, 
                 const AdAsset* & &primaryAsset , 
                 PSDKImmutableValueArray<AdBannerAsset>* 
                         companionAssets , 
                 const ContentTracker* tracker, 
               AdInsertionType adInsertionType  bool isClickable,
               Ad*& out)=0;, 

virtual PSDKErrorCode createAdBreak(
               PSDKRefArray<Ad> *adsArray, 
            ContentTracker *tracker,
            AdBreak *&out)=0;


            
            virtual PSDKErrorCode createAdBreakEx(
            PSDKRefArray<Ad> *adsArray, 
            ContentTracker *tracker,
            AdInsertionType type,
            AdBreak *&out)=0;




          virtual PSDKErrorCode createAdBreakPlacement(
              const AdBreak* adBreak,
              Placement placement, 
              AdBreakPlacement*& out) =0; 

          virtual PSDKErrorCode 
                       createDeleteRangeTimelineOperation(
          const Placement &placement,
          DeleteRangeTimelineOperation *&out)=0

          virtual PSDKErrorCode createMetadata
          (Metadata*& out)=0;

        virtual PSDKErrorCode createContentResolver(
            ResolverType resolverType, 
            ContentResolver*&out) = 0;

        virtual PSDKErrorCode createOpportunityGenerator(           
            OpportunityGeneratorType type, 
            OpportunityGenerator*& out) = 0;

        virtual PSDKErrorCode createAdPolicySelector(
            AdPolicySelectorType adPolicySelectorType, 
            const MediaPlayerItem*  mediaPlayerItem, 
            AdPolicySelector*& out) = 0;

        virtual PSDKErrorCode createTimedMetadata(
            TimedMetadataType type, 
            TimeMS time, 
            uint32_t id, 
            const PSDKString &name, 
             const Metadata*  metadata, 
            TimedMetadata* & out) = 0;

        virtual PSDKErrorCode createDRMMetadataInfo(
            const DRMManager*  drmManager, 
            PSDKImmutableByteArray * metadataBytes, 
            TimeMS  timestamp, 
            DRMMetadataInfo* & out) = 0;







         virtual PSDKErrorCode createMediaPlayerItemConfig
          psdkutils::PSDKImmutableValueArray
            <psdkutils::PSDKString> *adTags,
          psdkutils::PSDKImmutableValueArray
            <psdkutils::PSDKString> *subscribeTags,
          ContentFactory *factory, NetworkConfiguration *networkcConfiguration,
          AdvertisingMetadata *advertisingMetadata,
          CustomRangeMetadata *customRangeMetadata,
          AdSignalingMode adSignalingMode,
          MediaPlayerItemConfig *&out)=0;

          virtual psdkutils::PSDKErrorCode 
              createDefaultMediaPlayerItemConfig
          (MediaPlayerItemConfig *&out)=0;

           virtualpsdkutils::PSDKErrorCode 
                     createDefaultContentFactory( 
                     ContentFactory *&out)=0;

           virtualpsdkutils::PSDKReturnString PSDKErrorToString( 
               psdkutils::PSDKErrroCode error)=0;

           virtual PSDKErrorCode createQOSProvider(
            QOSProvider*& out) = 0;

           virtual psdkutils::PSDKErrorCode creatAuditudeSettings(
               AuditudeSettings *&out)=0;

           virtual psdkutils::PSDKErrorCode createAdvertisingMetadata(
                       AdvertisingMetadata *&out)=0;

        virtual psdkutils::PSDKErrorCode createCustomRangeMetada(
                    CustomRangeMetadata *&out)=0;

        virtual psdkutils::PSDKErrorCode 
                     createDefaultNetworkConfiguration(
                     NetworkConfiguration *&out)=0;

       virtual PSDKReturnString PSDKErrorToString(
            PSDKErrorCode error) = 0;









        virtual PSDKErrorCode setDeviceInformation(
            const DeviceInformation* info) = 0;

        virtual PSDKErrorCode getDeviceInformation(
            const DeviceInformation*& out) = 0;



        virtual ~PSDK() { }
};

class PSDK : public PSDKInterface {
     public:
        static PSDKErrorCode getPSDK(
            PSDKSharedPointer<PSDK>& out);

        virtual PSDKErrorCode release() = 0;













        virtual PSDKErrorCode createMediaPlayer(
            void* context, 
            PSDKSharedPointer<MediaPlayer>& out) = 0;

       virtual PSDKErrorCode createMediaResource(
            const PSDKString& url, 
            const PSDKString& type, 
            const PSDKSharedPointer<Metadata>& metadata, 
            PSDKSharedPointer<MediaResource>& out) = 0;

        virtual PSDKErrorCode createMediaResourceFromUrl(
            const PSDKString& url, 
            const PSDKSharedPointer<Metadata>& metadata, 
            PSDKSharedPointer<MediaResource>& out) = 0;

        virtual PSDKErrorCode createSCTE35Parser(
            PSDKSharedPointer<scte35::SCTE35Parser> &out) = 0;

        virtual PSDKErrorCode getDRMManager(
            void* context, 
            PSDKSharedPointer<DRMManager>& out ) = 0;

        virtual PSDKErrorCode getPSDKVersion(
            PSDKSharedPointer<Version>& out) = 0;









virtual PSDKErrorCode createAdAsset(
            const PSDKString &id, 
            const TIMEMS64 duration, 
            const PSDKSharedPointer<MediaResource>& resource, 
            const PSDKSharedPointer<AdClick>& adClick, 
            const PSDKSharedPointer<Metadata>& metadata, 
            PSDKSharedPointer<AdAsset>& out) = 0;

        virtual PSDKErrorCode createAd(
            int32_t id, 
            AdType adType, 
            TIMEMS64 duration, 
            bool isCustomAdMarker, 
            const PSDKSharedPointer<AdAsset> &primaryAsset, 
            const PSDKPtrImmutableArray<AdAsset>::type 
                   &companionAssets, 
            const PSDKSharedPointer<ContentTracker> &tracker, 
            AdInsertionType adInsertionType, 
            PSDKSharedPointer<Ad>& out) = 0;

        virtual PSDKErrorCode createAdBreak(
           TIMEMS64 time, 
            TIMEMS64 duration, 
            const PSDKPtrArray<Ad>::type& adsArray, 
            const PSDKSharedPointer<TrackerInterface> &tracker, 
            PSDKSharedPointer<AdBreak>& out) = 0;

        virtual PSDKErrorCode createAdBreak(
            TIMEMS64 time, 
            TIMEMS64 duration, 
            const PSDKPtrArray<Ad>::type& adsArray, 
            const PSDKSharedPointer<TrackerInterface> &tracker, 
            const PSDKString& data, 
            AdInsertionType type, 
            PSDKSharedPointer<AdBreak>& out) = 0;

        virtual PSDKErrorCode createAdBreakPlacement(
            const PSDKSharedPointer<AdBreak>& adBreak, 
            Placement placement, 
            PSDKSharedPointer<AdBreakPlacement>& out) = 0;






        virtual PSDKErrorCode createMetadata(
            PSDKSharedPointer<Metadata>& out) = 0;

        virtual PSDKErrorCode createContentResolver(
            ResolverType resolverType, 
            PSDKSharedPointer<ContentResolver>& out) = 0;

        virtual PSDKErrorCode createOpportunityDetector(
            DetectorType detectorType, 
            PSDKSharedPointer<OpportunityDetector>& out) = 0;

        virtual PSDKErrorCode createAdPolicySelector(
            AdPolicySelectorType adPolicySelectorType, 
            PSDKSharedPointer<MediaPlayerItem> mediaPlayerItem, 
            PSDKSharedPointer<AdPolicySelector>& out) = 0;

        virtual PSDKErrorCode createTimedMetadata(
            TimedMetadata::Type type, 
            TIMEMS64 time, 
            uint32_t id, 
            const PSDKString &name, 
            const PSDKSharedPointer<Metadata> &metadata, 
            PSDKSharedPointer<TimedMetadata>& out) = 0;

        virtual PSDKErrorCode createDRMMetadataInfo(
            const PSDKSharedPointer<DRMManager>& drmManager, 
            const PSDKPodArray<uint8_t>::type& metadataBytes, 
            TIMEMS64 timestamp, 
            PSDKSharedPointer<DRMMetadataInfo>& out) = 0;

        virtual PSDKErrorCode createTextFormat(
            TextFormat::Font font, 
            TextFormat::Size size, 
            TextFormat::FontEdge fontEdge, 
            TextFormat::Color fontColor, 
            TextFormat::Color backgroundColor, 
            TextFormat::Color fillColor, 
            TextFormat::Color edgeColor, 
            int fontOpacity, 
            int backgroundOpacity, 
            int fillOpacity, 
            PSDKSharedPointer<TextFormat>& out) = 0;

        virtual PSDKErrorCode getPSDKEventDispatcher(
            PSDKSharedPointer<PSDKEventDispatcherInterface>& out) = 0;

        virtual PSDKErrorCode getPSDKEventDispatcherWithCtx(
            PSDKSharedPointer<PSDKEventDispatcherWithCtxInterface>& out) = 0;

        virtual PSDKErrorCode createMediaPlayerConfig(
            const PSDKPodArray<PSDKString>::type& adTags, 
            const PSDKPodArray<PSDKString>::type& subscribedtags, 
            const PSDKSharedPointer<MediaPlayerClientFactory> &clientFactory, 
            PSDKSharedPointer<MediaPlayerConfig>& out) = 0;

        virtual PSDKErrorCode createEmptyMediaPlayerConfig(
            PSDKSharedPointer<MediaPlayerConfig>& out) = 0;

        virtual PSDKErrorCode createQOSProvider(
            PSDKSharedPointer<QOSProvider> &out) = 0;

        virtual PSDKErrorCode 
           createDefaultMediaPlayerClientFactory(
              PSDKSharedPointer<MediaPlayerClientFactory>& out) = 0;










        virtual PSDKReturnString PSDKErrorToString(
            PSDKErrorCode error) = 0;

        virtual PSDKErrorCode setPlatformCallbackManager(
            const PSDKSharedPointer<PlatformCallbackManager>& mgr) = 0;

       virtual PSDKErrorCode getPlatformCallbackManager(
            PSDKSharedPointer<PlatformCallbackManager>& out) = 0;

        virtual bool isInDifferentThread() = 0;

        virtual PSDKErrorCode setDeviceInformation(
            const PSDKSharedPointer<DeviceInformation>& mgr) = 0;

        virtual PSDKErrorCode getDeviceInformation(
            PSDKSharedPointer<DeviceInformation>& out) = 0;

        virtual EventContext getNextEventContext() = 0;

        virtual ~PSDK() { }
};

Mapping C++ Errors to Exceptions in Different Languages

C++ error codes correspond to different error values or exceptions in different languages. Policies for handling errors also vary.

The C++ Browser TVSDK has a policy of not throwing exceptions from its API methods. Most methods return a PSDKErrorCode value to indicate whether the method executed successfully. Asynchronous errors are provided to your application through error events.

The ActionScript and Java Browser TVSDKs have different policies. Most errors throw an ArgumentError or IllegalStateException to indicate when the synchronous part of the method could not be executed. These exceptions are not caught, and your application code is responsible for handling them. Exceptions usually provide useful information about why the method call failed. For example, if the prepareToPlay command is called while the player is in an invalid state, the Browser TVSDK throws the following exception:

throw new IllegalStateException("Invalid player state. prepareToPlay method 
must be called only once after replaceCurrentItem or replaceCurrentResource method.");

The ActionScript and Java Browser TVSDKs also throw exceptions from constructors to indicate when an internal object was incorrectly created. The Browser TVSDK handles these exceptions internally, and does not propagate them to your application. The exceptions are included in a warning notification that is dispatched to your application. For example, if no valid media file was found for the received ad response, then no valid ad asset object or ad can be created. As a result, no ad is placed on the timeline, and a NotificationEvent.OperationFailed notification is dispatched. 

Error or warning codes that are received asynchronously from the Adobe Video Engine (AVE) are dispatched to your application as normal events. The notification event contains all received error codes and any additional metadata, such as the URL, resource identifier, handle, and so on. If the error is serious and the playback of the current media cannot continue, the MediaPlayer transitions to the ERROR status and the onStatusChanged callback or MediaPlayerStatusChanged.STATUS_CHANGED event is dispatched. If the playback can continue, a normal notification event is dispatched.

The class PSDKErrorCode maps the error code numbers.

C++ Error (PSDKError Code) Java ActionScript JavaScript
      Exceptions also provide additionalinfo =<info passed by method that threw the exception>
kECInvalidArgument IllegalArgumentException ArgumentError Exception with code = 1, description = "INVALID_ARGUMENT"
kECNullPointer IllegalArgumentException ArgumentError Exception with code = 2, description = "GENERIC_ERROR"
kECIllegalState IllegalStateException IllegalStateException Exception with code = 3, description = "ILLEGAL_STATE"
kECInterfaceNotFound     Exception with code = 4, description = "GENERIC_ERROR"
kECCreationFailed     Exception with code = 5, description = "CREATION_FAILED"
kECUnsupportedOperation     Exception with code = 5, description = "CREATION_FAILED"
kECDataNotAvailable     Exception with code = 7, description = "DATA_NOT_AVAILABLE"
kECSeekError     Exception with code = 8, description = "SEEK_ERROR"
kECUnsupportedFeature     Exception with code = 9, description = "UNSUPPORTED_FEATURE"
kECRangeError     Exception with code = 10, description = "RANGE_ERROR"
kECCodecNotSupported     Exception with code = 11, description = "CODEC_NOT_SUPPORTED"
kECMediaError     Exception with code = 12, description = "MEDIA_ERROR"
kECNetworkError     Exception with code = 13, description = "NETWORK_ERROR"
kECGenericError MediaPlayerNotification.Error or MediaPlayerNotification.Warning MediaError or NotificationEvent Exception with code = 14, description = "GENERIC_ERROR"
kECInvalidSeekTime     Exception with code = 15, description = "INVALID_SEEK_TIME"
kECAudioTrackError     Exception with code = 16, description = "AUDIO_TRACK_ERROR"
kECAccessFromDifferentThreadError     Exception with code = 17, description = "GENERIC_ERROR"
kECElementNotFound     Exception with code = 18, description = "GENERIC_ERROR"
kECNotImplemented     Exception with code = 19, description = "GENERIC_ERROR"
kECPlaybackOperationFailed     Exception with code = 200, description = "PLAYBACK_OPERATION_FAILED" >
kECNativeWarning MediaPlayerNotification.Warning NotificationEvent Exception with code = 201, description = "NATIVE_WARNING"
kECAdResolverFailed MediaPlayerNotification.Warning   Exception with code = 202, description = "AD_RESOLVER_FAILED"

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