掲載されたソースコードを元に修正してみたコードを載せます。
まず、動画コンテンツ分のiframeを配置していますが、普通に<iframe src="url"></iframe>と書いてしまうと、まだ表示していないのにもかかわらず、裏ではiframe内のコンテンツのロードを行ってしまいますので、<iframe src=""></iframe>としておいたほうがいいでしょう。
また、動画コンテンツ分<iframe>を配置した場合、APIを使用しないと停止できなくなってしまいますので、iframeの配置は1つのみにし、srcを書き換えることでコンテンツの切り替えを行います。
srcを書き換えれば以前の動画はアンロードされますので以前の動画は停止(廃棄)されます。
それと、タッチイベントの設定において、for文で回してせってしていますが、jQueryでは$(".modal-syncer").click(...と書けば、modal-syncerクラスのすべての要素のクリックイベントが拾えるようになりますので、for文で回して設定する必要はありません。
下のソースコードにおいて<a>のボタンは画像ではなくcssでスタイルを設定していますので注意してください。
このソースのデモ
css
1#modal-overlay {
2 z-index: 1;
3 display: none;
4 position: fixed;
5 top: 0;
6 left: 0;
7 width: 100%;
8 height: 100%;
9 background-color: rgba( 255,255,255, 0.75 );
10}
11
12#modal-content {
13 width: 910px;
14 height: 360px;
15 margin: 0;
16 padding: 20px 20px;
17 border: 0px solid #aaa;
18 background: #fff;
19 position: fixed;
20 /*display: none;*/
21}
22.button-link {
23 color: #00f ;
24 text-decoration: underline;
25}
26
27.button-link:hover {
28 cursor: pointer ;
29 color: #f00 ;
30}
31
32.css_btn_class {
33 font-size:16px;
34 font-family:Arial;
35 font-weight:normal;
36 -moz-border-radius:8px;
37 -webkit-border-radius:8px;
38 border-radius:8px;
39 border:1px solid #d83526;
40 padding:9px 18px;
41 text-decoration:none;
42 background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
43 background:-ms-linear-gradient( top, #fe1a00 5%, #ce0100 100% );
44 filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
45 background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #fe1a00), color-stop(100%, #ce0100) );
46 background-color:#fe1a00;
47 color:#ffffff;
48 display:inline-block;
49 text-shadow:1px 1px 0px #b23e35;
50 -webkit-box-shadow:inset 1px 1px 0px 0px #f29c93;
51 -moz-box-shadow:inset 1px 1px 0px 0px #f29c93;
52 box-shadow:inset 1px 1px 0px 0px #f29c93;
53}
54.css_btn_class:hover {
55 background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
56 background:-ms-linear-gradient( top, #ce0100 5%, #fe1a00 100% );
57 filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
58 background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #ce0100), color-stop(100%, #fe1a00) );
59 background-color:#ce0100;
60}
61.css_btn_class:active {
62 position:relative;
63 top:1px;
64}
html
1<!-- モーダルウィンドウのコンテンツ開始 -->
2<div id="modal-overlay">
3 <div id="modal-content">
4 <iframe src="" width="512" height="288" align="left" frameborder="0" id="vimeoPlayer" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" style="display: block;" padding_right="10"></iframe>
5 <img src="説明文書画像" alt="0" width="350" height="283" size-full wp-image-117 />
6 <a id="modal-close" class="button-link css_btn_class">閉じる</a>
7 </div>
8</div>
9<!-- モーダルウィンドウのコンテンツ終了 -->
10<table>
11 <tr>
12 <td>
13 <a class="modal-syncer button-link css_btn_class" data-video-id="Pii-LaWOyuo">動画1</a>
14 </td>
15 <td>
16 <a class="modal-syncer button-link css_btn_class" data-video-id="FajnnR-9mhE">動画2</a>
17 </td>
18 </tr>
19 <tr>
20 <td>
21 <a class="modal-syncer button-link css_btn_class" data-video-id="OC7tgJP1D4s">動画3</a>
22 </td>
23 <td>
24 <a class="modal-syncer button-link css_btn_class" data-video-id="OC7tgJP1D4s">動画4</a>
25 </td>
26 </tr>
27</table>
js
1$(function() {
2 // modal-overlay内にmodal-contentを配置しているためイベントバブルにより、
3 // modal-overlayのクリック(タッチ)イベントが発生してしまうためバブリングを停止させる
4 $("#modal-content").click(function(evt) {
5 evt.stopPropagation();
6 });
7 //リサイズされたら、センタリングをする
8 $(window).resize(centeringModalSyncer);
9 //ボタンのクリック(タッチ)イベント
10 $(".modal-syncer").click(function() {
11 //ボタンからフォーカスを外す
12 this.blur();
13 //プレイヤー(iframe)のsrcにYouTube動画のURLを設定
14 $("#vimeoPlayer").attr("src", "https://www.youtube.com/embed/" + $(this).data("videoId") + "?autoplay=1");
15 $("#modal-overlay").fadeIn("fast");
16 // センタリング
17 centeringModalSyncer();
18 });
19 //[#modal-overlay]、または[#modal-close]をクリックしたら…
20 $("#modal-overlay, #modal-close").click(function() {
21 //[#modal-content]と[#modal-overlay]をフェードアウトした後に…
22 $("#modal-overlay").fadeOut("fast", function() {
23 $("#vimeoPlayer").attr("src", ""); // プレイヤーのsrcをクリア
24 });
25 });
26 //センタリングを実行する関数
27 function centeringModalSyncer() {
28 //画面(ウィンドウ)の幅、高さを取得
29 var w = $(window).width();
30 var h = $(window).height();
31 //コンテンツ(#modal-content)の幅、高さを取得
32 var cw = $("#modal-content").outerWidth();
33 var ch = $("#modal-content").outerHeight();
34 //センタリングを実行する
35 $("#modal-content").css({ left: ((w - cw) / 2), top: ((h - ch) / 2) });
36 }
37});