Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>You cannot play a file on a web page using the <a href="http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx" rel="nofollow noreferrer">System.Media.Soundplayer</a> class !!!</strong></p> <h2>Reason</h2> <p>It will play sound on server-side not client-side. </p> <p>As mentioned as in below links<br> - <a href="http://www.dreamincode.net/forums/topic/27846-problem-with-the-c%23-systemmediasoundplayer-class-on-a-web-host/" rel="nofollow noreferrer">Problem With The C# System.Media.SoundPlayer Class On A Web Host</a><br> - <a href="https://stackoverflow.com/questions/5775832/what-is-the-most-compatible-way-of-autoplaying-sound/5775984#5775984">What is the most “compatible” way of autoplaying sound</a> ?</p> <h2>Solution</h2> <ul> <li>Use <a href="http://www.aspnetaudio.com/" rel="nofollow noreferrer">ASP.NET audio control</a>.</li> <li>Other <a href="https://stackoverflow.com/a/5775984/468718">SO Answer</a> over this same requirements.</li> <li>Use Any other Flash or Silverlight based plugins.</li> <li>Use html embed tag or html5 audio tag. Examples can be seen on <a href="http://www.w3schools.com/html/html_sounds.asp" rel="nofollow noreferrer">w3schools</a></li> </ul> <h2>Html5-based audio solutions (works on modern browsers only)</h2> <ul> <li><code>&lt;embed&gt;</code> tag: The <code>&lt;embed&gt;</code> tag defines a container for external (non-HTML) content. (It is an HTML5 tag, invalid in HTML 4, but works in all browsers). </li> </ul> <pre><code>&lt;embed height="100" width="100" src="horse.mp3" /&gt; </code></pre> <ul> <li><code>&lt;object&gt;</code> tag: The <code>&lt;object&gt;</code> tag can also define a container for external (non-HTML) content.</li> </ul> <pre><code>&lt;object height="100" width="100" data="horse.mp3"&gt;&lt;/object&gt; </code></pre> <ul> <li><code>&lt;audio&gt;</code> tag: The <code>&lt;audio&gt;</code> element is an HTML5 element, invalid in HTML 4, but it works in all browsers.</li> </ul> <pre><code>&lt;audio controls="controls" height="100" width="100"&gt; &lt;source src="horse.mp3" type="audio/mp3" /&gt; &lt;source src="horse.ogg" type="audio/ogg" /&gt; &lt;embed height="100" width="100" src="horse.mp3" /&gt; &lt;/audio&gt; </code></pre> <p>Please note the problems with html5-based solutions you must convert your videos to different formats.<br> - The <code>&lt;audio&gt;</code> element does not validate as HTML 4 and XHTML.<br> - The <code>&lt;embed&gt;</code> element does not validate as HTML 4 and XHTML.<br> - The <code>&lt;embed&gt;</code> element cannot "fall-back" to display an error. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload