JWPlayerをFancyBox内で動作させようとしています。ファンシーボックスは、以下に設定されたサイズで正常に開きますが、ビデオは表示されません(これはサーバー上にあります)。私がページで使用しているリンクの例(スクリプトおよびコンテンツディレクトリと同じレベルにあります-mp4はコンテンツディレクトリにあります)
<a href='content/brat.mp4' class='video' data-width="600" data-height="345" title='me'>Robot</a>
とページ内:
$(".video").fancybox({
fitToView: false, // to show videos in their own size
content: '<span></span>', // create temp content
scrolling: 'no', // don't show scrolling bars in fancybox
afterLoad: function () {
// get dimensions from data attributes
var $width = $(this.element).data('width');
var $height = $(this.element).data('height');
// replace temp content
this.content = "<embed src='scripts/jwplayer/jwplayer.swf?file=" + this.href + "&autostart=true&wmode=opaque' type='application/x-shockwave-flash' width='" + $width + "' height='" + $height + "'></embed>";
}
});
scripts / jwplayer /には、jwplayer.flash.swf、jwplayer.js、jwplayer.html5.jsがあります。