Jump to content

HTML5 Audio


Rav

Recommended Posts

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...