[ios] Is AVPlayerViewController supported with IMA sdk

305 views
Skip to first unread message

rmodi

unread,
Feb 18, 2022, 7:58:05 PM2/18/22
to Interactive Media Ads SDK
Hi
We are using AVPlayerViewController as the content player when integrating the IMA sdk.
I have noticed that the documentation shows the use of AVPlayerViewController

2 questions
1) Does this mean that the IMA sdk does support the use of AVPlayerViewController?
2) Is Picture in Picture expected to work too then using AVPlayerViewController?  I am not able to get it to work. I used
  •  self.pictureInPictureProxy = [[IMAPictureInPictureProxy alloc] initWithAVPlayerViewControllerDelegate:self];  

  • and NO self.pictureInPictureController since I use AVPlayerViewController. 

  • and a request with a IMAAVPlayerVideoDisplay with self.pictureInPictureProxy

The preroll plays in the AVPlayerViewController but the content does not.

Thank you
Rahat




IMA SDK

unread,
Feb 22, 2022, 2:23:06 AM2/22/22
to raha...@gmail.com, ima...@googlegroups.com

Hello Rahat,

 

Michael here from IMA SDK Team, allow me to assist you.

 

Yes, AVPlayerViewController is supported by the SDK and it is expected to work with PiP mode. You may check this guide for Picture-in-picture for reference. Additionally, you can also use our advanced sample apps that is integrated with PiP mode and let us know should your issue still persist there.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2WxEhQ:ref

rmodi

unread,
Feb 22, 2022, 9:34:26 PM2/22/22
to Interactive Media Ads SDK
Thank you Michael.
I have had success in integrating with AVPlayerViewController now.

- We are supposed to check if we are in PIP before calling [adsManager start].  
From what I am seeing if I am in PIP and don't call [adManager start] the ads still play in the PIP window.  Is this a bug?  
If it did work as I thought it would - like not playing the ad  how would things work when I don't call  [adsManager start]  in PIP  - will the content start playing basically skipping ads?

Thank you

rmodi

unread,
Feb 22, 2022, 9:38:44 PM2/22/22
to Interactive Media Ads SDK

-There is one problem that still exists with PIP for us

In the app when the user enters PIP we dismiss the View controller holding the player etc but we don't deallocate it.. we save it so we can restore it when the user ends PIP

When a midroll starts it will play the mid roll in the PIP window but then it takes really really long for the content to start playing again.

I modified the Advanced Example a bit to show you the problem(attached the VideoViewController.m file). Our integration is with AVPlayerViewController and we see the same problem.

To see the problem, play the AdRules option, after preroll plays go into PIP, hit the Tags button. The problem will be in the PIP window after the midroll is done

Thank you very much


VideoViewController.m

IMA SDK

unread,
Feb 23, 2022, 4:23:11 AM2/23/22
to raha...@gmail.com, ima...@googlegroups.com

Hello Rahat,

 

Thanks for your response.

 

We are supposed to check if we are in PIP before calling [adsManager start].  

- To clarify, you need to ensure that you only call [adsManager start] when your video is in standard playback mode as ads cannot be started in PiP

 

From what I am seeing if I am in PIP and don't call [adManager start] the ads still play in the PIP window. Is this a bug?

- I am uncertain of this behavior because as far as I know if you did not call [adManager start] then Ad playback would not start.

 

If it did work as I thought it would - like not playing the ad how would things work when I don't call [adsManager start] in PIP - will the content start playing basically skipping ads?

- From my understanding this should be the expected behavior in relation to the previous question.

 

Would you be able to share with us the modified sample app itself so we can test on our end? It will also be appreciated if you can share screen recording of the behavior that better illustrates the issue and the step by step procedure to reproduce it.

 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

 

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002WxEhQQAV&entry.80707362=00094841

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

rmodi

unread,
Feb 23, 2022, 12:28:54 PM2/23/22
to Interactive Media Ads SDK
The problem where the midrolls, post rolls playing  in PIP window is in the AdvancedExample. No changes needed to see this problem.
On ipad - Select AdRules
Click the PIP button
Midroll and post rolls will play in the PIP window.
Thank you

IMA SDK

unread,
Feb 24, 2022, 1:28:52 AM2/24/22
to raha...@gmail.com, ima...@googlegroups.com

Hello Rahat,

 

I have tested using this advance sample app without any modification and could not see what you are reporting. Does this occur in specific devices only? If so kindly provide the device details.

 

As previously mentioned, it would be best if you can share with us the screen recording of the behavior you are encountering for faster progression of the investigation showing the steps to reproduce the behavior so we can replicate the issue exactly how it should be done.

Regards,

rmodi

unread,
Mar 2, 2022, 1:12:18 PM3/2/22
to Interactive Media Ads SDK
Hi Michael,
Attaching a recording done on ipad Air 2 , ios version 14.4.1
Steps
Play the advanced sample
Select adRules
After the Preroll finishes select the PIP button
You will see that the midroll plays in the PIP window even though [adsManager start] is not called as a result of being in PIP

I have attached the file to the link u provided earlier.
Thank you
Rahat

IMA SDK

unread,
Mar 2, 2022, 10:45:07 PM3/2/22
to raha...@gmail.com, ima...@googlegroups.com

Hello Rahat,

 

Thank you for providing the requested details. From what I saw in the video, it should be the expected behavior. The [adsManager start] is already called at the beginning of the content, hence playing the pre-roll. It will then continue to play the mid-roll and post-roll if there is, depends on the configuration of the requested ad tag. It is just you cannot start the whole thing (starting adsManager) on a PiP mode as indicated here.

 

Hope this makes it clear. Let us know should you have further questions.

Regards,

rmodi

unread,
Mar 2, 2022, 11:29:42 PM3/2/22
to Interactive Media Ads SDK
Thanks
The advanced sample - PostRoll(Only a post roll no pre-roll or mid-roll tag )is not loading. - so I cannot run this.
What happens in that case?  if I start playing then put in PIP then post roll comes and we don't call adsManager start?

IMA SDK

unread,
Mar 3, 2022, 5:37:55 AM3/3/22
to raha...@gmail.com, ima...@googlegroups.com

Hello Rahat,

 

In the event that you only have post-roll on your ad request, you can still request the ad and call the adsManager start beforehand, and then you may switch to PiP mode. The ads will be loaded but the content would start first and the post-roll ad will play right after the content finishes.

Regards,

Reply all
Reply to author
Forward
0 new messages