django Web サイトで JWPlayer 6 を使用しています。同じページに異なる動画を表示したい。オブジェクトを反復処理しているため、異なるクラス ID を Jwplayer タグに割り当てることはできません。したがって、ロードすると、1 つのビデオが表示され、もう 1 つのビデオで次のエラーが表示されます。
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 %}