在Wordpress中包含外部链接的Javascript

时间:2014-02-16 16:48:11

标签: javascript wordpress brightcove

我想在wordpress页面上包含一个外部托管的功能/视频播放器,其中几乎没有其他内容。该功能由外部提供商开发和托管,因此我无法控制它。他们向我提供了以下代码,并指示我复制并粘贴到页面中,但这不起作用。

不幸的是,我没有任何JS的工作知识。有人能够帮助我需要做什么。我是否需要编辑一些functions.php,还是应该能够作为一个帖子工作?

<!-- Start of Brightcove Player -->

<div style="display:none">

</div>

<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C 
found at https://accounts.brightcove.com/en/terms-and-conditions/. 
-->


<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>

<object id="myExperience" class="BrightcoveExperience">
  <param name="bgcolor" value="#FFFFFF" />
  <param name="width" value="825" />
  <param name="height" value="650" />
  <param name="playerID" value="3058468026001" />
  <param name="playerKey" value="AQ~~,AAAACjHz08E~,HgXzSoYtBYxTAjnyep2-EpPyWh7pU7Jr" />
  <param name="isVid" value="true" />
  <param name="isUI" value="true" />
  <param name="dynamicStreaming" value="true" />

</object>

<!-- 
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>

<!-- End of Brightcove Player -->

可在此处的页面上查看:

http://www.treforestvets.com/pet-health-videos

1 个答案:

答案 0 :(得分:0)

我可以在链接中提供的页面的页面源中看到您的代码。由于wordpress的默认格式化行为,它被注释掉了。

要使其正常工作,请打开编辑器,删除该特定页面的所有先前修改,然后尝试在编辑器的Text模式下粘贴此代码,而不是Visual模式。

之后保存它,它将开始工作。