Author Topic: IMatch plays no sound, but browsers does  (Read 1572 times)

sinus

  • Global Moderator
  • *****
  • Posts: 4228
  • IMatch-User since 2001 (IMatch 3.6)
IMatch plays no sound, but browsers does
« on: December 13, 2016, 12:19:55 PM »
Hi all

(Mario, you have better stuff to do, you must of course not answer!!  :D)

I have a complicted script in JavaScript.
Basically it is a countdown-timer for several occasions, like x-mas and so on.

The Script is almost for sure horrible, because I took parts from here and there.
But, after all, it works all with Firefox, Chrome and Edge.

And - it works also in IMatch in a panel.
It looks also the same.

One problem though:
in all browsers it works the same and it works also with sound.
In IMatch all works, but not the sound. I have simply no sound in IMatch.

Is there something, what I must think about it or is there in IMatch something special with sound?

I think, it makes no sense, to put all the code, but the important code is this:

Code: [Select]
var aAudio = new Audio('911.WAV');  
                 aAudio.play();

All files are in the same and correct IMatch-folder.
As said, if I open the app.thm instead with IMatch, but with a browser, the sound plays perfect.

Has someone an idea?

In the attachement you see on the left the script within Chrome, sound plays, an on the right inside IMatch, sound plays not (of course I run IMatch alone, not both together)





Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 27213
Re: IMatch plays no sound, but browsers does
« Reply #1 on: December 13, 2016, 12:59:44 PM »
Does the MP3 Player app included in IMatch work with audio on your system?

sinus

  • Global Moderator
  • *****
  • Posts: 4228
  • IMatch-User since 2001 (IMatch 3.6)
Re: IMatch plays no sound, but browsers does
« Reply #2 on: December 13, 2016, 01:07:26 PM »
Does the MP3 Player app included in IMatch work with audio on your system?

Yes, the mp3-player works very good, cool app.

Normally I would say, that my code is surely wrong.
But it irritates me, that it works with 3 different browsers, but not within IMatch.

But it is only a question, not important, I can try more and more ... finally I go only your way, what you have proposed once, lerning JS instead WinWrap Basic.  ;D
Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 27213
Re: IMatch plays no sound, but browsers does
« Reply #3 on: December 13, 2016, 02:04:33 PM »
You don't show your script or the HTML page it contains.

Did you follow the example in the help and added all the required headers, especially the "edge" header to your HTML file?
The embedded browser in IMatch is based on the browser embedded in Windows, and this has additional requirements and safety features when running inside an application.

If the MP3 player works, nothing is wrong with IMatch.
You need to setup your HTML file correctly to make it work, that's all.

You can use the MP3 player HTML file as an example.