I'm working on a tvOS application that plays video content using TVMLKit/TVJS. I'm trying to integrate Google IMA SDK to show pre-roll, mid-roll, and post-roll ads in my app.
Here’s what I’ve done so far:
Video playback is handled through JavaScript in application.js.
Ads are managed in Swift using Google IMA SDK.
I use the evaluateJavaScript bridge to control video playback from Swift.
I pause and resume the TVJS player (Player object) using a function like startPlayingVideo(value) from Swift based on the ad lifecycle.
Current Flow:
When the video is about to start, I call loadAds() from JS.
This presents a Swift ViewController that handles IMA ad requests.
On adsManagerDidRequestContentPause, I pause the video using JS via the bridge.
On adsManagerDidRequestContentResume, I resume the video.
The Issue:
This setup doesn't behave consistently:
Sometimes the ad plays in the background and video started playing as well but can not see the ad.
Not able to see the post-roll ads
Relevant Code Snippets:
application.js
function startPlayingVideo(value) {
if (playerReference != undefined) {
if (value == true) {
playerReference.play();
else {
playerReference.pause();
}
}
}
function playVideo(videoURL) {
setup playerReference, push mediaItem, etc.
loadAds();
player.present();
}
AppDelegate.swift
let loadAds: @convention(block) () -\> Void = {
DispatchQueue.main.async {
let adManagerVC = ViewController()
AppDelegate.tvController?.navigationController.present(adManagerVC, animated: true)
}
}
let updateVideoPlayTime: @convention(block) (Double) -\> Void = { time in
CustomContentPlayhead.shared.currentTime = TimeInterval(time)
}
ViewController.swift
func adsManagerDidRequestContentPause(\_ adsManager: IMAAdsManager) {
showAdUI()
playerViewController.player?.pause()
}
func adsManagerDidRequestContentResume(\_ adsManager: IMAAdsManager) {
hideAdUI()
// Expecting JS video to resume via bridge
}
And yeah my IMSDK Implementation is working fine if I am using it with swift AVPlayer.
What I Need Help With:
Best practice for coordinating video playback between JS (Player) and Swift (IMAAdsManager).
How can I sync the playhead reliably between JS and Swift?
Is there a better way to pause/resume TVJS player from Swift during ad lifecycle?
How to reliably insert mid-roll ads when the playback is primarily controlled in JS?
Any insights, code examples, or recommended architecture improvements would be greatly appreciated!
Apple Developers
RSS for tagThis is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
After the last OS26 developer beta update the watch series 6 battery drains fast, in less than two hours life. I visited Apple Store , they said the battery was dead so I had to buy new watch series 10
The same issue happened in the new watch, the battery meter shows 50% after 1 hour
Right now I’ve downgraded my update version to beta 11 until I can find a solution
Topic:
Community
SubTopic:
Apple Developers
I have updated my iPhone 14 Pro to iOS 26 without any problems.
I also have AirPod Pro A2698 version 7E93.
The new update of the firmware is not shown.developer mode is activated.on the pre-release is AirPod Pro visible if connected but no possibility for an update.what am I doing wrong or is there any thing I have to wait for thank you
Topic:
Community
SubTopic:
Apple Developers
After doing a software update I can only view iMessages older than 12hrs (from a single contact) if the other person replies to and older message. Every time I leave the Massages app and go back in the issue occurs again.
Hi,
Looking for guidance. Since RCS messaging became available via Apple I’ve used Messsages as my default application irrespective of whether sending messages to an iPhone or an Android handset.
I’ve updated to the iOS 26 developer beta and RCS messaging is not available. When I check on messages under settings it constantly states ‘waiting for activation’
Is RCS not usable until the full version of iOS 26 is released in September? My network is EE in the United Kingdom
Topic:
Community
SubTopic:
Apple Developers
I downloaded Xcode Beta 26 and built the POS code repository project. However, an error appeared: unable to find the module dependency 'minizip'. No changes have been made to the repository since upgrading to iOS 18.0. Is this a new issue with Xcode 26, and what are the resolution steps?
Topic:
Community
SubTopic:
Apple Developers
Hey everyone,
I'm currently working on Carplay intergration in my audio app. While exploring Apple Music on carplay, i found this kind of display:
This is a grid of items in a list (i'm on iOS 18 when testing this), but i didn't find anything in developer documentation that would allow me to have this kind of display.
Is this something apple specific, or can i achieve this ? I tried using the grid template but it's not as pretty, nor as flexible as this.
Thanks for your help !
Under multiple display screens (left and right screens), when a commonly used app application clicks "Window" -> "Move to..." When it comes to this, the app cannot be completely moved to the other window but instead moves to the middle of the two Windows for display. Is this a bug of the system?
(It’s my first post so idk if i’m in the right place)
I have been testing iOS 26 since launch and it is great (kind of buggy but that’s to be expected). I have come across an issue though : government and banking apps either crash or get stuck on splashscreen on launch.
Do you think it is something that is gonna be fixed on the apple side of things, or that it’s gonna be for the developers to figure out compatibility ? (I am asking because governments don’t tend to be quick to fix problems so i am hoping it not the latter)
Any idea?
Topic:
Community
SubTopic:
Apple Developers
I noticed the water lock feature isn’t in the control center after updating to WatchOS 26
Topic:
Community
SubTopic:
Apple Developers
Hey everyone anyone having any issues with some apps not loading or opening since upgrading
Hi, I’ve recently installed the iOS 26 DB, and I’m experiencing heating issues on my iPhone. Is there a fix to this? Also, is it a bug or a feature, that I can’t remove certain sections in the Photos app rather than rearranging them. Pls lemme know. Thanks.
Hi,
I made backup as Apple suggested. Then I updated to iOS 26 developer beta. Because it was slow and laggy I downgraded back to 18.5 with iTunes on MacBook. After restoring backup I cannot get history (recent calls) working. I tried to change region, airplane mode, reset network settings, change date and time, reboot (3x). Basically I guess I tried everything I cloud find online. Still call history doesn't work. Is there any fix for this? Before restoring backup I reinstalled everything in restore mode.
Topic:
Community
SubTopic:
Apple Developers
Due to it's new UI with transprent theme, sometimes its lacked between switching the apps.
Please add AI eraser in photos app so that we can experience new ai tool.
Due to india region, unable to use wallet options, Please add some options so that we can add cards and use this option.
I just upgraded to iOS 26.0 Now when I use car play, the text messages do not show up, only the notification tone on my phone alarms. So now when I get texts while driving, I need to read my phone to read the text. I tried all the solutions within settings but this is a BIG DRAWBACK compared to the old iOS.
Topic:
Community
SubTopic:
Apple Developers
updated my iPhone 15 to iOS 26 last night and now when I put the alert slider on silent, my notifications won’t vibrate. Even after checking all settings in sounds and haptics to be correct, it still isn't vibrating on silent.
Also the apple music search bar is a little flimsy? Merging the text and microphone options
Topic:
Community
SubTopic:
Apple Developers
我的iPad 7居然不支持iPadOS 26
Topic:
Community
SubTopic:
Apple Developers
iPhone 16 Pro Max on iOS 18.5 before installing iOS 26 beta had no issues connecting to wired (there’s no wireless) CarPlay in my 2022 Honda Civic Sport. Now with IOS 26, my car recognizes that my phone is connected and asks if I want to use CarPlay and I click yes but it does nothing. I reset my head unit, reset all iPhone settings, checked different iPhone settings, tried different cables, can’t seem to determine what part of iOS 26 is causing the problem. Anyone have any ideas before I roll back to 18.5?
I am trying to enroll the Apple Developer Program but it says "We are unable to process your request. An unknown error occurred."
Please check the issue.
Topic:
Community
SubTopic:
Apple Developers
been testing out ios 26 since it came out and now all of a sudden everytime it boots only into recovery and wont do anything else. recovery says no known issues found.