开发者

Can I determine FLV dimensions using FlowPlayer?

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 t开发者_Go百科he width / height to the FlowPlayer.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜