Shaka Player Admanager MediaTailor Integration Issue

App Name: Your App Name [e.g., Netflix]
App Link on Amazon Appstore (found through Developer Console > Actions column in App List > View on Amazon.com): Your App Link [e.g., Netflix - App on Amazon Appstore ]

I am using Shaka Player 4.8.5-1.2 with HLS live stream and HLS ads and trying to implement the admanager for media tailor SSAI with client side ad tracking as seen here in the media tailor docs Client-side ad tracking - AWS Elemental MediaTailor . I have been implementing the Shaka Player admanager as seen here in the Shaka docs JSDoc: Tutorial: Monetization with Ads .

I have run into two problems that I can’t seem to solve. One is that when an ad first tries to play it crashes the app with a sigabrt with no other logs. Later attempts to play an ad do work when I reload the app, but the crashes happen with some frequency. It seems to be related to my setup of the admanager.

I have also run into a problem where I try to fire the admanager event listeners when the ad plays or progresses the event listeners don’t trigger even if the ad plays fine on the video. I have verified that media tailor is returning the appropriate tracking json data from the tracking url so I believe it is a problem with my implementation.

I have added my Shaka.ts file that is based on the one provided in the dev docs.

Any help or information that you may have is appreciated. Thank you

ShakaPlayer.ts (21.2 KB)

Hi @Nick_Taylor ,

Thank you for your question about the Shaka Player AdManager MediaTailor integration.

Our team is looking into it and will provide an update as soon as we have more information.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

Hi @Nick_Taylor ,

Thanks for the details. One thing to verify is how the Shaka AdManager is initialized. MediaTailor client-side tracking requires a separate ad container element instead of passing the video element into initMediaTailor. Using the video element as the container can cause the initial ad crash and prevent ad lifecycle events from firing.

Recommended pattern:

const adContainer = document.createElement('div');
player.getAdManager().initMediaTailor(adContainer, player.getNetworkingEngine(), videoElement);

Docs for reference: Shaka – Ad Monetization, MediaTailor – Client-side tracking
Please give this a try and let me know how it works on your side. Happy to help further if needed.

Warm regards,
Aishwarya

Hi Aishwarya thanks for the reply. I implemented what you recommended for the adcontainer. Unfortunately I am still having the same issues with the frequent crashing and lack of ad event firing.

I find that when I first start the simulator and run the app it will crash when it first encounters an ad, but on reload of the app the ads play fine but without the ad events firing. Its only when I reset the simulator and first play an ad that it fails.

Hi @Nick_Taylor,

Could you share any specific error messages the crash logs or console output? This would help narrow down the root cause.

Thanks!

Hi Aishwarya,

Yes I have this crash log here that I can’t really understand. I symbolicated the acr file and got this out put. Let me know if you need more

#0 0x0000007f907c1d58 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/lib/libc.so.6
#1 0x0000007f9077de10 in raise () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/lib/libc.so.6
#2 0x0000007f9076b024 in abort () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/lib/libc.so.6
#3 0x0000007f0c3d7278 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-w3cmedia-lib-1.so.1
#4 0x0000007f8e27ad98 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#5 0x0000007f8d01c1c8 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libreact-native-0.72.so.0.72
#6 0x0000007f8cc5d27c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#7 0x0000007f8cc866b4 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#8 0x0000007f8cc926dc in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#9 0x0000007f8cc9525c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#10 0x0000007f8cc68980 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#11 0x0000007f8cc69188 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#12 0x0000007f8cca0db8 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#13 0x0000007f8cc92e9c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#14 0x0000007f8cc9525c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#15 0x0000007f8cc68980 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#16 0x0000007f8cc59a78 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libhermes-0.12.0.so.0.12.0
#17 0x0000007f8d01abe8 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libreact-native-0.72.so.0.72
#18 0x0000007f8e160fbc in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#19 0x0000007f8e162ae0 in volta::react::Callback::invokeInternal(std::function<std::vector<std::unique_ptr<volta::react::CallbackParamInterface, std::default_deletevolta::react::CallbackParamInterface >, std::allocator<std::unique_ptr<volta::react::CallbackParamInterface, std::default_deletevolta::react::CallbackParamInterface > > > ()> const&) () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#20 0x0000007f8e261324 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#21 0x0000007f8e2f63cc in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#22 0x0000007f8dfe7ec8 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#23 0x0000007f907c508c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/lib/libc.so.6
#24 0x0000007f8e2f873c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#25 0x0000007f8e2f9848 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#26 0x0000007f8e3ff5d8 in utils::TaskThread::processTasksLoop() () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libkeplerscript-2.so.2
#27 0x0000007f8feff550 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/usr/lib/libstdc++.so.6
#28 0x0000007f907bffe4 in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/lib/libc.so.6
#29 0x0000007f9082799c in ?? () from /private/var/folders/j2/d7y275q91x7bjfts5kgxy_v40000gq/T/temp_acr_debugFs/lib/libc.so.6

Hi @Nick_Taylor,

To investigate the Shaka Player AdManager MediaTailor integration issue (app crashes on first ad play and ad event listeners not firing), please collect logs from your device following the Vega documentation: Debug Your App | Design and Develop Vega Apps ,

Also provide:

  • Device model and Vega OS version

  • Crash logs from the first ad play (sigabrt details)

  • Console output when ad events fail to fire

Please attach all collected logs and we’ll investigate further.

Thanks,
Aishwarya

Hi @Nick_Taylor

We’ll close this topic due to inactivity.
If you are still facing this issue and would like to share your logs as requested by @amen , you can open another topic.

Warm regards,
Ivy