Skip to content

HLS (.m3u8 file) always restart the content after mid-Rolls #54

@CharlesMcD

Description

@CharlesMcD

Device: iPhone 11 pro
OS: iOS 14.7.1
GoogleAds-IMA-iOS-SDK: 3.14.4 (also observed on 3.14.3)

Using your swift AdvancedExample, I can easily reproduce a bug that always makes the content restart at the beginning after mid-Rolls when using a .m3u8 file.

In the sample app there are these 4 URLs and the last two are problematic :

If you select the "AdRules" option in the app, which uses bipbopall.m3u8, you'll see that the content will go back at the beginning every time the midRoll ends. The bug does not occur when using an MP4 file, but I was able to reproduce it with all the HLS files in my project.

The bug seems to occurs when using the new way of creating a IMAAdsRequest that support Picture in Picture.

let request = IMAAdsRequest(adTagUrl: adTagUrl,
                            adDisplayContainer: createAdDisplayContainer(),
                            avPlayerVideoDisplay: IMAAVPlayerVideoDisplay(avPlayer: contentPlayer),
                            pictureInPictureProxy: pictureInPictureProxy,
                            userContext: nil)

// IMAAdsRequest.h
- (instancetype)initWithAdTagUrl:(NSString *)adTagUrl
              adDisplayContainer:(IMAAdDisplayContainer *)adDisplayContainer
            avPlayerVideoDisplay:(IMAAVPlayerVideoDisplay *)avPlayerVideoDisplay
           pictureInPictureProxy:(IMAPictureInPictureProxy *)pictureInPictureProxy
                     userContext:(id)userContext API_AVAILABLE(ios(9.0), tvos(14.0)); 

If I change the code to use the old version (the one that doesn't support PIP), it does not happen.

let request = IMAAdsRequest(adTagUrl: adTagUrl,
                            adDisplayContainer: createAdDisplayContainer(),
                            contentPlayhead: contentPlayhead,
                            userContext: nil)

// IMAAdsRequest.h
- (instancetype)initWithAdTagUrl:(NSString *)adTagUrl
              adDisplayContainer:(IMAAdDisplayContainer *)adDisplayContainer
                 contentPlayhead:(NSObject<IMAContentPlayhead> *)contentPlayhead
                     userContext:(id)userContext NS_DESIGNATED_INITIALIZER;

Please see the video attached below to see the bug reproduced with the advanced example app. MidRoll ad start at around 27 seconds into the video.

RPReplay_Final1630557393.MP4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions