Question

Derick Campbell [MSFT] on Mon, 24 Feb 2014 22:28:04


Hi,

I've created an HTML5 app (a simple game) using the product Construct 2 from http://scirra.com.

When playing the HTML5 game locally (i.e. off files on the hard disk), sound in all browsers works fine, including IE 11.

I've uploaded the game to an Azure web site using Dropbox deployment. The game still works - but the sound is giving me trouble. Sound works in Chrome, but now it doesn't work in IE 11.

Apparently, to make the sound work with Internet Explorer running these games from a web site, .ogg and .m4a audio files need to be set up with the appropriate MIME types. (This is from information on the Scirra web site - which is not specific to Windows Azure.)

What is the easiest way to configure MIME types on an Azure web site that uses Dropbox deployment?

Thanks!


Sponsored



Replies

Suwat Ch on Mon, 24 Feb 2014 23:10:05


Try setting your web.config as below. Hope it helps.

<configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".ogg" mimeType="audio/ogg" /> <mimeMap fileExtension=".m4a" mimeType="audio/mp4" /> </staticContent> </system.webServer> </configuration>

Derick Campbell [MSFT] on Wed, 26 Feb 2014 05:22:53


Thanks suwatch for your help. For whatever reason, when I include this file with the DropBox deployment in the root folder of the app, the app no longer runs and I get a server error when visiting the site. When I delete it, the app works again.  Hmmm.

Suwat Ch on Thu, 27 Feb 2014 21:47:14


Ummm  .. could you scale down the repro and share with us or create a test website with the repro, we can help investigate.

Maciej Neumann on Tue, 24 Jun 2014 20:45:42


Hi,

I have the same problem. When I set this mimeMap definitions under the staticContent tag in my web.config the whole application doesn't work anymore.

<staticContent>  <mimeMap fileExtension=".mp4" mimeType="video/mp4" />  <mimeMap fileExtension=".flv" mimeType="video/x-flv" /></staticContent>

How can I run mp4 files in the flash in my azure app. It works only localhost but not after the deployment to the azure.

Thank You

Maciej Neumann

Maciej Neumann on Sun, 29 Jun 2014 06:11:41


I found the solution for me.

There was two problems with the solution proposed by Suwat:

  <system.webServer>

    <modules runAllManagedModulesForAllRequests="true" >

    </modules>

    <staticContent>

      <mimeMap fileExtension=".mp4" mimeType="video/mp4" />

      <mimeMap fileExtension=".flv" mimeType="video/x-flv" />

    </staticContent>

  </system.webServer>

1.Using the .flv mimeMap definition
<mimeMap fileExtension=".flv" mimeType="video/x-flv" />
causes, that the application does not run correctly (pictures, java scripts problem, whole asps sites are not available?)

Solution: don't use mimeMap for .flv

21.Using a mimeMap definition, like eg.
 <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
causes, that in the localhost surrounding, where typically mimeMap for .mp4 is already defined in the global web server web.config, the site crashes with the error message, that this mimeMap is already defined.

Solution: use
<remove fileExtension=".mp4" />
before you want to redefine a mimeMap.

So I get this code that is working for me in both surroundings (azure-production and localhost-development)

  <system.webServer>

    <modules runAllManagedModulesForAllRequests="true" >

    </modules>

    <staticContent>

      <remove fileExtension=".mp4" />

      <mimeMap fileExtension=".mp4" mimeType="video/mp4" />

    </staticContent>

  </system.webServer>

I hope it helps all people having troubles with video presentations in azure surrounding.