call Javascript from vb.net

0
0

I am trying to use the 2nd method in https://wisej.com/docs/html/JavaScript.htm  “Embedded resource”  to add the playing of sound to to a test app.

function beep() {
var snd = new Audio(“….”);
snd.play();

}

The instructions say to change the js file (Test.js) to the build action of “Embedded Resource”.  So I did that, but what is the equivalent of AssemblyInfo.cs?  I don’t see this in my project.

Thanks,

Shawn

  • You must to post comments
0
0

Try this 🙂

http://demo.wisej.com/smoothie

I added the Audio control and set it to “http://www.zedge.net/d2w/4/1331474/998028275/view/?mp3”.

If you make the Audio control not visible, add this.audio.CreateControl() when the page or window is loaded because Wisej doesn’t render controls that have not been made visible at least once (will add a an enhancement to always create the Audio control also when not visible).

 

  • Shawn Ramirez
    That is pretty cool! Thanks, I got it working with help from this example
  • consystems
    404 – File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
  • You must to post comments
0
0

Thank for the help.

I am trying to play a sound just once, it is an audible notification so to speak.

Dim x As New Wisej.Web.Audio
x.SourceURL = “/Tone.mp3”
x.Play()

I tried the above code but I don’t hear anything, so I am assuming I am doing something wrong.

Could you lead me in the right direction?

Thanks

  • You must to post comments
0
0

It’s under “My Project” but VS hides for VB.NET projects. Select “My Project” then click “Show All Files” on the toolbar above the solution explorer.

The attribute “‘ <Assembly: WisejResources(ExcludeList: “”)>” is already there commented out.

Another way to add a js file, it to simply add it to Default.html. The difference is that when it’s embedded you don’t have to deploy the js file. When it’s linked in the html page you have to deploy it as you’d do with an asp app.

  • Luca (ITG)
    Forgot to add that we have an Wisej.Web.Audio component. It extends the abstract Wisej.Web.Media. It lets you control play, stop, volume and it fires server events when the volume changes and to update the server on the play progress. I believe you can also set the starting time.
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.