Symbian3/SDK/Source/GUID-5F4510C9-5B16-593A-A225-37606800915B.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     6
<!-- Initial Contributors:
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     8
Contributors: 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     9
-->
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    10
<!DOCTYPE concept
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    12
<concept xml:lang="en" id="GUID-5F4510C9-5B16-593A-A225-37606800915B"><title>Controlling Video Playback</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to control video playback. </p> <section><title>Purpose</title> <p>The purpose of this tutorial is to show you how to use the video player to control video playback. </p> <p><b>Required Background</b> </p> <p>The <xref href="GUID-2DC80BA9-7AA2-5CD3-9105-1DE28CE196C1.dita">Video Client Overview</xref> introduces the video client utilities. </p> <p><b>Introduction</b> </p> <p>The video player utility is used to open, play, and obtain information from sampled video data. This functionality is implemented by the <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita"><apiname>CVideoPlayerUtility</apiname></xref> class. The video data can be supplied either in a file, a descriptor or a URL. </p> <p>The sequence diagram below explains the different functionalities of the Video Player Utility: </p> <fig id="GUID-2EA17DB0-6634-5E49-BB86-01C42C1135FC"><title>
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    13
                Video Player sequence diagram 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    14
             </title> <image href="GUID-821FEEDD-81B8-5511-AC4E-B673A96F8CB4_d0e292804_href.png" placement="inline"/></fig> </section> <section><title>Using Video Player </title> <p>The following tasks will be covered in this tutorial: </p> <ul><li id="GUID-CAF49972-CFDE-5061-9218-31E38BC81B6D"><p><xref href="GUID-5F4510C9-5B16-593A-A225-37606800915B.dita#GUID-5F4510C9-5B16-593A-A225-37606800915B/GUID-B8EAAD02-FBDF-5C9D-B29E-0256FE85BEFC">Play Video Clips</xref>  </p> </li> <li id="GUID-6BAF2C1B-8A15-57D3-9DC0-A29A640AFFBF"><p><xref href="GUID-5F4510C9-5B16-593A-A225-37606800915B.dita#GUID-5F4510C9-5B16-593A-A225-37606800915B/GUID-FD4809DF-3F92-528D-856E-40E1F468B44E">Get Current Frame</xref>  </p> </li> </ul> <p id="GUID-B8EAAD02-FBDF-5C9D-B29E-0256FE85BEFC"><b>Playing Video Clips</b> </p> <p>The high level steps to play video clips are shown here: </p> <ol id="GUID-7B98B85D-2B14-5613-9B12-B804B64F9AC6"><li id="GUID-101DA10D-4871-596C-9B70-F5A7465AA466"><p>After configuring the properties, the <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-A9DCC4EB-B4B3-3AF4-B78C-DC3531A32DCC"><apiname>CVideoPlayerUtility::Play()</apiname></xref> function is called for the video clip to be played. </p> </li> <li id="GUID-99101893-33E0-5C2D-981C-FEF63EC19126"><p>The play can be paused for a small duration using <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-CCF5BF0E-BD93-34AC-812E-443ECD07FE26"><apiname>CVideoPlayerUtility::PauseL()</apiname></xref> and later resumed by calling <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-A9DCC4EB-B4B3-3AF4-B78C-DC3531A32DCC"><apiname>CVideoPlayerUtility::Play()</apiname></xref> function once again. </p> </li> <li id="GUID-25191728-63D1-5479-8B60-3B047E9FAD80"><p>To halt the video play <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-C103A911-AF93-3350-B731-C186A279F1DC"><apiname>CVideoPlayerUtility::Stop()</apiname></xref> is called. </p> </li> <li id="GUID-950B9AA4-E72B-5FCD-91EB-623A98E290E2"><p>In order to unload all related controllers and return, use <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-C30FFC28-BA6E-3467-9DE7-EE0FF6202E26"><apiname>CVideoPlayerUtility::Close()</apiname></xref>. </p> </li> </ol> <p>These high level steps are shown in the following example code: </p> <codeblock id="GUID-6CC6023A-FBFF-549B-BE29-16AF112D2BB3" xml:space="preserve">void CPlayVideo::Play() //Starts playback of the video clip
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    15
    {
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    16
    iVideoUtility-&gt;Play();
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    17
    } 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    18
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    19
void CPlayVideo::PauseL() //Call to this function will maintain the current position
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    20
                         //playback can be resumed by calling Play function again
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    21
    {
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    22
    TRAPD(err,iVideoUtility-&gt;PauseL());
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    23
    } 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    24
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    25
TInt CPlayVideo::Stop() //Stops playing
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    26
    {
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    27
    TInt err = iVideoUtility-&gt;Stop();
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    28
          return err;
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    29
    } </codeblock> <p> <b>Note</b>: You must call the <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-B4FB00AA-A85B-3A3F-91BE-C5347462BA95"><apiname>CVideoPlayerUtility::Prepare()</apiname></xref> function, before calling any of the functions used in the above given code. </p> <p id="GUID-FD4809DF-3F92-528D-856E-40E1F468B44E"><b>Getting the Current Frame</b> </p> <p>The high level steps to get the current frame are shown here: </p> <ol id="GUID-20183DA8-8420-55C2-BE57-41F22A7E8E72"><li id="GUID-E362BBDA-AAF1-549C-AC69-B1CC6E451316"><p>To get the video frame currently being played, use the <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-F548125E-6CCC-3E60-A3CC-34EBB7A2ABAE"><apiname>CVideoPlayerUtility::GetFrameL()</apiname></xref> function. </p> <codeblock id="GUID-CB83EA9D-8512-57C6-ADA3-2C0D9C0E1B25" xml:space="preserve">void CPlayVideo::GetFrameL(TDisplayMode aDisplayMode) //Returns the current frame
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    30
    {
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    31
    iVideoUtility-&gt;GetFrameL(aDisplayMode);
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    32
    } </codeblock> </li> <li id="GUID-EB7BB8CB-94F7-5399-9296-A96F6065B52B"><p>The current frame is sent to the client asynchronously via the <xref href="GUID-4D07E7B5-AFDD-3D55-8EB6-EDAB61F8C7F9.dita#GUID-4D07E7B5-AFDD-3D55-8EB6-EDAB61F8C7F9/GUID-7CCF35C6-DEA8-3E9B-B55C-AE236E4AB63E"><apiname>MVideoPlayerUtilityObserver::MvpuoFrameReady()</apiname></xref> callback function. </p> </li> </ol> </section> <section><title>See Also</title> <p><xref href="GUID-172F46C1-6066-57FA-A815-5AC23ACE159D.dita">Creating and Preparing a Video Player</xref>  </p> <p><xref href="GUID-F9896E96-1076-552D-AE54-8F9DABED867F.dita">Configuring the Video Player</xref> </p> <p><xref href="GUID-733B9695-0C7C-5637-9025-6CE3BAA1A23E.dita"> Enabling/Disabling Audio or Video Playback Separately</xref>  </p> <p><xref href="GUID-FE7DE542-3FD4-56D2-B281-C670EF1C4FEB.dita">Scaling Automatically</xref>  </p> <p><xref href="GUID-70B3881F-9532-5F1D-B210-99A15DB93FC2.dita">Fast Forwarding and Rewinding</xref>  </p> <p><xref href="GUID-469377FB-AAE8-5245-A8E1-469C65AFE5C5.dita">Stepping Frames</xref>  </p> <p><xref href="GUID-F13C7D36-E4AB-57F1-87A1-EB83AA2258DF.dita">Controlling the Video Controller Plugin</xref>  </p> </section> </conbody></concept>