Can I send audio or video (binary) content via a PubNub message?

The JSON format doesn't support binary data natively. Binary data has to be escaped (Unicode characters in double quotes using backslash escapes) in order to be placed into a string element in JSON.

Base64 encoding is a common method to escape binary data with relatively high processing overhead and 33% data size increase (3 bytes turn into 4 characters). This method is acceptable for relatively small binary content (all PubNub accounts are able to send messages up to 32KB).

There are a few strategies for sending messages larger than 32KB.