Hi, I’m trying to make a very basic audio player widget, which takes a (specialisation of) System.FileDocument Entity and is supposed to generate an HTML5 Audio tag for this file. This is my one of not so many attempts to build a widget so I might be missing something really basic but in the Client API it says: The file property allows a user to configure a file from an object that is a specialization of System.File. It is passed as a DynamicValue<FileValue> prop to a client component. So I got my property type=”file” here. DynamicValue<FileValue> is used to represent files. A file can be configured only through a file property. FileValue is defined as follows:
export interface FileValue {
uri: string;
} Which led me to the following code: On the left the Player component which receives the uri to the audiofile. When I try to run this I just get Unknown widget 'mendix.audioplayer.AudioPlayer'. error so this does not seem to work. Also when I try to import FileValue from “mendix” nothing is found. I guess my mistake is in the path this.props.audiofile.value.uri but from the documentation it seems that: - this.props.audiofile > DynamicValue<FileValue> - .value > should give me the FileValue - .uri > should give me the path to the file. What am I doing wrong?
↧