fix: refactor side loaded text tracks management (#4158)
* fix: refactor side loaded text tracks management More textTracks in source. android/ios: ensure text tracks are not selected by default android/ios make textTrack field not nullable clean up doc check compatibility with the old api Add comments on deprecated JS apis Apply API change on basic sample * chore: fix linter * fix(ios): fix build with caching & remove warnings
This commit is contained in:
@@ -15,4 +15,8 @@ struct SelectedTrackCriteria {
|
||||
self.type = json["type"] as? String ?? ""
|
||||
self.value = json["value"] as? String
|
||||
}
|
||||
|
||||
static func none() -> SelectedTrackCriteria {
|
||||
return SelectedTrackCriteria(["type": "none", "value": ""])
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,7 @@ struct VideoSource {
|
||||
let customMetadata: CustomMetadata?
|
||||
/* DRM */
|
||||
let drm: DRMParams?
|
||||
var textTracks: [TextTrack] = []
|
||||
|
||||
let json: NSDictionary?
|
||||
|
||||
@@ -52,5 +53,8 @@ struct VideoSource {
|
||||
self.cropEnd = (json["cropEnd"] as? Float64).flatMap { Int64(round($0)) }
|
||||
self.customMetadata = CustomMetadata(json["metadata"] as? NSDictionary)
|
||||
self.drm = DRMParams(json["drm"] as? NSDictionary)
|
||||
self.textTracks = (json["textTracks"] as? NSArray)?.map { trackDict in
|
||||
return TextTrack(trackDict as? NSDictionary)
|
||||
} ?? []
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user