You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

flashembed: config/clip/scale property doesn Created Aug 12, 2009

This thread is solved

Views: 3886     Replies: 5     Last reply Aug 13, 2009  
You must login first before you can use this feature

Michael Harris

Posts: 4

Registered:
Jul 15, 2009

flashembed: config/clip/scale property doesn

Posted: Aug 12, 2009

OK, this has got me beat. I've been implimenting flowplayer using the flashembed jquery tool, and it has been perfect getting it working cross-browser.

However, the one thing which refuses to play ball is the scale param of config/clip. As a consequence, when full screen playback is activated by the user, the video's aspect ratio distorts to fill the whole window as opposed to staying in the intended 16x9 presentation.

The player will respect the autoPlay and autoBuffering params I have used without a hitch, however despite what I try it just won't maintain the aspect ratio.

I have referred to the Flash OBJECT and EMBED tag attributes on the Adobe website, as advised in the flashembed documentation but to no success.

My code is below, and there's a good chance this might be a rookie mistake. If anyone can help me find it, I'd be really appreciative.


<html>
<head>
<!-- include flowplayer specific files -->
<script src="/_global/applications/flowplayer/tools.flashembed-1.0.3.js"></script>
</head>
<body>
<!--  setup player with standard HTML syntax -->
<script>
// supply configuration (flashvars) for the Flash object 
flashembed("flash", "/_global/applications/flowplayer/flowplayer-3.1.2.swf", { 
 
    // "config" parameter is a complex JSON object, not just a simple value 
    config: { 
        clip:  { 
            autoPlay: false, 
            autoBuffering: true,
			initialScale: 'scale',
			scale: 'noorder',
            url: '/business_development/science_resources/seed_technologies/video/sandalwood_presentation.flv'
        } 
    } 
	
});
</script>
<div id="flash" style="display:block;width:320px;height:196px;"></div>
</html>

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» flashembed: config/clip/scale property doesn

Posted: Aug 12, 2009

Reply to: flashembed: config/clip/scale property doesn, from fpcwa
The attributes you are referencing would go in the second argument. For flowplayer configuration use the flowplayer's clip configuration. In this case you need the scaling clip property (documented here) and set it to "fit":

Flowplayer forum example

HTML setup for the player

<!-- include latest Flowplayer javascript file -->
<script language="javascript" src="path/to/flowplayer-3.2.6.js"></script>

<!-- player container with optional splash image -->
<a href="path/to/video_file" id="playerContainer">
	<img src="path/to/splash_image" />
</a>


JavaScript coding

Following script will install Flowplayer into our player container


<script language="javascript">
// our custom configuration is given in third argument
flowplayer("playerContainer", "path/tohttp://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",{
clip: {
  scaling: "fit"
}
});
</script>


You can see that the default setting of "scale" would distort the video example even when not playing fullscreen.

Michael Harris

Posts: 4

Registered:
Jul 15, 2009

Good answer, but not for this question

Posted: Aug 13, 2009

Reply to: » flashembed: config/clip/scale property doesn, from blacktrash
Thanks for attempting to answer the question, but its not the right one.

I'm aware of how to do this using the normal jscript implementation, but due to configuration and SOE issues within our corporate environ I'm having to use the flashembed jquery method which I outlined in the original question.

Anyone else understand the flashembed method enough to point me in the right direction?

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» Good answer, but not for this question

Posted: Aug 13, 2009

Reply to: Good answer, but not for this question, from fpcwa
Sorry for overlooking that. Still my answer might be better than you think. Have you actually tried to put the usual clip config as config JSON as 3rd argument?


flashembed("flash", "/_global/applications/flowplayer/flowplayer-3.1.2.swf", {  
  
    // "config" parameter is a complex JSON object, not just a simple value  
    config: {  
        clip:  {  
            autoPlay: false,  
            autoBuffering: true, 
            scaling: 'fit', 
            url: '/business_development/science_resources/seed_technologies/video/sandalwood_presentation.flv' 
        }  
    }     
});

Well, I did, and it works, as you can see here.

BTW, you are aware that flashembed is part of the "normal" flowplayer.js?

http://flowplayer.org/tools/demos/flashembed/flowplayer.html

Michael Harris

Posts: 4

Registered:
Jul 15, 2009

I"ll go sit in the corner now

Posted: Aug 13, 2009

Reply to: » Good answer, but not for this question, from blacktrash
Excuse me, I'll go sit in the corner now - you've helped me find my mistake. Thanks for that, greatly appreciated.

My mistakes:
  1. Didn't pass the configuration variables correctly. Missed out the config section before clip
  2. Use the keyword of scale instead of scaling

And I wasn't aware that flashembed was part of the normal flowplayer must have misread the documentation somewhere <slaps head>.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» I"ll go sit in the corner now

Posted: Aug 13, 2009

Reply to: I"ll go sit in the corner now, from fpcwa
Hey, no prob.

The (Adobe) Flash configuration goes in the 2nd argument to the flowplayer or flashembed function, yes. The path to flowplayer as string is actually a shortcut for


{src: "/location/of/flowplayer.swf"}

which can be misleading sometimes, while it makes things look easier at first glance.


$f("player", {
  // 2nd argument: Flash config
  src: "flowplayer.swf",
  quality: "autohigh"
}, {
  // 3rd argument: player config
  clip: {
    // clip config
    scaling: "fit"
  }
});

Further nesting (plugins, player events etc.) in the 3rd argument possible.