OK, sometimes in life you just have to take the easy option! I have developed a work around for this issue, but it’s ugly. In the end the answer is a version checking script and a message to say that you need to upgrade to the latest player to watch fullscreen - see, I told you it was the easy option!
If that REALLY isn’t acceptable for you then read on as I do have a solution, it just needs a bit of tweaking and I don’t have time to do it.
The checking script:
var oldPlayer:Boolean;
function checkVersion():Void {
var vers:String = getVersion();
var tdd:Array = vers.split(" “);
var ndd:Array = tdd[1].split(”,");
if (ndd[0] >= 9) {
oldPlayer = false;
if (ndd[2] < 115) {
oldPlayer = true;
}
} else {
oldPlayer = true;
};
}
Here we grab the version, split it into an array and then evaluate the parts of the array that represent the version numbers. Later on in my script I have a few lines incorporated into the fullScreen_btn onPress handler that goes along the lines of…
if (oldPlayer) {
// display upgrade message
}
else {
Stage[“displayState”] = “fullScreen”;
}
And that, as they say, is that.
However, I did have a solution that involved launching a javascript window should the oldPlayer variable evaluate to true but had the following issues:
-
I parse a bunch of parameters that set the content and various other things to my video player in the form of a query string. This works in Firefox but not IE. If you don’t parse parameters it should work for you in both.
-
To get around this I created a separate html page with the swf set to 100% width and height and loaded that instead. This worked fine in IE but the swf would not go to 100% height in Firefox.
I guess you could modify my js script to detect the browser and then to either load the swf directly if it’s firefox or the html page if its IE, or maybe fix the 100% height issue for firefox, but like I say, I want the easy option so I abandoned this. For those of you who want to give it a go here is the script that calls the js (called instead of the //display upgrade message line above)…
function handleOldPlayer():Void {
// The name of a JavaScript function to call...
var callJasFunction:String = "setFullScreen";
// The actual call...
ExternalInterface.call(callJasFunction);
// you should also pause your original player here
}
Don’t forget to import flash.external.*; at the top of your script, and remember that ExternalInterface does not work on local files unless you set scriptAccess to “always” and add your file location to your safe zone. See this brilliant article for more details.
Then, pop this function in your html page…
<script type=“text/javascript” language=“JavaScript”>
function setFullScreen() {
var newWindow=window.open(‘player.swf?contentPath=content.flv’,‘newWin’,‘left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=Yes’);
}
</script>
This script needs work, but I am no js expert. Like I said, without the ?contentPath=content.flv bit it works fine in both browsers.
Anyway, I hope this helps in some small way. Of course by the time Flash Player 10 comes out I don’t suppose anyone will care!!!
Thanks for reading.