【发布时间】:2013-05-07 00:32:06
【问题描述】:
我在我的 django 网站中使用 JWPlayer 6。我想在同一页面上显示不同的视频。由于我正在迭代对象,我无法将不同的类 ID 分配给 Jwplayer 标记。所以当我加载它时,一个视频会显示,而另一个会弹出这个错误:
Loading the player
我一直在寻找解决此问题的方法,但没有成功!
Django 模板
{% block content %}
{% for flip in flips %}
<p> {{flip.title}} </p>
<center>
<div id="myElement">Loading the player...</div>
<script type="text/javascript">
jwplayer("myElement").setup({
image: "{{MEDIA_URL}}/{{flip.vid_image}}",
source[ {file: "{{MEDIA_URL}}/{{flip.vid_watch}}" },
{file: "{{MEDIA_URL}}/{{flip.vid_mp}}"
],
title:"{{flip.title}}",
width:692,
height:389
});
</script>
</center>
<p>Description: {{flip.description}} </p>
{% endblock %}
【问题讨论】:
-
另一个 StackOverflow 线程有一个解决方案 - stackoverflow.com/questions/16152380/…
标签: jquery python django video jwplayer