[Multimedia] Add guide for the screen mirroring 76/154276/2
authorcoderhyme <jhyo.kim@samsung.com>
Tue, 10 Oct 2017 03:34:05 +0000 (12:34 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Tue, 10 Oct 2017 09:22:27 +0000 (12:22 +0300)
PS2: Reviewed

Change-Id: I62aff4979d44c794de0b4446f571fac4ec83ed50
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
org.tizen.guides/html/dotnet/media/screen_mirroring.htm [new file with mode: 0644]
org.tizen.guides/html/images/screen_mirroring_states_cs.png [new file with mode: 0644]

diff --git a/org.tizen.guides/html/dotnet/media/screen_mirroring.htm b/org.tizen.guides/html/dotnet/media/screen_mirroring.htm
new file mode 100644 (file)
index 0000000..3100948
--- /dev/null
@@ -0,0 +1,152 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />
+       <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
+       <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
+       <script type="text/javascript" src="../../scripts/snippet.js"></script>
+       <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
+       <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
+       <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
+       <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
+
+       <title>Screen Mirroring</title>
+
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+
+<div id="toc-navigation">
+       <div id="toc_border"><div id="toc">
+               <p class="toc-title">Dependencies</p>
+               <ul class="toc">
+                       <li>Tizen 4.0 and Higher</li>
+               </ul>
+
+               <p class="toc-title">Content</p>
+                       <ul class="toc">
+                       <li><a href="#prerequisites">Prerequisites</a></li>
+            <li><a href="#prepare">Preparing for Screen Mirroring</a></li>
+            <li><a href="#connect">Connecting and Starting Screen Mirroring</a></li>
+            <li><a href="#handle">Handling Screen Mirroring Errors</a></li>
+                       </ul>
+
+               <p class="toc-title">Related Info</p>
+               <ul class="toc">
+                       <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Remoting_1_1ScreenMirroring.html">Tizen.Multimedia.Remoting.ScreenMirroring Class</a></li>
+               </ul>
+       </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Screen Mirroring</h1>
+
+<p>You can mirror the device screen and sound to another device wirelessly using the screen mirroring feature. Tizen follows the Wi-Fi Display Technical Specification and supports the feature as a sink which receives shared data from a source device that supports the Wi-Fi Display, and displays it. Remember to prepare your application to use the screen mirroring sink functionality and set up the necessary callbacks before you start, and release the resources when you are done.</p>
+
+<p>The main features of the <code>Tizen.Multimedia.Remoting.ScreenMirroring</code> class include:</p>
+
+<ul>
+       <li>Preparing for screen mirroring
+       <p>You can <a href="#prepare">prepare for screen mirroring</a> by registering an event handler to track screen mirroring state changes.</p>
+       </li>
+       <li>Managing the connection to the screen mirroring source
+       <p>You can <a href="#connect">connect to a screen mirroring source</a>, and start, pause, and resume the screen mirroring sink.</p>
+       </li>
+       <li>Monitoring state changes in the screen mirroring sink
+       <p>To track state changes, you can register an event handler for the <code>StateChanged</code> event of the <code>Tizen.Multimedia.Remoting.ScreenMirroring</code> class.</p>
+       <p>You can also <a href="#handle">handle any errors</a> with the <code>ErrorOccurred</code> event.</p>
+       </li>
+</ul>
+
+  <p>The following figure illustrates the screen mirroring states.</p>
+  <p align="center"><strong>Figure: Screen mirroring state diagram</strong></p>
+  <p align="center"><img src="../../images/screen_mirroring_states_cs.png" alt="State diagram"/></p>
+
+<h2 id="prerequisites">Prerequisites</h2>
+
+<p>To use the methods and properties of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Remoting_1_1ScreenMirroring.html">Tizen.Multimedia.Remoting.ScreenMirroring</a> class, include the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia_1_1Remoting.html">Tizen.Multimedia.Remoting</a> namespace in your application:</p>
+
+<pre class="prettyprint">
+using Tizen.Multimedia.Remoting;
+</pre>
+
+<h2 id="prepare">Preparing for Screen Mirroring</h2>
+
+<p>To prepare for screen mirroring:</p>
+
+<ol>
+       <li>Define and register an event handler for the <code>StateChanged</code> event of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Remoting_1_1ScreenMirroring.html">Tizen.Multimedia.Remoting.ScreenMirroring</a> class:
+<pre class="prettyprint">
+void OnStateChanged(object sender, ScreenMirroringStateChangedEventArgs args)
+{
+    Tizen.Log.Info(LOG_TAG, $"Current state = {args.State}");
+}
+
+screenMirroring.StateChanged += OnStateChanged;
+</pre>
+       </li>
+       <li>Prepare the screen mirroring sink using the <code>Prepare()</code> method with an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Display.html">Tizen.Multimedia.Display</a> class as a parameter:
+<pre class="prettyprint">
+screenMirroring.Prepare(new Display(mediaView));
+</pre>
+       <p>The screen mirroring state changes to <code>Prepared</code>.</p>
+       </li>
+</ol>
+
+<h2 id="connect">Connecting and Starting Screen Mirroring</h2>
+
+<p>To connect to a source and start screen mirroring:</p>
+
+<ol>
+       <li>Connect to the screen mirroring source using the <code>ConnectAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Remoting_1_1ScreenMirroring.html">Tizen.Multimedia.Remoting.ScreenMirroring</a> class with the source IP address as a parameter:
+<pre class="prettyprint">
+await screenMirroring.ConnectAsync(ipAddress);
+</pre>
+       <p>The screen mirroring state changes to <code>Connected</code>.</p>
+       </li>
+       <li>Start the screen mirroring using the <code>StartAsync()</code> method:
+<pre class="prettyprint">
+await screenMirroring.StartAsync();
+</pre>
+       <p>The screen mirroring state changes from <code>Connected</code> to <code>Playing</code>.</p>
+       </li>
+</ol>
+
+<h2 id="handle">Handling Screen Mirroring Errors</h2>
+
+<p>You can receive notifications of errors caused by internal screen mirroring issues or by the source device disconnecting the session. Define and register an event handler for the <code>ErrorOccurred</code> event of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Remoting_1_1ScreenMirroring.html">Tizen.Multimedia.Remoting.ScreenMirroring</a> class:</p>
+<pre class="prettyprint">
+void OnErrorOccurred(object sender, ScreenMirroringErrorOccurredEventArgs args)
+{
+    Tizen.Log.Info(LOG_TAG, $"Error = {args.Error}");
+}
+
+screenMirroring.ErrorOccurred += OnStateChanged;
+</pre>
+
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../scripts/showhide.js"></script>
+</div></div></div>
+
+
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
diff --git a/org.tizen.guides/html/images/screen_mirroring_states_cs.png b/org.tizen.guides/html/images/screen_mirroring_states_cs.png
new file mode 100644 (file)
index 0000000..ceb9a47
Binary files /dev/null and b/org.tizen.guides/html/images/screen_mirroring_states_cs.png differ