http://mediastylist.sekiguch.com/demo/cuepoint_JS/cuepoint.html
こちらのjsをWordPressに導入し、動画に字幕をつけたのですが、その字幕をすべて動画の下に並べてリスト表示したいと思っています。
読み込み時に全部表示で問題ありません。使用したスクリプトは以下。
【head】
javascript
1<script type="text/javascript">try{Typekit.load();}catch(e){}</script> 2<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> 3<!-- The cuepoint stuff is here --> 4<script src="api/html5media.min.js"></script> 5<script src="//wasoujp.com/cuepoint-code_annotation_demo/js/cuepoint.js"></script> 6<script> 7$(document).ready(function(){ 8//Slides object with a time (integer) and a html string 9var slides = { 100: "POINT00", 114: "POINT04", 1212: "POINT12", 1340: "POINT40", 1480: "POINT80", 15120: "POINT120", 16160: "POINT160", 17170: "Cuepoint.js is an open source plugin for adding subtitles and cue-points to your HTML5 video" 18} 19 20 21//Start cuepoint and pass in our the subtitles we want 22cuepoint.init(slides); 23 24//You can set your own skip to links by using the cuepoint.setTime(seconds) function 25$('#1').click(function(){ cuepoint.setTime(40)}); 26$('#2').click(function(){ cuepoint.setTime(80)}); 27$('#3').click(function(){ cuepoint.setTime(120)}); 28$('#4').click(function(){ cuepoint.setTime(160)}); 29}); 30 31</script>
【body】※wpの記事投稿なのでscriptは記述できません。
html
1 <section id='cuePlayer'> 2 <video id='video' width="768" preload="auto" controls poster="images/poster.jpg" autoplay> 3 <source src="//wasoujp.com/cuepoint-code_annotation_demo/movies/video264.mp4"></source> 4 </video> 5 <div id='subtitles'></div> 6 </section> 7 8
やりたいことは、この字幕部分の内容に改行を入れて、動画の下に字幕ログとして表示したいです。
動画の字幕をテキストとしても読めるようにしたいのが目的です。
javascript
10: "POINT00", 24: "POINT04", 312: "POINT12", 440: "POINT40", 580: "POINT80", 6120: "POINT120", 7160: "POINT160", 8170: "Cuepoint.js is an open source plugin for adding subtitles and cue-points to your HTML5 video"
基本的な配列の表示と思うのですが、いろいろ調べてもどうにもうまくいきません。
方法を教えていただければありがたいです。よろしくお願いいたします。
追記:
ご指摘いただきありがとうございました。
自力で解決させましたので、もしこれよりスマートな解決方法がありましたらアドバイスいただければ幸いです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。