I have a timer that starts an Task which get some information from an Database.
Based on this information i update the UI with Application.Update.
That all works great.
From time to time (depending on the the data i get) i have to play a sound file.
I try this with:
audioHelp.SourceURL = url;
Application.RunInContext(this, () =>
{
audioHelp.Play();
});
audiohelp is Wisej.Audio
When i bind this function to an button.Click event all is working fine.
But when i try to do so in the “Background”-Task there is no sound playing.
Can please someone give me an hint where to find my error ?
Many thanks
Hi Tom,
Test this (sample) :
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Application.StartTask(() =>
{
//test URL :-P
audio1.SourceURL = "https://il.ilill.li/force/FZAX5pZ80S/";
audio1.Play();
});
}
For more information with multi-threading, you can go there: https://docs.wisej.com/docs/concepts/background-tasks
Best,
Kevin(ITG)
Got it.
Perhabs someone is stumbling over the same problem.
The Solution was in the settings of the Chrome Browser.
WebsiteSettings: Unsecure Content : Unblock
After changing that the Backgroundtask plays Audio as intended.
Please login first to submit.