Skip to content

Commit

Permalink
Deployed c32c30c with MkDocs version: 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgangso committed Aug 14, 2023
1 parent 9e7875e commit ba08d57
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 42 deletions.
96 changes: 94 additions & 2 deletions advanced-usage/custom-controls/index.html

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions advanced-usage/hdr-content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ <h1 id="hdr-content-surfaceview">HDR content / SurfaceView</h1>
<p>HDR should work fine on iOS.</p>
<p>On Android, you need to enable SurfaceViews. However, the reason this isn't enabled by default is because flutter has a bug with surface views.
Check out <a href="https://github.com/flutter/flutter/issues/89558">this issue on the flutter repo</a>.</p>
<p>You can opt-in to using surfaceViews via the <code>useSurfaceView</code> property on VideoPlayerView or VideoPlatformView:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">VideoPlayerView</span><span class="p">(</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="w"> </span><span class="nl">controller:</span><span class="w"> </span><span class="n">controller</span><span class="p">,</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span><span class="nl">useSurfaceView:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="p">),</span>
<p>You can opt-in to using surfaceViews via the <code>useSurfaceView</code> property on BccmPlayerView or VideoPlatformView:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">BccmPlayerView</span><span class="p">(</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="w"> </span><span class="n">controller</span><span class="p">,</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span><span class="nl">config:</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">BccmPlayerViewConfig</span><span class="p">(</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="nl">useSurfaceView:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="w"> </span><span class="p">),</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="p">),</span>
</code></pre></div>

</div>
Expand Down
6 changes: 3 additions & 3 deletions advanced-usage/primary-player/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ <h3 id="primary-player">Primary player</h3>
<li>cast sessions will automatically claim the primaryPlayer (so you don't need extra logic for handling the cast sessions)</li>
</ul>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c1">// The primary player is automatically initialized on startup</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="c1">// It&#39;s accessible via BccmPlatformInterface.instance:</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="kd">final</span><span class="w"> </span><span class="n">controller</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlatformInterface</span><span class="p">.</span><span class="n">instance</span><span class="p">.</span><span class="n">primaryController</span><span class="p">;</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="c1">// It&#39;s accessible statically via BccmPlayerController.primary:</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="kd">final</span><span class="w"> </span><span class="n">controller</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlayerController</span><span class="p">.</span><span class="n">primary</span><span class="p">;</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="c1">// Change video with replaceCurrentMediaItem</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="kd">await</span><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">replaceCurrentMediaItem</span><span class="p">(</span>
Expand All @@ -116,7 +116,7 @@ <h3 id="primary-player">Primary player</h3>
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="w"> </span><span class="p">);</span>
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a>
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="c1">// Display as usual</span>
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="kd">final</span><span class="w"> </span><span class="n">widget</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">VideoPlayerView</span><span class="p">(</span><span class="nl">controller:</span><span class="w"> </span><span class="n">controller</span><span class="p">);</span>
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="kd">final</span><span class="w"> </span><span class="n">widget</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlayerView</span><span class="p">(</span><span class="n">controller</span><span class="p">);</span>
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a>
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a><span class="c1">// You don&#39;t need to (and actually can&#39;t) dispose the primary player.</span>
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">controller</span><span class="p">.</span><span class="n">isPrimary</span><span class="p">)</span><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">dispose</span><span class="p">();</span>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ <h1 id="installation">Installation</h1>

<!--
MkDocs version : 1.5.2
Build Date UTC : 2023-08-09 12:50:17.441329+00:00
Build Date UTC : 2023-08-14 14:04:05.013136+00:00
-->
Binary file modified sitemap.xml.gz
Binary file not shown.
60 changes: 29 additions & 31 deletions usage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,45 +103,43 @@ <h2 id="initialize">Initialize</h2>
</code></pre></div>
<h2 id="basic-usage">Basic usage</h2>
<p><em>Note: This is mostly to explain how things work. Even for simple use cases, we recommend skipping straight to "Advanced Usage".</em></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="c1">// Use the primary player, or create a new one</span>
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="kd">final</span><span class="w"> </span><span class="n">controller</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlayerInterface</span><span class="p">.</span><span class="n">instance</span><span class="p">.</span><span class="n">primaryController</span><span class="p">;</span>
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="kd">final</span><span class="w"> </span><span class="n">controller</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlayerController</span><span class="p">(</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="c1">// Use the primary player (always available and initialized)</span>
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="kd">final</span><span class="w"> </span><span class="n">controller</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlayerController</span><span class="p">.</span><span class="n">primary</span><span class="p">;</span>
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="kd">await</span><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">replaceCurrentMediaItem</span><span class="p">(</span>
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="w"> </span><span class="n">MediaItem</span><span class="p">(</span>
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="w"> </span><span class="nl">url:</span><span class="w"> </span><span class="s1">&#39;https://devstreaming-cdn.apple.com/videos/streaming/examples/adv_dv_atmos/main.m3u8&#39;</span><span class="p">,</span>
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="w"> </span><span class="nl">mimeType:</span><span class="w"> </span><span class="s1">&#39;application/x-mpegURL&#39;</span><span class="p">,</span>
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="w"> </span><span class="nl">url:</span><span class="w"> </span><span class="s1">&#39;https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4&#39;</span><span class="p">,</span>
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="w"> </span><span class="nl">mimeType:</span><span class="w"> </span><span class="s1">&#39;video/mp4&#39;</span><span class="p">,</span>
<a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="w"> </span><span class="nl">metadata:</span><span class="w"> </span><span class="n">MediaMetadata</span><span class="p">(</span><span class="nl">title:</span><span class="w"> </span><span class="s1">&#39;Apple advanced (HLS/HDR)&#39;</span><span class="p">),</span>
<a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a><span class="w"> </span><span class="p">),</span>
<a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a><span class="w"> </span><span class="p">);</span>
<a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a>
<a id="__codelineno-1-11" name="__codelineno-1-11" href="#__codelineno-1-11"></a><span class="c1">// Initialize</span>
<a id="__codelineno-1-12" name="__codelineno-1-12" href="#__codelineno-1-12"></a><span class="kd">await</span><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">initialize</span><span class="p">();</span>
<a id="__codelineno-1-13" name="__codelineno-1-13" href="#__codelineno-1-13"></a>
<a id="__codelineno-1-14" name="__codelineno-1-14" href="#__codelineno-1-14"></a><span class="c1">// Show it via a widget</span>
<a id="__codelineno-1-15" name="__codelineno-1-15" href="#__codelineno-1-15"></a><span class="nd">@override</span>
<a id="__codelineno-1-16" name="__codelineno-1-16" href="#__codelineno-1-16"></a><span class="n">Widget</span><span class="w"> </span><span class="n">build</span><span class="p">(</span><span class="n">BuildContext</span><span class="w"> </span><span class="n">context</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-1-17" name="__codelineno-1-17" href="#__codelineno-1-17"></a><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">VideoPlayerView</span><span class="p">(</span><span class="nl">controller:</span><span class="w"> </span><span class="n">controller</span><span class="p">);</span>
<a id="__codelineno-1-18" name="__codelineno-1-18" href="#__codelineno-1-18"></a><span class="p">}</span>
<a id="__codelineno-1-19" name="__codelineno-1-19" href="#__codelineno-1-19"></a>
<a id="__codelineno-1-20" name="__codelineno-1-20" href="#__codelineno-1-20"></a><span class="c1">// Change video with replaceCurrentMediaItem</span>
<a id="__codelineno-1-21" name="__codelineno-1-21" href="#__codelineno-1-21"></a><span class="kd">await</span><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">replaceCurrentMediaItem</span><span class="p">(</span>
<a id="__codelineno-1-22" name="__codelineno-1-22" href="#__codelineno-1-22"></a><span class="w"> </span><span class="n">MediaItem</span><span class="p">(</span>
<a id="__codelineno-1-23" name="__codelineno-1-23" href="#__codelineno-1-23"></a><span class="w"> </span><span class="nl">url:</span><span class="w"> </span><span class="s1">&#39;https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4&#39;</span><span class="p">,</span>
<a id="__codelineno-1-24" name="__codelineno-1-24" href="#__codelineno-1-24"></a><span class="w"> </span><span class="nl">mimeType:</span><span class="w"> </span><span class="s1">&#39;video/mp4&#39;</span><span class="p">,</span>
<a id="__codelineno-1-25" name="__codelineno-1-25" href="#__codelineno-1-25"></a><span class="w"> </span><span class="nl">metadata:</span><span class="w"> </span><span class="n">MediaMetadata</span><span class="p">(</span><span class="nl">title:</span><span class="w"> </span><span class="s1">&#39;Apple advanced (HLS/HDR)&#39;</span><span class="p">),</span>
<a id="__codelineno-1-26" name="__codelineno-1-26" href="#__codelineno-1-26"></a><span class="w"> </span><span class="p">),</span>
<a id="__codelineno-1-27" name="__codelineno-1-27" href="#__codelineno-1-27"></a><span class="w"> </span><span class="p">);</span>
<a id="__codelineno-1-28" name="__codelineno-1-28" href="#__codelineno-1-28"></a>
<a id="__codelineno-1-29" name="__codelineno-1-29" href="#__codelineno-1-29"></a><span class="c1">// If you created a new player (not primary), remember to dispose it</span>
<a id="__codelineno-1-30" name="__codelineno-1-30" href="#__codelineno-1-30"></a><span class="nd">@override</span>
<a id="__codelineno-1-31" name="__codelineno-1-31" href="#__codelineno-1-31"></a><span class="kt">void</span><span class="w"> </span><span class="n">dispose</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-1-32" name="__codelineno-1-32" href="#__codelineno-1-32"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">controller</span><span class="p">.</span><span class="n">isPrimary</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-1-33" name="__codelineno-1-33" href="#__codelineno-1-33"></a><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">dispose</span><span class="p">();</span>
<a id="__codelineno-1-34" name="__codelineno-1-34" href="#__codelineno-1-34"></a><span class="w"> </span><span class="p">}</span>
<a id="__codelineno-1-35" name="__codelineno-1-35" href="#__codelineno-1-35"></a><span class="p">}</span>
<a id="__codelineno-1-11" name="__codelineno-1-11" href="#__codelineno-1-11"></a><span class="c1">// or create a new one, optionally with a MediaItem</span>
<a id="__codelineno-1-12" name="__codelineno-1-12" href="#__codelineno-1-12"></a><span class="kd">final</span><span class="w"> </span><span class="n">controller</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BccmPlayerController</span><span class="p">(</span>
<a id="__codelineno-1-13" name="__codelineno-1-13" href="#__codelineno-1-13"></a><span class="w"> </span><span class="n">MediaItem</span><span class="p">(</span>
<a id="__codelineno-1-14" name="__codelineno-1-14" href="#__codelineno-1-14"></a><span class="w"> </span><span class="nl">url:</span><span class="w"> </span><span class="s1">&#39;https://devstreaming-cdn.apple.com/videos/streaming/examples/adv_dv_atmos/main.m3u8&#39;</span><span class="p">,</span>
<a id="__codelineno-1-15" name="__codelineno-1-15" href="#__codelineno-1-15"></a><span class="w"> </span><span class="nl">mimeType:</span><span class="w"> </span><span class="s1">&#39;application/x-mpegURL&#39;</span><span class="p">,</span>
<a id="__codelineno-1-16" name="__codelineno-1-16" href="#__codelineno-1-16"></a><span class="w"> </span><span class="nl">metadata:</span><span class="w"> </span><span class="n">MediaMetadata</span><span class="p">(</span><span class="nl">title:</span><span class="w"> </span><span class="s1">&#39;Apple advanced (HLS/HDR)&#39;</span><span class="p">),</span>
<a id="__codelineno-1-17" name="__codelineno-1-17" href="#__codelineno-1-17"></a><span class="w"> </span><span class="p">),</span>
<a id="__codelineno-1-18" name="__codelineno-1-18" href="#__codelineno-1-18"></a><span class="w"> </span><span class="p">);</span>
<a id="__codelineno-1-19" name="__codelineno-1-19" href="#__codelineno-1-19"></a><span class="kd">await</span><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">initialize</span><span class="p">();</span>
<a id="__codelineno-1-20" name="__codelineno-1-20" href="#__codelineno-1-20"></a>
<a id="__codelineno-1-21" name="__codelineno-1-21" href="#__codelineno-1-21"></a><span class="c1">// Show it via a widget</span>
<a id="__codelineno-1-22" name="__codelineno-1-22" href="#__codelineno-1-22"></a><span class="nd">@override</span>
<a id="__codelineno-1-23" name="__codelineno-1-23" href="#__codelineno-1-23"></a><span class="n">Widget</span><span class="w"> </span><span class="n">build</span><span class="p">(</span><span class="n">BuildContext</span><span class="w"> </span><span class="n">context</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-1-24" name="__codelineno-1-24" href="#__codelineno-1-24"></a><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">BccmPlayerView</span><span class="p">(</span><span class="n">controller</span><span class="p">);</span>
<a id="__codelineno-1-25" name="__codelineno-1-25" href="#__codelineno-1-25"></a><span class="p">}</span>
<a id="__codelineno-1-26" name="__codelineno-1-26" href="#__codelineno-1-26"></a>
<a id="__codelineno-1-27" name="__codelineno-1-27" href="#__codelineno-1-27"></a><span class="c1">// If you created a new player (not primary), remember to dispose it</span>
<a id="__codelineno-1-28" name="__codelineno-1-28" href="#__codelineno-1-28"></a><span class="nd">@override</span>
<a id="__codelineno-1-29" name="__codelineno-1-29" href="#__codelineno-1-29"></a><span class="kt">void</span><span class="w"> </span><span class="n">dispose</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-1-30" name="__codelineno-1-30" href="#__codelineno-1-30"></a><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">controller</span><span class="p">.</span><span class="n">isPrimary</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-1-31" name="__codelineno-1-31" href="#__codelineno-1-31"></a><span class="w"> </span><span class="n">controller</span><span class="p">.</span><span class="n">dispose</span><span class="p">();</span>
<a id="__codelineno-1-32" name="__codelineno-1-32" href="#__codelineno-1-32"></a><span class="w"> </span><span class="p">}</span>
<a id="__codelineno-1-33" name="__codelineno-1-33" href="#__codelineno-1-33"></a><span class="p">}</span>
</code></pre></div>
<p>Use the widgets:</p>
<ul>
<li>VideoPlayerView(): The normal widget for displaying a video with controls.</li>
<li>BccmPlayerView(): The normal widget for displaying a video with controls.</li>
<li>VideoPlatformView(): A raw video widget</li>
<li>CastButton(): A button to connect to cast-enabled devices</li>
<li>MiniPlayer(): A skeleton widget included for convenience.</li>
Expand Down

0 comments on commit ba08d57

Please sign in to comment.