- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我修改了一个 JWPlayer 插件(http://www.pluginsbyethan.com/newsticker6.html),它最终在播放 mp4 格式的 HTML5 版本上运行良好,但是当我切换到 Flash 版本时,播放器崩溃了。
为什么我的Flash版本无法实现插件?
如果我使用回调到 .swf 文件,那是不相关的,它不会崩溃,那么 Flash 播放器只支持 .swf flash 插件,还是我可以以某种方式为 Flash 播放器定义 JS 插件?
代码如下所示;
jwplayer().registerPlugin("ticker", "6.0", function(player, config) {
function setup() {
var theBody = document.getElementById(player.id);
var playerWidthPX2 = player.getHeight();
var playerWidthPX = parseFloat(playerWidthPX2);
var playerHeightPX2 = player.getWidth();
var playerHeightPX = parseFloat(playerHeightPX2);
var ticker_top = document.createElement("div");
var ticker_top_marquee = document.createElement("marquee");
var ticker_middle = document.createElement("div");
var ticker_middle_marquee = document.createElement("marquee");
var ticker_middle_date = document.createElement("div");
// top
ticker_top.setAttribute("id", "ticker_top");
ticker_top.style.background = "#e3bfa3";
ticker_top.style.height = 26 + "px";
ticker_top.style.width = "100%";
ticker_top.style.position = "absolute";
ticker_top.style.zIndex = "1";
ticker_top.style.bottom = "25px";
ticker_top.style.opacity = "1";
ticker_top.style.visibility = "hidden";
// Marquee too ticker_middle
ticker_top_marquee.setAttribute("id", "ticker_top_marquee");
ticker_top_marquee.style.color = "#000000";
ticker_top_marquee.innerHTML = config.ticker1;
ticker_top_marquee.setAttribute("scrollamount", "6");
ticker_top_marquee.setAttribute("direction", "left");
ticker_top_marquee.style.fontSize = "18px";
ticker_top_marquee.style.fontWeight = "600";
ticker_top_marquee.style.textTransform = "uppercase";
ticker_top_marquee.style.cursor = "default";
ticker_top_marquee.style.fontFamily = "PT Sans";
ticker_top_marquee.style.position = "absolute";
ticker_top_marquee.style.zIndex = "2";
ticker_top_marquee.style.width = "100%";
ticker_top_marquee.style.bottom = "23px";
ticker_top_marquee.style.visibility = "hidden";
ticker_top_marquee.style.opacity = "1";
// middle
ticker_middle.setAttribute("id", "ticker_middle");
ticker_middle.style.background = "#000000";
ticker_middle.style.height = 25 + "px";
ticker_middle.style.width = "100%";
ticker_middle.style.position = "absolute";
ticker_middle.style.zIndex = "1";
ticker_middle.style.bottom = "0px";
ticker_middle.style.opacity = "1";
ticker_middle.style.visibility = "hidden";
// Marquee too ticker_middle
ticker_middle_marquee.setAttribute("id", "ticker_middle_marquee");
ticker_middle_marquee.style.color = "#ec008b";
ticker_middle_marquee.innerHTML = config.ticker2;
ticker_middle_marquee.setAttribute("scrollamount", "7");
ticker_middle_marquee.setAttribute("direction", "left");
ticker_middle_marquee.style.fontSize = "16px";
ticker_middle_marquee.style.fontWeight = "600";
ticker_middle_marquee.style.cursor = "default";
ticker_middle_marquee.style.fontFamily = "PT Sans";
ticker_middle_marquee.style.position = "absolute";
ticker_middle_marquee.style.zIndex = "3";
ticker_middle_marquee.style.width = "100%";
ticker_middle_marquee.style.textTransform = "uppercase";
ticker_middle_marquee.style.bottom = "0px";
ticker_middle_marquee.style.visibility = "hidden";
ticker_middle_marquee.style.opacity = "1";
// middle date
ticker_middle_date.setAttribute("id", "ticker_middle_date");
ticker_middle_date.style.background = "#FFF";
ticker_middle_date.style.height = 25 + "px";
ticker_middle_date.style.width = "100px";
ticker_middle_date.style.position = "absolute";
ticker_middle_date.style.fontSize = "16px";
ticker_middle_date.style.textAlign = "center";
ticker_middle_date.style.fontWeight = "600";
ticker_middle_date.style.cursor = "default";
ticker_middle_date.style.fontFamily = "PT Sans";
ticker_middle_date.style.zIndex = "3";
ticker_middle_date.style.bottom = "0px";
ticker_middle_date.style.left = "0px";
ticker_middle_date.style.opacity = "1";
ticker_middle_date.style.visibility = "hidden";
ticker_middle_date.innerHTML = config.date;
theBody.onmouseover = function(){
ticker_top.style.visibility = "hidden";
ticker_top_marquee.style.visibility = "hidden";
ticker_middle.style.visibility = "hidden";
ticker_middle_marquee.style.visibility = "hidden";
ticker_middle_date.style.visibility = "hidden";
}
theBody.onmouseout = function(){
ticker_top.style.visibility = "visible";
ticker_top_marquee.style.visibility = "visible";
ticker_middle.style.visibility = "visible";
ticker_middle_marquee.style.visibility = "visible";
ticker_middle_date.style.visibility = "visible";
}
//Append it
theBody.appendChild(ticker_top);
theBody.appendChild(ticker_top_marquee);
theBody.appendChild(ticker_middle);
theBody.appendChild(ticker_middle_marquee);
theBody.appendChild(ticker_middle_date);
}
player.onReady(setup);
player.onPlay(function() {
var ticker_top = document.getElementById('ticker_top');
var ticker_top_marquee = document.getElementById('ticker_top_marquee');
var ticker_middle = document.getElementById('ticker_middle');
var ticker_middle_marquee = document.getElementById('ticker_middle_marquee');
var ticker_middle_date = document.getElementById('ticker_middle_date');
ticker_top.style.visibility = "visible";
ticker_top_marquee.style.visibility = "visible";
ticker_middle.style.visibility = "visible";
ticker_middle_marquee.style.visibility = "visible";
ticker_middle_date.style.visibility = "visible";
});
this.resize = function() {
var ticker_top = document.getElementById('ticker_top');
var ticker_top_marquee = document.getElementById('ticker_top_marquee');
var ticker_middle = document.getElementById('ticker_middle');
var ticker_middle_marquee = document.getElementById('ticker_middle_marquee');
var ticker_middle_date = document.getElementById('ticker_middle_date');
if(player.getFullscreen() == true){
ticker_top.style.visibility = "visible";
ticker_top_marquee.style.visibility = "visible";
ticker_middle.style.visibility = "visible";
ticker_middle_marquee.style.visibility = "visible";
ticker_middle_date.style.visibility = "visible";
}
// if(player.getFullscreen() == false){
// ticker_top.style.visibility = "hidden";
// ticker_top_marquee.style.visibility = "hidden";
// ticker_middle.style.visibility = "hidden";
// ticker_middle_marquee.style.visibility = "hidden";
// ticker_middle_date.style.visibility = "hidden";
// }
}
}, '');
谢谢,堆栈。
最佳答案
看起来你在这里修改了我的插件 - http://www.pluginsbyethan.com/newsticker6.html
这个插件本来是用Flash写的,所以JS版本回退到Flash版本是这样的:
}, 'newsticker.swf');
您删除了引号中的 swf,但现在 JS 插件试图退回到不存在的 swf 文件:
}, '');
此外,在 Flash 模式下,播放器会添加一个包装器 ID。
这是一些没有任何 Flash 回退的更新代码,它似乎可以工作:
(function(jwplayer) {
var template = function(player, config, ticker) {
function setup(evt) {
if (player.getRenderingMode() == "html5") {
var theBody = document.getElementById(player.id);
} else {
var theBody = document.getElementById(player.id + "_wrapper");
}
var playerWidthPX2 = player.getHeight();
var playerWidthPX = parseFloat(playerWidthPX2);
var playerHeightPX2 = player.getWidth();
var playerHeightPX = parseFloat(playerHeightPX2);
var ticker_top = document.createElement("div");
var ticker_top_marquee = document.createElement("marquee");
var ticker_middle = document.createElement("div");
var ticker_middle_marquee = document.createElement("marquee");
var ticker_middle_date = document.createElement("div");
// top
ticker_top.setAttribute("id", "ticker_top");
ticker_top.style.background = "#e3bfa3";
ticker_top.style.height = 26 + "px";
ticker_top.style.width = "100%";
ticker_top.style.position = "absolute";
ticker_top.style.zIndex = "1";
ticker_top.style.bottom = "25px";
ticker_top.style.opacity = "1";
ticker_top.style.visibility = "hidden";
// Marquee too ticker_middle
ticker_top_marquee.setAttribute("id", "ticker_top_marquee");
ticker_top_marquee.style.color = "#000000";
ticker_top_marquee.innerHTML = config.ticker1;
ticker_top_marquee.setAttribute("scrollamount", "6");
ticker_top_marquee.setAttribute("direction", "left");
ticker_top_marquee.style.fontSize = "18px";
ticker_top_marquee.style.fontWeight = "600";
ticker_top_marquee.style.textTransform = "uppercase";
ticker_top_marquee.style.cursor = "default";
ticker_top_marquee.style.fontFamily = "PT Sans";
ticker_top_marquee.style.position = "absolute";
ticker_top_marquee.style.zIndex = "2";
ticker_top_marquee.style.width = "100%";
ticker_top_marquee.style.bottom = "23px";
ticker_top_marquee.style.visibility = "hidden";
ticker_top_marquee.style.opacity = "1";
// middle
ticker_middle.setAttribute("id", "ticker_middle");
ticker_middle.style.background = "#000000";
ticker_middle.style.height = 25 + "px";
ticker_middle.style.width = "100%";
ticker_middle.style.position = "absolute";
ticker_middle.style.zIndex = "1";
ticker_middle.style.bottom = "0px";
ticker_middle.style.opacity = "1";
ticker_middle.style.visibility = "hidden";
// Marquee too ticker_middle
ticker_middle_marquee.setAttribute("id", "ticker_middle_marquee");
ticker_middle_marquee.style.color = "#ec008b";
ticker_middle_marquee.innerHTML = config.ticker2;
ticker_middle_marquee.setAttribute("scrollamount", "7");
ticker_middle_marquee.setAttribute("direction", "left");
ticker_middle_marquee.style.fontSize = "16px";
ticker_middle_marquee.style.fontWeight = "600";
ticker_middle_marquee.style.cursor = "default";
ticker_middle_marquee.style.fontFamily = "PT Sans";
ticker_middle_marquee.style.position = "absolute";
ticker_middle_marquee.style.zIndex = "3";
ticker_middle_marquee.style.width = "100%";
ticker_middle_marquee.style.textTransform = "uppercase";
ticker_middle_marquee.style.bottom = "0px";
ticker_middle_marquee.style.visibility = "hidden";
ticker_middle_marquee.style.opacity = "1";
// middle date
ticker_middle_date.setAttribute("id", "ticker_middle_date");
ticker_middle_date.style.background = "#FFF";
ticker_middle_date.style.height = 25 + "px";
ticker_middle_date.style.width = "100px";
ticker_middle_date.style.position = "absolute";
ticker_middle_date.style.fontSize = "16px";
ticker_middle_date.style.textAlign = "center";
ticker_middle_date.style.fontWeight = "600";
ticker_middle_date.style.cursor = "default";
ticker_middle_date.style.fontFamily = "PT Sans";
ticker_middle_date.style.zIndex = "3";
ticker_middle_date.style.bottom = "0px";
ticker_middle_date.style.left = "0px";
ticker_middle_date.style.opacity = "1";
ticker_middle_date.style.visibility = "hidden";
ticker_middle_date.innerHTML = config.date;
theBody.onmouseover = function(){
ticker_top.style.visibility = "hidden";
ticker_top_marquee.style.visibility = "hidden";
ticker_middle.style.visibility = "hidden";
ticker_middle_marquee.style.visibility = "hidden";
ticker_middle_date.style.visibility = "hidden";
}
theBody.onmouseout = function(){
ticker_top.style.visibility = "visible";
ticker_top_marquee.style.visibility = "visible";
ticker_middle.style.visibility = "visible";
ticker_middle_marquee.style.visibility = "visible";
ticker_middle_date.style.visibility = "visible";
}
//Append it
theBody.appendChild(ticker_top);
theBody.appendChild(ticker_top_marquee);
theBody.appendChild(ticker_middle);
theBody.appendChild(ticker_middle_marquee);
theBody.appendChild(ticker_middle_date);
};
player.onReady(setup);
player.onReady(setup);
player.onPlay(function() {
var ticker_top = document.getElementById('ticker_top');
var ticker_top_marquee = document.getElementById('ticker_top_marquee');
var ticker_middle = document.getElementById('ticker_middle');
var ticker_middle_marquee = document.getElementById('ticker_middle_marquee');
var ticker_middle_date = document.getElementById('ticker_middle_date');
ticker_top.style.visibility = "visible";
ticker_top_marquee.style.visibility = "visible";
ticker_middle.style.visibility = "visible";
ticker_middle_marquee.style.visibility = "visible";
ticker_middle_date.style.visibility = "visible";
});
this.resize = function() {
var ticker_top = document.getElementById('ticker_top');
var ticker_top_marquee = document.getElementById('ticker_top_marquee');
var ticker_middle = document.getElementById('ticker_middle');
var ticker_middle_marquee = document.getElementById('ticker_middle_marquee');
var ticker_middle_date = document.getElementById('ticker_middle_date');
if(player.getFullscreen() == true){
ticker_top.style.visibility = "visible";
ticker_top_marquee.style.visibility = "visible";
ticker_middle.style.visibility = "visible";
ticker_middle_marquee.style.visibility = "visible";
ticker_middle_date.style.visibility = "visible";
}
// if(player.getFullscreen() == false){
// ticker_top.style.visibility = "hidden";
// ticker_top_marquee.style.visibility = "hidden";
// ticker_middle.style.visibility = "hidden";
// ticker_middle_marquee.style.visibility = "hidden";
// ticker_middle_date.style.visibility = "hidden";
// }
}
};
jwplayer().registerPlugin('ticker', '6.0', template);
})(jwplayer);
关于javascript - JWPlayer JS 插件添加到 flash 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27904323/
我在 mac 上,我有一个预先存在的 Flash 项目。 (即通常的 fla、src、lib)文件夹。 现在,我想开始使用 Flash Builder 4 编写代码。 如何导入所有这些文件,以便我现在
我在 Flash 视频播放器中遇到了一个奇怪的、很难重现的图形故障!,目前仅在 Chrome 中。 “进入建筑物”下方的灰色矩形显示了 Flash 播放器所在的 html div 的背景颜色。“我们在
我对 Flash 有点陌生,我只是找不到一种很好的方法来控制我添加到容器影片剪辑中的元素的位置。 我所做的是 addChild 到我的目标容器 Movie Clip 和控件 child 的 x,y 值
我是一名 AS3 开发人员,习惯于使用 Flash Builder。我正在与一位使用 Flash Professional 为游戏设计 Sprite 和背景的设计师合作。我希望为我们创建一个集成的工作
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
当您像下面那样在 FLash Builder 中嵌入媒体时,它会创建一个类来引用 [Embed(source="images/list.png")] protected static const LI
有没有办法在 Flash 上本地启用跳帧? 当您开发游戏时,您会开发动画以匹配游戏玩法的节奏,并以目标帧速率(Flash 通常为 24-40fps)进行制作。但是如果用户的电脑速度太慢,无法保持目标帧
大家好,我想知道 AS3 中的 dispatchEvent 是什么。 谷歌搜索时没有任何想法。 :( 所以请帮帮我 编辑1: public static const SET_VOLUME:Strin
我多次听说我应该避免在我的网站上使用 Flash。然而,没有人告诉我这样做的充分理由。我已经搜索了原因,我看到很多不正确的(例如 Flash 中的文本不能被搜索引擎索引),或者不一定是真实的或足够重要
我正在为一个非常大的网站做一些测试,创建了许多不同的开发人员。有没有办法判断网站是否在使用 flash和/或已加载闪存 plugin ?如果页面使用 Flash,有没有办法告诉页面/代码的哪一部分触发
我正在研究“Foundation Actionscript 3.0”一书中的音频播放器演示。当我尝试发布 AudioDemo_final.FLA 文件时,出现以下错误:“Adobe Flash CS3
我有一个特定的FLA,每次尝试编译时都会崩溃(切换到Snow Leopard之后)。 Flash只是停滞不前,我被迫使用“强制退出” ...我不知道是什么原因造成的,并且找不到任何崩溃报告。 Flas
所以我非常熟悉 Java、C 和 C++ 中的内存管理;然而,在闪存中有哪些结构用于内存管理?我假设 flash 有一种像 java 的虚拟机,并且我一直假设当它们被设置为 null 时会被垃圾收集。
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 5年前关闭。 Improve thi
是否可以在 flash 中创建 UDP 套接字连接?我知道 RTMPF,但它不提供对 UDP 的访问。我知道在 AIR 中它是可能的,但我正在寻找一种“闪光”解决方案。 谢谢你 最佳答案 号 UDP
不知道如何表达这个意思,但是我想知道是否可以创建一个全面的错误处理程序来保护整个代码,然后发送给自定义处理程序,该程序在程序中以图形方式输出信息。类似于以下内容: root.addEventListe
我正在尝试创建可在不同场景中使用的UI影片剪辑。 它使用来自根范围的变量来确定状态。 当我按下静音按钮时,效果很好,但是当我尝试取消静音时,就变得很奇怪。有时需要2次点击才能取消静音,有时还需要更多。
是否可以通过麦克风记录最终用户? 我可以用录音做什么 Action ? 例如,我能否实时获得声音(分贝)的音量? 我可以将记录保存到文件中吗? 谢谢。 最佳答案 是的,Flash允许(具有用户许可权)
当我访问我之前在 IE 中构建的站点时,我在浏览器底部弹出消息栏,提示该站点想要运行 Flash。 这很好,除了网站中没有任何 Flash。 什么会导致这种情况? Flash 现在怎么会出现在站点中?
概要 我正在尝试制作一个包含多个相同SWF的网页。我有一个问题,它的加载速度太慢了(虽然下载时间还不错)。我在每个单元格中都有一个4x4表格,在iframe中嵌入了一个swf文件。 (注意:4 X 4
我是一名优秀的程序员,十分优秀!