靖+ swfobject 2.2 = 小 div 中的大视频

发布于 2024-08-21 17:25:15 字数 612 浏览 5 评论 0原文

我正在尝试使用 swfobject 2.2 来显示 swf,但 swf 不会缩放以适合我放入的 div。您可以看到我得到的内容 此处

当它第一次加载时,它的大小是正确的,然后由于某种原因它会扩大。 如果我右键单击电影并选择“显示全部”,它就非常适合。

这是生成 sfobject 的代码:

var flashvars = {};
var params = {}
params.scale = "showAll";
params.allowscriptaccess = "always";
var attributes = {};                    
swfobject.embedSWF("/content/tour.swf", 
"flashContent", "900", "700", "9.0.0", "expressInstall.swf", 
                       flashvars, params, attributes);

任何帮助/建议将不胜感激!

I am trying to use swfobject 2.2 to display an swf, but the swf won't scale to fit the div that I'm putting it in. You can see what I've got here.

When it first loads, it is the right size, then it expands larger for some reason. If I right-click on the movie and select "Show All", it then fits perfectly.

Here is the code to generate the sfobject:

var flashvars = {};
var params = {}
params.scale = "showAll";
params.allowscriptaccess = "always";
var attributes = {};                    
swfobject.embedSWF("/content/tour.swf", 
"flashContent", "900", "700", "9.0.0", "expressInstall.swf", 
                       flashvars, params, attributes);

Any help/suggestions would be greatly appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

得不到的就毁灭 2024-08-28 17:25:15

您需要添加一些额外的脚本,如下所示:

function resizeFlashDiv()
{
        var theDiv = document.getElementById("navContainer");

        var theHeight = Math.floor(theDiv.offsetWidth * .33625) + 50; // add
the variable portion plus the fixed portion of the Flash

        theDiv.style.height = theHeight + "px";

}

这将使您的 SWF 填充 DIV。

You need to add some extra script like so:

function resizeFlashDiv()
{
        var theDiv = document.getElementById("navContainer");

        var theHeight = Math.floor(theDiv.offsetWidth * .33625) + 50; // add
the variable portion plus the fixed portion of the Flash

        theDiv.style.height = theHeight + "px";

}

This will make your SWF fill the DIV.

甜尕妞 2024-08-28 17:25:15

要使 div 的大小设置为 swf(或更确切地说 Flash Player)的大小,您可以在 swfobject.embedSWF() 调用中使用“100%”作为大小,而不是像素大小。

swfobject.embedSWF("/content/tour.swf", "flashContent", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

另一个要使用的参数是scale。替代方案是:

  • “showAll”:整个应用程序在指定区域中可见且不失真,同时保持应用程序的原始宽高比。边框可以出现在应用程序的两侧。

  • “exactFit”:整个应用程序在指定区域中可见,而不尝试保留原始宽高比。可能会发生扭曲,并且应用程序可能会显得被拉伸或压缩。

  • “noBorder”:整个应用程序填充指定区域,不变形,但可能进行一些裁剪,同时保持应用程序的原始宽高比。

    “noBorder”

  • “noScale”:整个应用程序是固定的,因此即使播放器窗口的大小发生变化,它也保持不变。如果播放器窗口小于内容,则可能会发生裁剪。

To make the size of the div set the size of the swf (or rather the Flash Player) you can use "100%" for size in the swfobject.embedSWF() call, instead of a pixel size.

swfobject.embedSWF("/content/tour.swf", "flashContent", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

The other parameter to work with is scale. The alternatives are:

  • "showAll": The entire application is visible in the specified area without distortion while maintaining the original aspect ratio of the application. Borders can appear on two sides of the application.

  • "exactFit": The entire application is visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, and the application may appear stretched or compressed.

  • "noBorder": The entire application fills the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application.

  • "noScale": The entire application is fixed, so that it remains unchanged even as the size of the player window changes. Cropping might occur if the player window is smaller than the content.

心头的小情儿 2024-08-28 17:25:15

我能想到的最快的办法就是将宽度设置为 100%。我已经测试过,它似乎工作正常:

屏幕截图链接
full width

Lars 已经发布了所有可用的替代方案。

哈特哈,
乔治

The quickest thing I can think of is just setting the width to 100%. I've tested and it seems to work fine:

screenshot link
full width

Lars has already posted all the available alternatives.

HTH,
George

九命猫 2024-08-28 17:25:15

由于 TestPlanManagement.com 回答正确,Jing 视频无法缩放。但可以更改 SWF 以允许这样做。请参阅使用 TechSmith Jing 调整嵌入式截屏视频的大小。商业动作脚本查看器用于更改 SWF 中的常量。

As TestPlanManagement.com answered correctly, Jing videos cannot be scaled. But the SWF can be changed to allow this. See Resizing embedded screencasts with TechSmith Jing. The commercial Action Script Viewer is used to change the constant in the SWF.

梦幻的心爱 2024-08-28 17:25:15

检查加载的 swf 代码内部是否将 stageScaleMode 设置为 noScale。这就是我的问题的根源。

check inside your loaded swf code, if you are setting the stageScaleMode to noScale. That was the source of my problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文