Skip to content

v4.4.1

Compare
Choose a tag to compare
@chausov chausov released this 23 Nov 18:00
· 58 commits to develop since this release

Changes from v4.4.0

  • OfflineManager prepareAssetWithMediaOptions(options: callback: ) exposed to Objective-C (#39)

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 use func setMinVideoBitrate(_ bitrate: Int, forCodec codec: TrackCodec) -> Self

Cocoapods install

pod 'KalturaPlayer', '~> 4.4

The samples and user guide can be found in the samples repo.