videogular2
Version:
Videogular is a video application framework for desktop and mobile powered by Angular 2.0
831 lines (340 loc) • 22.2 kB
HTML
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>VgControlsHidden · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<link rel="stylesheet" href="../../../../gitbook/style.css">
<link rel="stylesheet" href="../../../../gitbook/gitbook-plugin-responsive-iframes/plugin.css">
<link rel="stylesheet" href="../../../../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../../../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../../../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../../vg-cue-points/" />
<link rel="prev" href="../vg-utils/" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="header">Introduction</li>
<li class="chapter " data-level="1.1" data-path="../../../../">
<a href="../../../../">
What's Videogular?
</a>
</li>
<li class="header">Getting Started</li>
<li class="chapter " data-level="2.1" data-path="../../../../getting-started/">
<a href="../../../../getting-started/">
Getting Started
</a>
</li>
<li class="chapter " data-level="2.2" data-path="../../../../getting-started/how-videogular-works.html">
<a href="../../../../getting-started/how-videogular-works.html">
How Videogular works
</a>
</li>
<li class="chapter " data-level="2.3" data-path="../../../../getting-started/master-media.html">
<a href="../../../../getting-started/master-media.html">
Master Media
</a>
</li>
<li class="chapter " data-level="2.4" data-path="../../../../getting-started/using-the-api.html">
<a href="../../../../getting-started/using-the-api.html">
Using the API
</a>
</li>
<li class="header">Modules</li>
<li class="chapter " data-level="3.1" data-path="../../">
<a href="../../">
videogular2/core
</a>
<ul class="articles">
<li class="chapter " data-level="3.1.1" data-path="../../vg-player/">
<a href="../../vg-player/">
VgPlayer
</a>
</li>
<li class="chapter " data-level="3.1.2" data-path="../../vg-media/">
<a href="../../vg-media/">
VgMedia
</a>
</li>
<li class="chapter " data-level="3.1.3" data-path="../vg-api/">
<a href="../vg-api/">
VgAPI
</a>
</li>
<li class="chapter " data-level="3.1.4" data-path="../vg-fullscreen-api/">
<a href="../vg-fullscreen-api/">
VgFullscreenAPI
</a>
</li>
<li class="chapter " data-level="3.1.5" data-path="../vg-utils/">
<a href="../vg-utils/">
VgUtils
</a>
</li>
<li class="chapter active" data-level="3.1.6" data-path="./">
<a href="./">
VgControlsHidden
</a>
</li>
<li class="chapter " data-level="3.1.7" data-path="../../vg-cue-points/">
<a href="../../vg-cue-points/">
VgCuePoints
</a>
</li>
<li class="chapter " data-level="3.1.8" data-path="../../events/">
<a href="../../events/">
VgEvents
</a>
</li>
<li class="chapter " data-level="3.1.9" data-path="../../states/">
<a href="../../states/">
VgStates
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.2" data-path="../../../buffering/">
<a href="../../../buffering/">
videogular2/buffering
</a>
<ul class="articles">
<li class="chapter " data-level="3.2.1" data-path="../../../buffering/vg-buffering/">
<a href="../../../buffering/vg-buffering/">
VgBuffering
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.3" data-path="../../../controls/">
<a href="../../../controls/">
videogular2/controls
</a>
<ul class="articles">
<li class="chapter " data-level="3.3.1" data-path="../../../controls/vg-controls/">
<a href="../../../controls/vg-controls/">
VgControls
</a>
</li>
<li class="chapter " data-level="3.3.2" data-path="../../../controls/vg-play-pause/">
<a href="../../../controls/vg-play-pause/">
VgPlayPause
</a>
</li>
<li class="chapter " data-level="3.3.3" data-path="../../../controls/vg-playback/">
<a href="../../../controls/vg-playback/">
VgPlaybackButton
</a>
</li>
<li class="chapter " data-level="3.3.4" data-path="../../../controls/vg-scrub-bar/">
<a href="../../../controls/vg-scrub-bar/">
VgScrubBar
</a>
<ul class="articles">
<li class="chapter " data-level="3.3.4.1" data-path="../../../controls/vg-scrub-bar/vg-scrub-bar-current-time/">
<a href="../../../controls/vg-scrub-bar/vg-scrub-bar-current-time/">
VgScrubBarCurrentTime
</a>
</li>
<li class="chapter " data-level="3.3.4.2" data-path="../../../controls/vg-scrub-bar/vg-scrub-bar-buffering-time/">
<a href="../../../controls/vg-scrub-bar/vg-scrub-bar-buffering-time/">
VgScrubBarBufferingTime
</a>
</li>
<li class="chapter " data-level="3.3.4.3" data-path="../../../controls/vg-scrub-bar/vg-scrub-bar-cue-points/">
<a href="../../../controls/vg-scrub-bar/vg-scrub-bar-cue-points/">
VgScrubBarCuePoints
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.3.5" data-path="../../../controls/vg-time-display/">
<a href="../../../controls/vg-time-display/">
VgTimeDisplay
</a>
<ul class="articles">
<li class="chapter " data-level="3.3.5.1" data-path="../../../controls/vg-time-display/vg-utc.html">
<a href="../../../controls/vg-time-display/vg-utc.html">
VgUtcPipe
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.3.6" data-path="../../../controls/vg-track-selector/">
<a href="../../../controls/vg-track-selector/">
VgTrackSelector
</a>
</li>
<li class="chapter " data-level="3.3.7" data-path="../../../controls/vg-mute/">
<a href="../../../controls/vg-mute/">
VgMute
</a>
</li>
<li class="chapter " data-level="3.3.8" data-path="../../../controls/vg-volume/">
<a href="../../../controls/vg-volume/">
VgVolume
</a>
</li>
<li class="chapter " data-level="3.3.9" data-path="../../../controls/vg-fullscreen/">
<a href="../../../controls/vg-fullscreen/">
VgFullscreen
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.4" data-path="../../../ima-ads/">
<a href="../../../ima-ads/">
videogular2/ima-ads
</a>
<ul class="articles">
<li class="chapter " data-level="3.4.1" data-path="../../../ima-ads/vg-ima-ads/">
<a href="../../../ima-ads/vg-ima-ads/">
VgImaAds
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.5" data-path="../../../overlay-play/">
<a href="../../../overlay-play/">
videogular2/overlay-play
</a>
<ul class="articles">
<li class="chapter " data-level="3.5.1" data-path="../../../overlay-play/vg-overlay-play/">
<a href="../../../overlay-play/vg-overlay-play/">
VgOverlayPlay
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.6" data-path="../../../streaming/">
<a href="../../../streaming/">
videogular2/streaming
</a>
<ul class="articles">
<li class="chapter " data-level="3.6.1" data-path="../../../streaming/vg-dash/">
<a href="../../../streaming/vg-dash/">
VgDASH
</a>
</li>
<li class="chapter " data-level="3.6.2" data-path="../../../streaming/vg-hls/">
<a href="../../../streaming/vg-hls/">
VgHLS
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../../.." >VgControlsHidden</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="vgcontrolshidden-injectable-service">VgControlsHidden @Injectable Service</h1>
<p>Service to handle when controls are hidden or shown.</p>
<p>The Provider for the Dependency Injection is <code>vg-player</code>.</p>
<h2 id="methods">Methods</h2>
<h3 id="statevaluebooleanvoid">state(value:boolean):void</h3>
<p>Sets the state of the controls. Hidden is <code>true</code> and shown is <code>false</code>. To change this value will execute the <code>isHidden</code> Observable.</p>
<hr>
<h2 id="properties">Properties</h2>
<h3 id="ishidden-observable">isHidden :Observable<boolean></boolean></h3>
<p>Returns an Observable that returns a boolean when the controls are shown (<code>false</code>) or hidden (<code>true</code>).</p>
<h2 id="how-to-use">How to use</h2>
<p>This is an example of how to use this Service in a Component:</p>
<pre><code class="lang-typescript"><span class="hljs-comment">// Imports and @Component() decorator</span>
<span class="hljs-comment">// This component must be inside VgPlayer</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">class</span> MyCustomComponent <span class="hljs-keyword">implements</span> OnDestroy {
subscriptions: Subscription[] = [];
<span class="hljs-keyword">constructor</span>(private controlsHidden: VgControlsHidden) {
}
<span class="hljs-comment">// @Output from vg-player component</span>
onPlayerReady() {
<span class="hljs-keyword">this</span>.subscriptions.push(<span class="hljs-keyword">this</span>.controlsHidden.isHidden.subscribe(<span class="hljs-keyword">this</span>.onHideControls.bind(<span class="hljs-keyword">this</span>)));
}
hideControls() {
<span class="hljs-keyword">this</span>.hidden.state(<span class="hljs-literal">true</span>);
}
showControls() {
<span class="hljs-keyword">this</span>.hidden.state(<span class="hljs-literal">false</span>);
}
onHideControls(state:<span class="hljs-built_in">boolean</span>) {
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Are controls hidden?'</span>, state);
}
ngOnDestroy() {
<span class="hljs-keyword">this</span>.subscriptions.forEach(s => s.unsubscribe());
}
}
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../vg-utils/" class="navigation navigation-prev " aria-label="Previous page: VgUtils">
<i class="fa fa-angle-left"></i>
</a>
<a href="../../vg-cue-points/" class="navigation navigation-next " aria-label="Next page: VgCuePoints">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"VgControlsHidden","level":"3.1.6","depth":2,"next":{"title":"VgCuePoints","level":"3.1.7","depth":2,"path":"modules/core/vg-cue-points/README.md","ref":"modules/core/vg-cue-points/README.md","articles":[]},"previous":{"title":"VgUtils","level":"3.1.5","depth":2,"path":"modules/core/services/vg-utils/README.md","ref":"modules/core/services/vg-utils/README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["ga","responsive-iframes"],"pluginsConfig":{"ga":{"configuration":"auto","token":"UA-45418240-1"},"responsive-iframes":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"modules/core/services/vg-controls-hidden/README.md","mtime":"2017-06-22T07:43:44.601Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-06-22T07:45:27.174Z"},"basePath":"../../../..","book":{"language":""}});
});
</script>
</div>
<script src="../../../../gitbook/gitbook.js"></script>
<script src="../../../../gitbook/theme.js"></script>
<script src="../../../../gitbook/gitbook-plugin-ga/plugin.js"></script>
<script src="../../../../gitbook/gitbook-plugin-responsive-iframes/plugin.js"></script>
<script src="../../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../../../../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>