靖+ swfobject 2.2 = 小 div 中的大视频
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要添加一些额外的脚本,如下所示:
这将使您的 SWF 填充 DIV。
You need to add some extra script like so:
This will make your SWF fill the DIV.
要使 div 的大小设置为 swf(或更确切地说 Flash Player)的大小,您可以在 swfobject.embedSWF() 调用中使用“100%”作为大小,而不是像素大小。
另一个要使用的参数是
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.
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.
我能想到的最快的办法就是将宽度设置为 100%。我已经测试过,它似乎工作正常:
屏幕截图链接
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
Lars has already posted all the available alternatives.
HTH,
George
由于 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.
检查加载的 swf 代码内部是否将 stageScaleMode 设置为 noScale。这就是我的问题的根源。
check inside your loaded swf code, if you are setting the stageScaleMode to noScale. That was the source of my problem.