<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>水族館ライブ | imakat.com</title>
	<atom:link href="https://imakat.com/tag/%e6%b0%b4%e6%97%8f%e9%a4%a8%e3%83%a9%e3%82%a4%e3%83%96/feed/" rel="self" type="application/rss+xml" />
	<link>https://imakat.com</link>
	<description>工夫と改善で人生をちょっと豊かに</description>
	<lastBuildDate>Sun, 14 Sep 2025 02:45:44 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://i0.wp.com/imakat.com/wp-content/uploads/2023/07/cropped-80d64ecd340db4e2ca3224859b04caed.png?fit=32%2C32&#038;ssl=1</url>
	<title>水族館ライブ | imakat.com</title>
	<link>https://imakat.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">160909258</site>	<item>
		<title>【WordPress】サイドバーに無音繰り返し動画を置くのは、とても簡単！！</title>
		<link>https://imakat.com/2021/01/26/11391/</link>
		
		<dc:creator><![CDATA[imakat]]></dc:creator>
		<pubDate>Tue, 26 Jan 2021 06:06:12 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[デジタル]]></category>
		<category><![CDATA[水族館ライブ]]></category>
		<category><![CDATA[背景動画]]></category>
		<guid isPermaLink="false">https://imakat.com/?p=11391</guid>

					<description><![CDATA[2024.2.23追記：　ライブストリーミング配信カメラが毎日切り替わるように変更しました。2023.8.23追記：　Windows Mac両方に対応したライブストリーミング配信用スクリプトを掲載しました。 　Vimeo [&#8230;]]]></description>
										<content:encoded><![CDATA[
<hr class="wp-block-separator has-text-color has-key-color-color has-alpha-channel-opacity has-key-color-background-color has-background is-style-wide"/>



<p>2024.2.23追記：　ライブストリーミング配信カメラが毎日切り替わるように変更しました。<br>2023.8.23追記：　Windows Mac両方に対応したライブストリーミング配信用スクリプトを掲載しました。</p>



<hr class="wp-block-separator has-text-color has-key-color-color has-alpha-channel-opacity has-key-color-background-color has-background is-style-wide"/>



<p>　Vimeoの動画を無音繰り返し動画として利用する場合については、<a href="https://imakat.com/2019/12/14/8731/" target="_blank">こちらのブログ</a>をご覧いただくとして、一般的な、WordPressフォルダ内の動画、Dropboxの動画など、URLにて呼び出せるものについては、<strong>サクッと簡単に、作ることが出来る</strong>ので、ご紹介します。</p>



<p>以下のようになります。</p>



<hr class="wp-block-separator has-text-color has-key-color-color has-alpha-channel-opacity has-key-color-background-color has-background is-style-wide"/>



<p>＜WordPressのサイドバーへ無音繰り返し動画を貼り付ける＞<br><a href="https://imakat.com/page-11646-2-2/" target="_blank">別ページで表示</a></p>



<img decoding="async" src="https://docs.google.com/drawings/d/e/2PACX-1vQUNCKxQ6jMWTrx_TAQr999svYtpb0G6DMJL8bo-oBGI66h3JY4qBr2pVnQ8HWn8tEgKpQqy4P3pl2m/pub?w=1440&amp;h=1080">



<hr class="wp-block-separator has-text-color has-key-color-color has-alpha-channel-opacity has-key-color-background-color has-background is-style-wide"/>



<p>以下は、サイドバー用無音繰り返し動画のソースコードのサンプルです。<br>下記のポイント解説の中に動画貼り付けがありますが、この<strong>動画ブロックを、HTML記述に変更してコピー</strong>しただけです。</p>



<p>&lt;ソースコードサンプル＞</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>&lt;figure class=&quot;wp-block-video aligncenter&quot;&gt;&lt;video autoplay loop muted src=&quot;https://xxxxxxxx/xxxxx/xxxxx.mov&quot; playsinline&gt;&lt;/video&gt;&lt;/figure&gt;</code></pre></div>



<p>これを、<strong>ウイジェットのカスタムHTMLへ</strong>、コピー＆ペーストして、URLの部分だけを置き換えます。</p>



<h3 class="wp-block-heading">ポイント解説</h3>



<h4 class="wp-block-heading">&lt;1&gt; 無音繰り返し動画を、本文の中で作ってみます。</h4>



<figure class="wp-block-video aligncenter"><video autoplay loop muted src="https://imakat.com/rd.php?id=76ST4SZv.mov" playsinline></video></figure>



<p>ブロックから動画を選びます。本文では、右に表示されるバーから、再生の方法を細かく指定することが出来ます。自動再生、ループ、ミュート、インライン再生、をON、プレイバックコントロールだけをOFFにしてみると、上のように無音繰り返し動画になります。</p>



<figure class="wp-block-image aligncenter size-large is-resized"><a href="https://imakat.com/rd.php?id=o7KHeFZR.png" target="_blank"><img decoding="async" src="https://imakat.com/rd.php?id=o7KHeFZR.png" alt="" style="width:263px;height:798px"/></a></figure>



<h4 class="wp-block-heading">&lt;2&gt; HTMLソースコードの取り出し方</h4>



<p>貼り付けた動画をクリックすると、バーに点３つのマーク→HTMLとして編集、を選びます。</p>



<figure class="wp-block-image aligncenter size-large is-resized"><a href="https://imakat.com/rd.php?id=pkEsSugL.png" target="_blank"><img decoding="async" src="https://imakat.com/rd.php?id=pkEsSugL.png" alt="" style="width:427px;height:403px"/></a></figure>



<p>ソースコードが表示されます。これをコピーします。単にコピーするだけで何も変更しませんので、ご注意ください。</p>



<figure class="wp-block-image aligncenter size-large is-resized"><a href="https://imakat.com/rd.php?id=ip9pyrO4.png" target="_blank"><img decoding="async" src="https://imakat.com/rd.php?id=ip9pyrO4.png" alt="" style="width:745px;height:375px"/></a></figure>



<p>超簡単です！</p>



<h4 class="wp-block-heading">&lt;3&gt; 名古屋港水族館のライブ映像をサイドバーへ載せるには。<br>〜ライブストリーミング配信〜</h4>



<p>珍しく、名古屋港水族館はライブ配信を行っています（いつまでサービスを行ってくれるかわかりませんが）。この中からライブカメラのURL(※1)をカスタムHTMLブロックへ貼り付けると、以下になります。これをウイジェットのカスタムHTMLへコピー＆ペーストすると、なかなかオシャレになります。ただし、以下のソースコードは、JAVA無料サービスのjsDeliverを利用しているため、いつまでも使用できるとは限りません。</p>



<p>※1:URLは時々変更されているようです。Macの場合は、再生中のライブ動画の上で右クリック→ビデオアドレスをコピーします。</p>



<p>＜ソースコードサンプル＞</p>



<p>&#8220;サムネのURL&#8221;は、現状、自動開始にしてあるため、必要ありませんが、autoplay=&#8221;&#8221;を削除した場合は、登録しておいた方が見栄えはいいです。</p>



<p>日本時間で日付が変わった時、カメラが移動します。</p>



<p>初期設定は、2024年2月23日に配列の先頭からスタートするように設定してあります。７種類ですと曜日とカメラが一致してしまうため、coralreef サンゴ礁を2日連続にしています。</p>



<p>coralreef サンゴ礁  coralreef サンゴ礁　dolphin イルカのプール kuroshio 黒潮の水槽　livingcoral ライブコーラル　beluga ベルーガのプール　umigame ウミガメ回遊水槽　penguin ペンギン水槽</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>&lt;a href=&quot;https://nagoyaaqua.jp/calendar/&quot;&gt;名古屋港水族館のご案内&lt;/a&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/hls.js@latest&quot;&gt;&lt;/script&gt;
&lt;video id=&quot;hls&quot; preload=&quot;metadata&quot; controls=&quot;&quot; autoplay=&quot;&quot; loop=&quot;&quot; muted=&quot;&quot; width=&quot;100%&quot; playsinline=&quot;&quot; poster=&quot;サムネのURL&quot;&gt;&lt;/video&gt;
&lt;p id=&quot;currentCameraCaption&quot;&gt;&lt;/p&gt;

&lt;script&gt;
  var cameras = [&#39;coralreef&#39;, &#39;coralreef&#39;, &#39;dolphin&#39;, &#39;kuroshio&#39;, &#39;livingcoral&#39;, &#39;beluga&#39;, &#39;umigame&#39;, &#39;penguin&#39;];
  var video = document.getElementById(&quot;hls&quot;);
  var currentCameraCaption = document.getElementById(&quot;currentCameraCaption&quot;);
  video.volume = 0.5;
  var config = { maxBufferLength: 12, maxBufferSize: 10 * 1000 * 1000 };

  // 初期設定の日付
  var initialDate = new Date(&#39;2024-02-23T00:00:00+09:00&#39;);

  // 初回のカメラ設定
  setInitialCamera();

  // 初回のカメラ設定関数
  function setInitialCamera() {
    var currentDate = new Date();
    var timeDifference = currentDate - initialDate;

    // カメラを設定
    var initialCameraIndex = Math.floor(timeDifference / (24 * 60 * 60 * 1000)) % cameras.length;
    var initialCamera = cameras[initialCameraIndex];
    setCurrentCamera(initialCamera);
    updateCurrentCameraCaption(initialCamera);
  }

  // 毎日日本時間0時にカメラを切り替える
  function scheduleCameraSwitch() {
    var now = new Date();
    var tomorrow = new Date(now);
    tomorrow.setDate(now.getDate() + 1);
    tomorrow.setHours(0, 0, 0, 0);

    var timeUntilMidnight = tomorrow - now;
    setTimeout(function () {
      switchCamera();
      // 次の日の0時に再度スケジュール
      scheduleCameraSwitch();
    }, timeUntilMidnight);
  }

  // カメラ切り替え関数
  function switchCamera() {
    var currentCamera = getCurrentCamera();
    var currentCameraIndex = cameras.indexOf(currentCamera);
    var nextCameraIndex = (currentCameraIndex + 1) % cameras.length;
    var nextCamera = cameras[nextCameraIndex];
    setCurrentCamera(nextCamera);
    updateCurrentCameraCaption(nextCamera);
  }

// 現在のカメラを取得
function getCurrentCamera() {
  return localStorage.getItem(&#39;currentCamera&#39;) || cameras[0]; // 初期値をcameras配列の先頭に設定
}

  // カメラを設定
  function setCurrentCamera(camera) {
    localStorage.setItem(&#39;currentCamera&#39;, camera);
    var videoSrc = &#39;https://st1.ctc.co.jp/edge/&#39; + camera + &#39;/playlist.m3u8&#39;;

    if (Hls.isSupported()) {
      var hls = new Hls(config);
      hls.loadSource(videoSrc);
      hls.attachMedia(video);
    } else if (video.canPlayType(&#39;application/vnd.apple.mpegurl&#39;)) {
      video.src = videoSrc;
    }
  }

  // カメラのキャプションを更新
  function updateCurrentCameraCaption(camera) {
    currentCameraCaption.innerText = &#39;現在のカメラ: &#39; + camera;
  }

  // 初回のスケジュールを設定
  scheduleCameraSwitch();
&lt;/script&gt;</code></pre></div>



<p>上のスクリプト中の</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/hls.js@latest&quot;&gt;&lt;/script&gt;</code></pre></div>



<p>については、テーマエディタでCocoon Child→head-insert.phpへ記述して、ここでは省略することも可能です。</p>



<p>この投稿において、以下に動画が表示される時は、右のサイドバーには表示されなくなります。↓</p>



<a rel="noopener" target="_blank" href="https://nagoyaaqua.jp/calendar/">名古屋港水族館のご案内<span class="fa fa-external-link external-icon anchor-icon"></span></a>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video id="hls" preload="metadata" controls="" autoplay="" loop="" muted="" width="100%" playsinline="" poster="サムネのURL"></video>
<p id="currentCameraCaption"></p>

<script>
  var cameras = ['coralreef', 'coralreef', 'dolphin', 'kuroshio', 'livingcoral', 'beluga', 'umigame', 'penguin'];
  var video = document.getElementById("hls");
  var currentCameraCaption = document.getElementById("currentCameraCaption");
  video.volume = 0.5;
  var config = { maxBufferLength: 12, maxBufferSize: 10 * 1000 * 1000 };

  // 初期設定の日付
  var initialDate = new Date('2024-02-23T00:00:00+09:00');

  // 初回のカメラ設定
  setInitialCamera();

  // 初回のカメラ設定関数
  function setInitialCamera() {
    var currentDate = new Date();
    var timeDifference = currentDate - initialDate;

    // カメラを設定
    var initialCameraIndex = Math.floor(timeDifference / (24 * 60 * 60 * 1000)) % cameras.length;
    var initialCamera = cameras[initialCameraIndex];
    setCurrentCamera(initialCamera);
    updateCurrentCameraCaption(initialCamera);
  }

  // 毎日日本時間0時にカメラを切り替える
  function scheduleCameraSwitch() {
    var now = new Date();
    var tomorrow = new Date(now);
    tomorrow.setDate(now.getDate() + 1);
    tomorrow.setHours(0, 0, 0, 0);

    var timeUntilMidnight = tomorrow - now;
    setTimeout(function () {
      switchCamera();
      // 次の日の0時に再度スケジュール
      scheduleCameraSwitch();
    }, timeUntilMidnight);
  }

  // カメラ切り替え関数
  function switchCamera() {
    var currentCamera = getCurrentCamera();
    var currentCameraIndex = cameras.indexOf(currentCamera);
    var nextCameraIndex = (currentCameraIndex + 1) % cameras.length;
    var nextCamera = cameras[nextCameraIndex];
    setCurrentCamera(nextCamera);
    updateCurrentCameraCaption(nextCamera);
  }

// 現在のカメラを取得
function getCurrentCamera() {
  return localStorage.getItem('currentCamera') || cameras[0]; // 初期値をcameras配列の先頭に設定
}

  // カメラを設定
  function setCurrentCamera(camera) {
    localStorage.setItem('currentCamera', camera);
    var videoSrc = 'https://st1.ctc.co.jp/edge/' + camera + '/playlist.m3u8';

    if (Hls.isSupported()) {
      var hls = new Hls(config);
      hls.loadSource(videoSrc);
      hls.attachMedia(video);
    } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
      video.src = videoSrc;
    }
  }

  // カメラのキャプションを更新
  function updateCurrentCameraCaption(camera) {
    currentCameraCaption.innerText = '現在のカメラ: ' + camera;
  }

  // 初回のスケジュールを設定
  scheduleCameraSwitch();
</script>



<p>以上です。</p>
]]></content:encoded>
					
		
		<enclosure url="https://imakat.com/rd.php?id=76ST4SZv.mov" length="0" type="application/vnd.apple.pages" />

		<post-id xmlns="com-wordpress:feed-additions:1">11391</post-id>	</item>
	</channel>
</rss>
