Migrating from AMP CAF Receiver to AMP Cast SDK
In the past, AMP’s Premiere license provided a simple CAF Receiver for customers to customize and improve based on their needs. After listening to our customers, we decided to further standardize our Chromecast Receiver solution to enhance our customer’s experience.
This guide shows how to migrate from the older version of AMP’s CAF Receiver to AMP Cast SDK.
The old AMP CAF Receiver was distributed as a zip package and included the following folders and files:
We advise you to migrate your receiver to a single HTML file. To do so, we recommend starting with a simple receiver like the previous example. Then:
AmpCafReceiverConfig.jsfile, copy all your configuration into the sample Config Block.
AmpCafReceiverStyles.cssfile, copy all your css and paste it into the style block of the sample.
If you desire to maintain your
AmpCafReceiverStyles.css files separated from your main HTML you still can:
AmpCafReceiverConfig.jsby importing it inside a module as previously implemented in the old AmpCaf receiver:
AmpCafReceiverStyles.cssby importing it as a regular CSS file.
If, for some reason, you have a custom code in your receiver, you can still copy it a moving it to your new receiver. However, accessing Google’s CAF library directly is not advised. If your custom code is accessing the CAF Framework directly, you’ll need to rewrite it to use AMP Cast standardized API to ensure your code doesn’t conflict with AMP Cast.