Rav Posted May 23, 2016 Posted May 23, 2016 Hello, I have a simple HMTL5 file that shows audio player and works properly: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Report</title> </head> <body> <audio controls><source src="file:///C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\HTML5 Audio\files\tada.wav" type="audio/wav">Your browser does not support the audio element.</audio> </body> </html> I failed to embed it into UniGui. As far as I understand I need to use UniHTMlFrame component. 1) When I place the code into it: <audio controls><source src="file:///C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\HTML5 Audio\files\tada.wav" type="audio/wav">Your browser does not support the audio element.</audio> I receive Java script error. 2) When I copy the tada.wav to "c:\" and change the code accordingly: <audio controls><source src="file:///C:\tada.wav" type="audio/wav">Your browser does not support the audio element.</audio> No error Java script is shown but instead of a player I see a white box. 3) When I use HTMLFrame demo and place there the same code: <audio controls><source src="file:///C:\tada.wav" type="audio/wav">Your browser does not support the audio element.</audio> Player appears normally but doesn't play the file Quote
bugra Posted May 23, 2016 Posted May 23, 2016 Hi; After put your sound file in files folder src of source just must be "files/tada.wav" also you can add src into a audio rather than adding source element in it if you only play one resource. <audio controls src="files/tada.wav" type="audio/wav">Your browser does not support the audio element.</audio> Quote
Rav Posted May 23, 2016 Author Posted May 23, 2016 Got another question. I want this audio controls panel is automatically resized along with UniHTMLFrame where it is located. As I read it can be done using styles like in this example. Can I do the same with UniGui? Quote
Sherzod Posted May 24, 2016 Posted May 24, 2016 HI, ... like this: <audio style="width: 100%" controls src="files/tada.wav" type="audio/wav">Your browser does not support the audio element.</audio> Best regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.