External, cross-domain mp3 does not load into Flash-player (text in Google text)

I want to play the Google Text-To-Speech URL in the Flash Player on my webpage.

I am using http://www.alsacreations.fr/dewplayer.html , but it does not work:

<object type="application/x-shockwave-flash" data="dewplayer.swf" width="200" height="20" id="dewplayer" name="dewplayer"> <param name="wmode" value="transparent" /> <param name="movie" value="dewplayer.swf" /> <param name="flashvars" value="mp3=http://translate.google.com/translate_tts?q=hello-word&tl=en" /> </object> 
+8
html flash cross-domain text-to-speech
source share
3 answers

The URL of your MP3 file must be encoded in the URL (http://www.w3schools.com/tags/ref_urlencode.asp)

 <object type="application/x-shockwave-flash" data="dewplayer.swf" width="200" height="20" id="dewplayer" name="dewplayer"> <param name="wmode" value="transparent" /> <param name="movie" value="dewplayer.swf" /> <param name="flashvars" value="mp3=http%3A%2F%2Ftranslate.google.com%2Ftranslate_tts%3Fq%3Dhello-world%26tl%3Den" /> </object> 
+4
source share

I did intensive research and found some solutions. The conclusion made by Mathieu (that Google modifies the arguments and you have to write your own application) is wrong. The problem is that google checks cross-domain access. It is not regulated by Adobe Flash player crossdomain.xml , as in this case , oddly enough. Flash Player does not attempt to download this file from the server root directory (tested in Firebug).

The problem is that google checks the referent, and if it is installed, it refuses to download content, please check:

So the problem boils down to spoofing links for inline content.

Solution 1 - RefererKiller

You can use a simple trick: refer to the mp3 file in the <img src=""> , see my example , with the addition of referencing spoofing. Then the flash player will not load it, since it will already be in the cache. There are solutions to remove referencing from embedded content (see Implementing the RefererKiller for Images ). However, a comment suggests that cross-browser compatibility can be a problem.

Solution 2 - https

So, the easiest solution is to use the https protocol - clear your cache and try the link above with the addition of https . The referent will not be configured for embedded content . But, if you do not have a trusted certificate, you probably do not want your users to go through a terrible four-click process to confirm the trust in your certificate. In this case, you probably want to go for another solution.

+4
source share

Instead of calling the mp3 url directly to the proxy through a php script to avoid crossdomain issues

http://xmlrpcflash.mattism.com/proxy_info.php

+2
source share

All Articles