This works and the widget is able to show the title and playback the audio. However, it does not allow adding multiple tracks to the widget because only the last pair is recognized.
I guess that in order to comply with the docs, the PreviewWidget's add_attribute_value method of the bindings should be checking for a variant of type array (line #89 of preview-widget.cc) and handle it instead of checking for a dict, as it currently stands.
I eventually got it working.
I had to pass a an object as the second argument to the add_attribute_ value() method. Like this:
audio.add_ attribute_ value(
"title" : result. get("title" ),
"source" : result. get("audio_ preview_ url")
"tracks",
{
}
);
This works and the widget is able to show the title and playback the audio. However, it does not allow adding multiple tracks to the widget because only the last pair is recognized.
I guess that in order to comply with the docs, the PreviewWidget's add_attribute_value method of the bindings should be checking for a variant of type array (line #89 of preview-widget.cc) and handle it instead of checking for a dict, as it currently stands.