Playing html template on custom client

There are two things, that I can see. First it said, that you miss the update() and play() javascript functions in your code. Second you should send a cg stop command instead of the remove.

To create a proper HTML template see this tutorial.