這些Android TVSDK API中的變更支援刪除和取代廣告。
AdSignalingMode
新的自訂時間範圍廣告信令模式
AdvertisingMetadata
新功 setTimeRanges(TimeRangeCollection timeRanges, Metadata options)
能:設定處理中繼資料時要標籤、刪除或取代的時間範圍
ContentResolver
public final boolean canResolve(PlacementOpportunity placementOpportunity)
protected abstract boolean doCanResolve(PlacementOpportunity placementOpportunity)
新ContentRemoval
類別
TimelineOperation
定義要從時間軸中刪除的時間範圍的類
AuditudeResolver
新private LinkedList<AuditudeRequest> _requestQueue
新void startConsumer()
:開始處理Primetime廣告決策請求佇列,並確保每個請求以MIN_INIT_REQUEST_INTERVAL
間隔發出
新processReplacementRange()
:從廣告中繼資料擷取時間範圍並產生PlacementInformations
,並建立包含PlacementInformations
的Primetime廣告決策請求。
新canDoResolver()
:檢查位置商機是否有Primetime廣告決策中繼資料
新的CustomRangeHelper
Helper類別,可從廣告中繼資料擷取時間範圍中繼資料,並移除子集/重疊/無效的時間範圍。
新的DeleteContentResolver
內容解析程式,可解決PlacementInformation.Mode.DELETE
的放置機會
新NopTimelineOperation
新時間軸作業,適用於不需要進行廣告插播位置或取代的時間軸作業。 此類用於區分這類和解析過程中出現錯誤時。
TimelineOperationQueue
在處理前檢查時間軸操 NopTimelineOperation
作是否為。
CustomAdMarkersContentResolver
新功 canDoResolve()
能:檢查職位安排機會是否為類型 Mode.MARK
MetadataResolver
新功 canDoResolve()
能:檢查職位安排機會是否為類型 Mode.INSERT
DefaultMetadataKeys
新增 TIME_RANGES_METADATA_KEY("time_ranges_metadata_key")
PlacementInformation
enum (INSERT, DELETE, REPLACE, MARK)
CUSTOM_TIME_RANGES
TimeRange
新功 compareTo(TimeRange timeRange)
能:因此,可以根據開始時間對時間範圍進行排序
新ReplacementTimeRange
使用begin
、end
和replacement-duration
參數擴充代表替換時間範圍的TimeRange
類別。
TimeRangeCollection
新MARK_RANGES, DELETE_RANGES, REPLACE_RANGES
將CUSTOM_AD_MARKERS
重新命名為MARK_RANGES
已修改toMetadata(Metadata options)
,將刪除/標籤/取代範圍放入廣告中繼資料。
MediaPlayerNotification
UNDEFINED_TIME_RANGES
:當廣告信令模式是伺服器地圖或資訊清單提示,且取代範圍也在廣告中繼資料中時,取代範圍會被忽略。REPLACE_RANGES_NOT_AVAILABLE
:當廣告信令模式為「自訂時間範圍」且無法使用取代範圍時,將會傳送警告。AdvertisingFactory
新增 public abstract List<ContentResolver> createContentResolvers(MediaPlayerItem item)
DefaultAdvertisingFactory
新增 public List<ContentResolver> createContentResolvers(MediaPlayerItem item)
DefaultContentResolverFactory
新增 public static List<ContentResolver> createContentResolvers(MediaResource resource, Context context)
DefaultMediaPlayer
在prepareToPlay()
中:將初始搜尋設為0,因為如果刪除範圍[0,n]
,媒體播放器將不會自動播放。
在prepareToPlay()
中:循環查看mediaplayerclient
要解決的初始放置資訊清單。
在extractAdSignalingMode()
中:適應新的自訂時間範圍模式。
新private static List<PlacementInformation> createInitalPlacementInformations()
:生成廣告信令模式和內容解析器的初始放置資訊(從廣告元資料衍生)。
在ContentPlacementCompletedListener
中:在呼叫endAdResolving
之前,檢查mediaPlayerClient
是否為doneInitialResolving
。
MediaPlayerClient
新List<ContentResolver> _contentResolvers
新int _reservations
新lookupContentResolver(PlacementOpportunity placementOpportunity)
:查找哪個解析程式可以解析PlacementOpportunity
。
已修改程式碼以建立多個內容解析器。
新public boolean doneInitialResolving()
:檢查是否還有任何機會有待解決。
VideoEngineTimeline
removeContent(TimelineOperation timelineOperation)
:從時間軸移除指定範圍的內容。removeContentByLocalTime(long begin, long end)
:移除begin
和end
的本機時間內容。DefaultOpportunityDetectorFactory
已修 createOpportunityDetector
改:對於VOD串流,只有在沒有MARK或REPLACE SpliceOutOpportunityDetector
範圍時(因為這些範圍比信令模式具有優先順序)才返回新的。