Unicode characters in the URL param of Embedded Windows Media Player - url

Let's take this simple HTML:
<html>
<body>
<!-- Object Tag For the Audio Player -->
<object id="mpAudio" width="100%" height="100%"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject" align="middle">
<param name="URL" value="http://servername/media/Alt.TÉst/default.wav" />
<param name="AutoStart" value="True" />
<param name="UIMode" value="Full" />
<param name="EnableContextMenu" value="True" />
<param name="WindowlessVideo" value="True" />
<param name="Mute" value="False" />
</object>
</html>
Notice in the URL there is this unicode character: É
When I open that html file, the audio plays as a garbled mess. Of note, in some older VM I have (for random IE6 testing), which has an O/S of 2003 Standard Edition, an IE 6 browser, and Windows Media Player 6.4.09.1130 .. it works, fine! My testing where it's a garbled mess, involves Windows 7, IE 10, and WMP 12.0.7601.17514
I thought the solution may be % encoding the URL. That's even worse. The encode became: http%3A%2F%2Fservername%2Fmedia%2FAlt.T%C3%89st%2Fdefault.wav
And I went from at least being able to play a garbled mess, to not playing anything at all.
One other test:
Taking the non-encoded url and putting it in Firefox, opens the wav (so Firefox is OK with the unicode character). Taking the encoded url, I get "server not found". I guess I don't know how to encode!
Barring eliminating unicode for data entry (these URLs are generated from Username's, where in some locales they allow unicode characters in the name), how do I make this work?
Thanks.

I thought the solution may be % encoding the URL. That's even worse. The encode became: http%3A%2F%2Fservername%2Fmedia%2FAlt.T%C3%89st%2Fdefault.wav
The solution should be to URL-encode path components, rather than the whole URL. You want to end up with:
http://servername/media/Alt.T%C3%89st/default.wav
Although, I would have expected the fail case to get a 404 and just not play anything—garbled audio is a weird result. There might be a different issue as well?

Related

Why are YouTube videos using 'youtube.com/v' not loading

Please review this page.
The embedded video plays when the page is viewed on a mobile device but not when viewed on a computer (tested on two laptops running Windows 8 and 10, on Chrome, FF, and Edge).
This issue only exists with YouTube videos and the problem began 48 hours ago (approx.)
For example, see this YouTube URL (no video is being loaded):
http://www.youtube.com/v/RCsJHHUkisw&rel=0&color1=0x054b81&color2=0xe2e2e2&hd=1&showinfo=0&enablejsapi=1&playerapiid=ytplayer&fs=1
I have managed to handle this problem by rewriting the emvideo module.
I am currently using the module version = "6.x-1.26".
I didn’t take the time to change the entire module;
I changed only the parts I needed:
All the changes were made in this file:
\sites\all\modules\emfield\contrib\emvideo\providers\youtube.inc
In function theme_emvideo_youtube_flash line 444 I changed the line
$url = check_plain("http://www.youtube.com/v/$code&$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs");
to
$url = check_plain("https://www.youtube.com/embed/$code"); .
What I did was to look at the youtube embed code and try to make the link look the same.
Next step was to change the FLASH output, in line 566 function
theme_emvideo_youtube_default_external and change the next content:
<div id="$div_id">
<object type="application/x-shockwave-flash" height="$height" width="$width" data="$url" id="$id">
<param name="movie" value="$url" />
<param name="allowScriptAccess" value="sameDomain"/>
<param name="quality" value="best"/>
<param name="allowFullScreen" value="$fullscreen_value"/>
<param name="bgcolor" value="#FFFFFF"/>
<param name="scale" value="noScale"/>
<param name="salign" value="TL"/>
<param name="FlashVars" value="$flashvars" />
<param name="wmode" value="transparent" />
</object>
</div>
To
<div id="$url"><iframe width="$width" height="$width" src="$url" frameborder="0" allowfullscreen></iframe></div>
And that’s all…
Hope it helps a bit…
The following should be pretty close to a drop-in replacement for what's currently being served on the page referenced in the question (the object tag with id emvideo-youtube-flash-2):
<iframe id="ytplayer" type="text/html" width="590" height="499"
src="https://www.youtube.com/embed/Je2vE5RLJ6o?rel=1&showinfo=0&enablejsapi=1&fs=1&origin=http://www.islandcricket.lk/"
frameborder="0" allowfullscreen>
A few things about the implementation currently being served:
Using object tag and the embed URLs of the form youtube.com/v/video id (which only serves a Flash player, not HTML5) to embed YouTube videos has been deprecated for over a year.
the player parameter hd is deprecated. The iFrame player (used in the above code), will automatically chose the best quality to display based on a variety of parameters. If you wish to control this you can use the Javascript API.
the rel, showinfo, enablejsapi and fs parameters should continue to function as they have in the previous implementation (parameter documentaion here)
The allowScriptAcess parameter set to sameDomain in the current implementation is replaced by the origin parameter and should be set to the URL severing the webpage (documented here)
Screenshot of the above code working on islandcricket.lk tested via webdev tools:

Whats the best way to embed a flash file from a link?

I have looked around, but still have not found a very good answer to my question.
I would like to know how I can embed a flash game into my website Via HTML or Java in order for it to play.
I have the SWF file, but am unable to put the file on the site, so I got this link "https://dl-web.dropbox.com/get/flight.swf?w=AAAYS8vwABuIJB3QbyhV1kSX778W0mXh4xRoQ0ADqm4w6g" that is JUST the flash game
Whats the best way to insert this into my site?
Below is a general script which will embed your flash movie in a html page, theres several ways to do this but below will work just copy and paste the code on to your html page in the body area.Check the adobe website if you need other parameters or more information.
<object id="yourmovie.swf" width="550" height="450" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" align="middle" bgcolor="#ffffff">
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="src" value="http://www.yourwebsite/yourmovie.swf" />
<param name="allowscriptaccess" value="sameDomain" />
<param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
<embed id="slots.swf" width="476" height="321" type="application/x-shockwave-flash"src="http://www.yourwebsite/yourmovie.swf"
allowScriptAccess="sameDomain" quality="high" allowscriptaccess="sameDomain"
pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" bgcolor="#ffffff" />
</object>
To use a link from java my option will be create a button/link thats open another window with the above on that html page

Silverlight app works in aspx page, not MVC Razor View

I'm having trouble getting my Silverlight app to show in an MVC3 Razor View.
When I add the application and it generates the test page (TestAppTestPage.aspx in my case), I can browse to the page and the app works fine. If I copy the same code to an MVC Razor view, then browse to the controller action, nothing happens with the application:
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/TestApp.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="5.0.61118.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
If I look at the developer console for Chrome, the only thing I see different is the following warning: "Resource interpreted as Other but transferred with MIME type undefined". I'm not sure if this is related.
I've looked at various guides on Silverlight and MVC, and copying relevant portions of their code produces no results either. I've played with adjusting the path, using relative urls, nothing. I've also checked IIS settings, but because it works fine in the aspx test page, I suspect that's not the cause.
Based on mfanto's comment, turning my comment into an answer.
Was guessing in my comment, but I've had issues when NOT using Url.Content for any external files. So the fix would be to use something like
<param name="source" value="<%= Url.Content("~/ClientBin/TestApp.xap") %>" />
Note that that is from an MVC 2 app.

Stop symfony from escaping html from query result

Currently I am using ckEditor with ckFinder in Symfony. When I save a form the HTML is saved (seemingly so) properly in the database. When I query through symfony and retrieve the results, the html tags are removed and replaced. Can I prevent this? Below is an example of what is in the database. I tried putting in what the HTML Shows but the current eidtor translates it
Database shows:
<p> Test</p> <p> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="movie" value="/uploads/flash/test1.flv" /><embed pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="/uploads/flash/test1.flv" type="application/x-shockwave-flash"></embed></object></p>
Actaul HTML (Note I replaced all ; with __ as the editor was translating it to the the above otherwise):
&lt__p&gt__
Test&lt__/p&gt__
&lt__p&gt__
&lt__object classid=&quot__clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot__ codebase=&quot__http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot__&gt__&lt__param name=&quot__quality&quot__ value=&quot__high&quot__ /&gt__&lt__param name=&quot__movie&quot__ value=&quot__/uploads/flash/test1.flv&quot__ /&gt__&lt__embed pluginspage=&quot__http://www.macromedia.com/go/getflashplayer&quot__ quality=&quot__high&quot__ src=&quot__/uploads/flash/test1.flv&quot__ type=&quot__application/x-shockwave-flash&quot__&gt__&lt__/embed&gt__&lt__/object&gt__&lt__/p&gt__
you must have automatic output escaping turned on and echo the result of your query in a templates I guess. Read here what automatic output escaping is and how the use of the ESC_RAW constant or of the getRaw() method can help you.

Safari WIndows and Transparent Flash

// Edit: The issue now appears to be confined to Safari for Windows.
Around the time Safari for Windows 4 came out I started hearing from users that wmode=transparent was no longer working in Safari.
I have googled this many times but have not come up with any answers. I have tried reducing interference by using tags as opposed to scripts to embed the Flash but with no success.
An example is here: http://hiv411.org/safari.php alternately embedded with script at http://hiv411.org/
All videos use wmode=transparent and are embedded via tags. All work fine in every browser I have except Safari.
Code looks like so on safari.php
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" name="test" width="289" height="263" align="middle" id="test">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="swfs/BBattLeft.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />
</object>
Much obliged for any help!
UPDATE: The problem is with the flash player for windows safari but has been solved after Flash Player version 10.0.45.2
Yes, It is only with Safari on Windows!
And it's interesting that there is not much written about this on the internet I've been experiencing the same issue, I guessed at first that it has a default value of #FFFFFF for bgcolor and I tried setting it to transparent (not wmode but bgcolor!). it still works in every other browser but it had a green color in Safari (so don't try that! and no the bug is not with the word transparent not being defined! I tried!).
Seems that we have to wait for apple to fix it in the next versions but if you want to change the background color if you only have a solid color underneath you can use:
if you're using the adobe script or javascript to display the flash (recommended)
<!--html-->
<script src="[adobe flash detector script]">
AC_FL_RunContent( 'wmode', 'transparent','bgcolor', 'xxxxxx');
</script>
>
else if youre using embed and or for the <noscript>:
<param name="wmode" bgcolor="#xxxxxx" value="transparent">
...aslo
<embed wmode="transparent" bgcolor="#xxxxxx">
if you wanna detect safari on windows and not display it - or maybe give the the least zindex:
//Javascript:
var isSafari = (navigator.userAgent.indexOf("Safari") != -1) ? true : false;
var isWindows = (navigator.userAgent.indexOf("Windows") != -1) ? true : false;
if (isSafari && isWindows) document.getElementById('yourflashid').style.display = 'none';
if (isSafari && isWindows) document.getElementById('yourflashid').style.Zindex = '-1000';
>
if you have php it's better to do it with php as changing DOM elements with js makes page load slower and requires javascript
<?php
//PHP
/* i like to make a .php external css style sheet
(you have to have a transitional HTML document!
or most browsers will not read it beacuse of difference in MIME types!)*/
function agent($browser) {
$useragent = $_SERVER['HTTP_USER_AGENT'];
return strstr($useragent,$browser);
}
if(agent("Safari") != FALSE) {
if(agent("Windows") != FALSE) { // on windows
?>
#myflash {display:none;}
#verisignflash {z-index:-100; /* for example I already made #000 bgcolor for this and looks right*/
&lt?php
} //All Safari's
}
... and then the code for Safari in general as the rest seem to be compatible! however you can add and else statement here and seperat them
If someone finds a better option I will be glad to read it here!
I have the same problem with Safari for Windows.
But after I've updated my Flash Player to version 10.0.45.2,
the problem is gone.
So I think it's a Flash player bug.

Resources