# Java API to inject CC

**URL:** https://community.wowza.com/t/java-api-to-inject-cc/47655
**Category:** Wowza Streaming Engine
**Created:** [November 1, 2016, 5:00pm UTC](https://community.wowza.com/t/java-api-to-inject-cc/47655 "2016-11-01T17:00:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Toan\_Tran](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@Toan\_Tran](https://community.wowza.com/u/Toan_Tran)
#### Post date: [November 1, 2016, 5:00pm UTC](https://community.wowza.com/t/java-api-to-inject-cc/47655/1 "2016-11-01T17:00:04Z")

</div>

Hello,

We have a bunch of .mp4 files along with their associated .ttml open caption files. We need to be able to dynamically load and broadcast these files based on a dynamic schedule without interrupting the stream.

I was able to follow the tutorial here ([https://www.wowza.com/docs/how-to-use-ipublishingprovider-api-to-publish-server-side-live-streams](https://www.wowza.com/docs/how-to-use-ipublishingprovider-api-to-publish-server-side-live-streams)) to stream individual mp4 files at specified times. However, I could not find an API method to inject an associated caption files. I found this page ([https://www.wowza.com/docs/how-to-configure-closed-captioning-for-live-streaming](https://www.wowza.com/docs/how-to-configure-closed-captioning-for-live-streaming)), which doesn’t talk about Java API but rather a config setting. At the end of the page was a sample package that shows some API calls, but that section was described as “legacy”. I could extend that, but since it’s “legacy”, I fear that whatever API the module depends on may be unavailable with later versions of WMS.

Is there a way (beside the “legacy” way) to tell the system to load a ttml file immediately following a PublishingProviderMediaReader call?

Any assistance is much appreciated. Thank you in advance.

P.S. - This is my first time posting to this forum; please forgive me if I’m not following any established etiquette.

---

<div class="post-metadata">

### Author: ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)
#### Post date: [December 22, 2016, 5:01pm UTC](https://community.wowza.com/t/java-api-to-inject-cc/47655/2 "2016-12-22T17:01:01Z")

</div>

Hi slacker,

You can use the [injection code](https://www.wowza.com/docs/how-to-inject-cue-points-or-metadata) in our article site to add AMF data into your live stream. You can also look into the [example code](https://www.wowza.com/downloads/forums/closedcaptionlive/PublishOnTextData.zip) that takes static text and injects them as closed captions. This code is mainly used for testing.

Michelle
