I have used the tutorials on HTTPProviders and Modules to send text based metadata into a module and insert it as timed ID3 metadata in an HLS stream. I used these tutorials:
https://www.wowza.com/docs/how-to-inject-timed-metadata-using-a-wowza-streaming-engine-http-provider
Now, I want to do the same thing but send an AMFDataByteArray from the HTTP Provider to the Module. In my HTTP Provider I have:
AMFDataByteArray amfDataBytes = AMFDataByteArray.wrap(data);
// this outputs a size of 90166!!
WMSLoggerFactory.getLogger(CLASS).info("sendBinaryMetadata amfDataBytes BEFORE SENDING SIZE - " + amfDataBytes.size());
AMFDataObj amfDataObj = new AMFDataObj();
amfDataObj.put("wowzaConverter", "basic_string");
amfDataObj.put("payload", amfDataBytes);
In the module I have:
AMFData amfDataItem = dataObj.get("payload");
getLogger().info("--> MODULE binary amfDataItem.toString " + amfDataItem.toString() );
AMFDataByteArray amfBytes = (AMFDataByteArray)amfDataItem;
I get an error here that AMFDataItem cannot be cast to AMFDataByteArray. However, if you look at the logging line above that, the function “amfDataItem.toString()” outputs:
--> MODULE binary amfDataItem.toString {Obj[]: endian: "bigEndian", length: 90166.0, position: 90166.0, objectEncoding: 3.0}
That “length” of 90166 is the exact size the byte array I am sending, so the data MUST be here. How do I get it!?