3.17.0
Changes from 3.16.0
Example how to use it in Objective-C:
OTTMediaOptions *options = [[OTTMediaOptions alloc] init];
DTGSelectionOptions *selection = [[DTGSelectionOptions alloc] init];
[selection setMinVideoBitrate:1000000 forCodec:TrackCodecAvc1];
[selection setMinVideoBitrate:2000000 forCodec:TrackCodecMp4a];
[selection setMinVideoWidth:1280];
[selection setMinVideoHeight:720];
[selection setAllTextLanguages:YES];
[selection setAllAudioLanguages:YES];
NSArray *codecs = [NSArray arrayWithObjects:
[NSNumber numberWithInteger:TrackCodecAvc1],
[NSNumber numberWithInteger:TrackCodecHevc], nil];
[selection setPreferredVideoCodecs:codecs];
[selection setPreferredAudioCodecs:[NSArray arrayWithObjects:[NSNumber numberWithInteger:TrackCodecAc3], nil]];
// OTT Player
[[OfflineManager shared] prepareAssetWithMediaOptions:options
options:selection
callback:^(NSError *error, AssetInfo *info, PKMediaEntry *entry) {
}];
// Basic Player
PKMediaSource *source = [[PKMediaSource alloc] init:@"ID"
contentUrl:[NSURL URLWithString:@"http://your-playback.com/url.m3u8"]
mimeType:nil
drmData:nil
mediaFormat:MediaFormatHls];
PKMediaEntry *entry = [[PKMediaEntry alloc] init:@"ID"
sources:[NSArray arrayWithObjects:source, nil]
duration:-1];
[[OfflineManager shared] prepareAssetWithMediaEntry:entry
options:selection
callback:^(NSError *error, AssetInfo *info) {
}];
DTGSelectionOptions
func setMinVideoBitrate(_ codec: TrackCodec, _ bitrate: Int) -> Self
deprecated now usefunc setMinVideoBitrate(_ bitrate: Int, forCodec codec: TrackCodec) -> Self
Cocoapods install
pod 'DownloadToGo', '~> 3.17.0'