fire-app-builder
fire-app-builder copied to clipboard
Fire App fails with only 1 HLS item in the feed list
Leaving this here as we have gotten little to no response in the Amazon developer forums.
We are a broadcast entity and sometimes we only have 1 live video playing and but FireApp Builder will not show any other feed item if only one exists in the live feed. History of Support forum engagement: https://forums.developer.amazon.com/questions/181328/fireapp-builder-with-only-1-live-hls-video-in-the.html
We've been told the bug has been fixed but not deployed yet. When will this bug fix be pushed? Thanks
In the meantime, before the changes are released, please try replacing these lines referenced here https://github.com/amzn/fire-app-builder/blob/master/DynamicParser/src/main/java/com/amazon/dynamicparser/DynamicParser.java#L483-L486
To the following code snippet:
Object queryResult = getParserImpl(parserType).parseWithQuery(input, query);
// Because XML Feeds are dynamically structured, some fields can be single or multiple.
// XML Parser will return single objects as a Map and multiple objects as an Array.
// We need to account for the case where we expect an Array but get a Map instead.
if (queryResult != null && queryResultType == ArrayList.class
&& queryResult instanceof HashMap) {
Log.d(TAG, "Casting HashMap into ArrayList");
ArrayList<Object> newResult = new ArrayList<>();
newResult.add(queryResult);
queryResult = newResult;
}
// Parse the data and cast it to the expected result type.
Object parseResult = queryResultType.cast(queryResult);
I’m not quite sure if this will solve your issue because you filed a lot of issues and we may have fixed some but it still hasn’t been released yet. Please give it a try and let us know if that works for you for now. Thanks!
In the meantime, before the changes are released, please try replacing these lines referenced here https://github.com/amzn/fire-app-builder/blob/master/DynamicParser/src/main/java/com/amazon/dynamicparser/DynamicParser.java#L483-L486
To the following code snippet:
Object queryResult = getParserImpl(parserType).parseWithQuery(input, query); // Because XML Feeds are dynamically structured, some fields can be single or multiple. // XML Parser will return single objects as a Map and multiple objects as an Array. // We need to account for the case where we expect an Array but get a Map instead. if (queryResult != null && queryResultType == ArrayList.class && queryResult instanceof HashMap) { Log.d(TAG, "Casting HashMap into ArrayList"); ArrayList<Object> newResult = new ArrayList<>(); newResult.add(queryResult); queryResult = newResult; } // Parse the data and cast it to the expected result type. Object parseResult = queryResultType.cast(queryResult);
I’m not quite sure if this will solve your issue because you filed a lot of issues and we may have fixed some but it still hasn’t been released yet. Please give it a try and let us know if that works for you for now. Thanks!
Levon, Thanks a ton and I will give this a shot and report back ASAP. Best