views:

20

answers:

1

I'm currently integrating a custom Flash Video player plugin into a .Net CMS. The plugin editor currently requires the user to provide the video's width and height in order for my code to push out the relevant dimensions to the FlowPlayer.

I was wondering, is there a way to automatically determine the FLV width and height rather than having the editor having to provide this information each time? Ideally, I'd prefer it if the user simply had to provide the FLV location and let the new plugin automatically provide the width / height to the FlowPlayer.

+2  A: 

Add that into Your flowplayer's configuration:

clip: {
        onMetaData: function(clip) {                
            var width = parseInt(clip.metaData.width, 100);
            var height = parseInt(clip.metaData.height, 100);
            $(this.getParent()).css({ width: width, height: height });
        }
    },

Event 'metadata' is called after file's meta information is loaded, thus width and height. In the example above I change size of a player according to movie's dimentions

ITmeze
It helped me as well. Thanks buddy
Wind Chimez