简体   繁体   English

更改JWPlayer显示图标(播放按钮)的不透明度

[英]Change Opacity of JWPlayer Display Icon (Play Button)

I want to change the opacity of the JW Player Display Icon (the play button) from 1 to .35 and want to avoid making my own skin. 我想将“ JW播放器显示图标”(播放按钮)的不透明度从1更改为.35,并希望避免自己做皮肤。 I don't see anything about opacity or any example code in the docs here: http://support.jwplayer.com/customer/portal/articles/1413071-skin-xml-reference#dispaly 在这里的文档中,我看不到任何与不透明度有关的内容或任何示例代码: http : //support.jwplayer.com/customer/portal/articles/1413071-skin-xml-reference#dispaly

I can easily change the opacity in Chrome's Dev Tools by finding the jwdisplayIcon class and changing the opacity. 我可以通过找到jwdisplayIcon类并更改不透明度来轻松更改Chrome开发工具中的不透明度。 Running this line in Chrome's console also works: 在Chrome的控制台中运行此行也可以:

$('.jwdisplayIcon').css('opacity', '.35');

But I tried adding the same line to my JavaScript and it didn't work. 但是我尝试将同一行添加到我的JavaScript中,但没有用。 I also tried adding the following to my CSS and it didn't work: 我还尝试将以下内容添加到我的CSS中,但它不起作用:

.jwdisplayIcon {
  opacity: .35;
}

This is the inherited setup I have: 这是我继承的设置:

    jwplayer("expert-video").setup({
        sources: [
          {% for media in medias %}
            {file: "{{ media.media.url }}", label: "{{ media.name }}"},
          {% endfor %}
        ],
        {% if expert.media_poster %}
          image: "{{ expert.media_poster.url }}",
        {% endif %}
        width: "100%",
        aspectratio: "16:9",
        abouttext: "© Copyright 2014",
        aboutlink: "http://example.com",
        skin: "vapor"
      });

It seems like this JavaScript setup would be the place to make changes, but I don't know what to add. 似乎可以通过JavaScript设置进行更改,但我不知道要添加什么。 I tried adding the following line to the setup, but the browser threw an Unexpected Token on the '()' (it seems like this can only be called inside an event?): 我尝试将以下行添加到设置中,但是浏览器在'()'上抛出了意外的令牌(似乎只能在事件内部调用它?):

jwplayer().getPlugin("display").style.opacity='.35';

I tried adding the following to my setup even though it would target the whole player instead of just the display icon, and it did nothing at all: 我尝试将以下内容添加到我的设置中,即使它可以定位到整个播放器,而不仅仅是显示图标,而且它什么也没做:

opacity: ".35",

I found this JSFiddle to play with JW Player and changed the icons: false to the following, but it did not work: 我发现此JSFiddle可与JW Player一起玩,并将icons: false更改为以下内容,但没有用:

 icons: {
     opacity: .35,
 }

What do I need to do to change the opacity without building a new skin? 我需要做些什么才能在不新建皮肤的情况下更改不透明度?

You should make the graphic in photoshop or another image editing program and change the opacity there. 您应该在photoshop或其他图像编辑程序中制作图形,然后在此处更改不透明度。

That way it will work in both rendering modes in the player, Flash or HTML5. 这样一来,它就可以在Flash或HTML5播放器的两种渲染模式下工作。

Your CSS work arounds here will only work for the HTML5 player. 您的CSS解决方法仅适用于HTML5播放器。

Yes, you would have to build a new skin in order to do this, I'm afraid. 是的,恐怕您必须新建一个皮肤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM