How could I check if channel is live using javascript

Here is a whole/complete example and/or product to use