- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Before the last update I was able to play wav files using this code
now with the latest update of xdk I am not able to play wav files
script placed in the head tag of the html5 page
<script> function EvalSound(soundobj) { var thissound=document.getElementById(soundobj); thissound.Play(); } </script>
code placed in body of the html5
<embed src="bob.wav" autostart=true width=100 height=100 id="sound1" enablejavascript="true">
can you tell me what code I would use to play sound in XDK latest version
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some questions about your example. Do you ever call the function 'EvalSound'? Also, the id of the embed element (sound1) doesn't match the id in the call to getElementById (soundobj), so I'm not sure if the javascript code is supposed to be related to the embed element or not.
If you're just trying to play it as an HTML element, I would recommend looking into the audio element - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I played it using the audio element but it does not play in the emulator.. however when I push it to the test server in app viewer it plays. Any idea of how I can get it played with the emulator. I remember the same thing used to happen with the video tag in the previous version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
my video code shows in xdk but does not play in the emulator
<video width="320" height="240" controls>
<source src="song.mp4" type="video/mp4">
<source src="song.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page