小工具 (vPlus) 可讓作者建立與影片同步的 HTML 簡報。相較於傳統影片,vPlus 的優點如下:
- 投影片可使用 DevSite 功能,例如:
作者可以控制影片要在投影片角落顯示、覆蓋整張投影片,或是在使用者與投影片互動時停止顯示。
示範
以下是 vPlus 功能的示範範例。按下「播放」按鈕即可開始。
結構定義
透過將元素標記為 devsite-vplus
類別,即可建立 Video Plus 小工具。此外,該元素必須包含 data-video-id
屬性,用於指定要顯示的 YouTube 影片 ID。
如果小工具元素也包含 data-captions-url
屬性,則應指定含有影片對應字幕的 json 檔案。這個檔案必須位於與 md
或 html
檔案相同的目錄中,或是以「/」開頭,檔案路徑則從根目錄開始。如要進一步瞭解這個檔案的格式和產生方式,請參閱 vPlus 影片播放器。您必須從影片中手動擷取字幕檔;請參閱 //engedu/common/vplus/README.md
瞭解詳情以及產生字幕檔的工具。
此外,devsite-vplus
元素應包含類別為 devsite-vplus-content-container
的元素。反過來,該元素應包含具有 devsite-vplus-slide-frame
類別的元素。
系統會將 devsite-vplus-slide-frame
元素中的每個元素視為投影片。投影片必須依時間順序列出。每個投影片元素都必須含有 data-start-time
屬性,用於指定播放這張投影片的時間 (以秒為單位)。此外,每張投影片都有 data-video-mode
屬性。該屬性有兩個有效值:
- 「large」:使影片佔據大部分的投影片空間,覆蓋投影片空間。
- 「stopped」:在使用者到達投影片時暫停播放影片。
如果未指定 data-video-mode,影片會預設為小尺寸。
投影片作者可能會想為投影片指定額外的 CSS。由於投影片包含在具有 devsite-vplus-slide-frame
類別的 div
中,因此投影片專屬的 CSS 樣式可以命名空間為這個類別的子項元素。
例如:
<style>
.devsite-vplus-slide-frame h1 {
background-color: #4285F4;
border-bottom: 1px solid #7BAAF7;
color: #fff;
margin: 0;
padding: 10px;
top: 0 !important;
}
/* More styles... */
</style>
<div class="devsite-vplus" data-video-id="PXVnv_Paexc" data-captions-url="video-plus-captions.json">
<div class="devsite-vplus-content-container">
<div class="devsite-vplus-slide-frame">
<div data-start-time=0 class="title-background">
<div class="header1 title">vPlus Demo</div>
</div>
<div data-slide-note=true>
Note for the 'title' slide.
</div>
<div data-start-time=2 data-video-mode="large">
<!-- Intentionally left blank -->
</div>
<div data-slide-note=true>
This slide was intentionally left blank.
</div>
<div data-start-time=13>
<div class="header2">Nice Informative Slide</div>
<ul>
<li>Nice, informative bullet point</li>
<li>Another nice, informative bullet point</li>
</ul>
</div>
<div data-slide-note=true>
Very meta. In this note, we could talk about several things:
<ul>
<li>What could go in the note versus in the slide itself.
<ul>
<li>Either can contain HTML or markdown</li>
<li>Whether it would be useful to display something to the viewer
or only in the notes that the presenter would presummably
see and may read out loud.</li>
</ul>
</li>
<li>Users may view notes themselves, usually offline.</li>
<li>Notes could be a way of
<a href="#demo">linking to demos</a>.
</li>
</ul>
</div>
<div data-start-time=21>
<div class="header2">Nice, informative cat picture</div>
<div>
<!-- Image CCO Public Domain at https://pixabay.com/en/kitten-cute-feline-kitty-domestic-1246693/ -->
<img class="cat-pic" src="https://cdn.pixabay.com/photo/2016/03/09/15/31/kitten-1246693_1280.jpg">
</div>
</div>
<div data-start-time=32 data-video-mode="stopped">
<div class="header2">Here's some interactive content</div>
<div>
<devsite-multiple-choice>
<div>What color is the sky?</div>
<div correct>
<div>Blue</div>
<div>But do you know <b>why</b>?</div>
</div>
<div>
<div>Purple</div>
<div>Not really</div>
</div>
<div>
<div>Indigo</div>
<div>Close but not quite</div>
</div>
<div>
<div>Green</div>
<div>What planet are you from?</div>
</div>
</devsite-multiple-choice>
</div>
</div>
<div data-slide-note="true">
Note, when an interactive slide is reached,
you have to click the 'Play' button,
or the 'Next Slide' button in order to continue.
</div>
<div data-start-time=33 data-video-mode="stopped">
<div class="header2">Here's some more interactive content - <a href="/blockly/">Blockly</a></div>
<iframe style="height: 75%; width: 90%; margin: 0 5%;" src="/blockly/blockly-demo/blockly-demo"></iframe>
</div>
<div data-start-time=34 data-video-mode="large">
<!-- Intentionally left blank -->
</div>
<div data-start-time=78>
<div>
<div class="header2">Thanks for watching!</div>
<ul>
<li>Video Plus drives video play and slides</li>
<li>Reduces need to reshoot video if slides change</li>
<li>Provides searchable transcript</li>
<li>Pauses video for user interactions</li>
<li>Video can switch between large and small</li>
</ul>
</div>
</div>
</div>
</div>
</div>
當 vPlus 小工具在網頁上顯示時,影片播放器不會自動開始,不過在使用者按下播放按鈕後,系統會自動推進投影片和字幕 (如有顯示)。使用者也可以使用下列滑鼠和鍵盤動作與小工具互動。