Cast functionnality in full JS
This commit is contained in:
parent
9542285e72
commit
13ba4a7707
2 changed files with 12 additions and 12 deletions
|
@ -91,4 +91,13 @@ function loadCastApi(loaded, errorInfo) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initCast() {
|
||||||
|
'use strict';
|
||||||
|
var intro = document.getElementById('download_intro');
|
||||||
|
if (intro) {
|
||||||
|
intro.insertAdjacentHTML('beforeend', '<img class="cast_icon" id="cast_disabled" src="img/ic_media_route_disabled_holo_light.png" alt="" title="Google Cast is not supported on this browser." /> <img class="cast_btn cast_hidden cast_icon" id="cast_btn_launch" src="img/ic_media_route_off_holo_light.png" title="Cast to ChromeCast" alt="Google Cast™" /> <img src="img/ic_media_route_on_holo_light.png" alt="Casting to ChromeCast…" title="Stop casting" id="cast_btn_stop" class="cast_btn cast_hidden cast_icon" />');
|
||||||
window.__onGCastApiAvailable = loadCastApi;
|
window.__onGCastApiAvailable = loadCastApi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', initCast, false);
|
||||||
|
|
|
@ -2,22 +2,13 @@
|
||||||
<div itemscope itemtype="http://schema.org/VideoObject">
|
<div itemscope itemtype="http://schema.org/VideoObject">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
{include file="logo.tpl"}
|
{include file="logo.tpl"}
|
||||||
<p>You are going to download<i itemprop="name">
|
<p id="download_intro">You are going to download<i itemprop="name">
|
||||||
<a itemprop="url" id="video_link"
|
<a itemprop="url" id="video_link"
|
||||||
data-ext="{$video->ext}"
|
data-ext="{$video->ext}"
|
||||||
data-video="{$video->url|escape}"
|
data-video="{$video->url|escape}"
|
||||||
href="{$video->webpage_url}">
|
href="{$video->webpage_url}">
|
||||||
{$video->title}</a></i>.
|
{$video->title}</a></i>.
|
||||||
<img class="cast_icon" id="cast_disabled"
|
</p>
|
||||||
src="{base_url|noscheme}/img/ic_media_route_disabled_holo_light.png"
|
|
||||||
alt="Google Cast™ is disabled"
|
|
||||||
title="Google Cast is not supported on this browser." />
|
|
||||||
<img class="cast_btn cast_hidden cast_icon" id="cast_btn_launch"
|
|
||||||
src="{base_url|noscheme}/img/ic_media_route_off_holo_light.png"
|
|
||||||
title="Cast to ChromeCast" alt="Google Cast™" />
|
|
||||||
<img src="{base_url|noscheme}/img/ic_media_route_on_holo_light.png"
|
|
||||||
alt="Casting to ChromeCast…" title="Stop casting"
|
|
||||||
id="cast_btn_stop" class="cast_btn cast_hidden cast_icon" /></p>
|
|
||||||
{if isset($video->thumbnail)}
|
{if isset($video->thumbnail)}
|
||||||
<img itemprop="thumbnailUrl" class="thumb" src="{$video->thumbnail}" alt="" />
|
<img itemprop="thumbnailUrl" class="thumb" src="{$video->thumbnail}" alt="" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue