201021
authorhgs
Fri, 28 May 2010 09:45:19 +0300
changeset 39 f6d44a0cd476
parent 38 ff53afa8ad05
child 40 13331705e488
201021
inc/mpxvideoplayercustomviewmsgconsts.h
layers.sysdef.xml
videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h
videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h
videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp
videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp
videocollection/tsrc/stubs/inc/hbaction.h
videocollection/tsrc/stubs/inc/hbinputdialog.h
videocollection/tsrc/stubs/inc/hblistview.h
videocollection/tsrc/stubs/inc/testobjectstore.h
videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h
videocollection/tsrc/stubs/inc/videolistwidgetdata.h
videocollection/tsrc/stubs/inc/videoservicebrowse.h
videocollection/tsrc/stubs/inc/videoserviceurifetch.h
videocollection/tsrc/stubs/inc/xqserviceproviderstub.h
videocollection/tsrc/stubs/inc/xqserviceutilstub.h
videocollection/tsrc/stubs/src/hbinputdialog.cpp
videocollection/tsrc/stubs/src/videocollectionviewutils.cpp
videocollection/tsrc/stubs/src/videolistwidget.cpp
videocollection/tsrc/stubs/src/videoservicebrowse.cpp
videocollection/tsrc/stubs/src/videoserviceurifetch.cpp
videocollection/tsrc/stubs/src/xqserviceprovider.cpp
videocollection/tsrc/stubs/src/xqserviceutil.cpp
videocollection/tsrc/stubs/stubs.pro
videocollection/tsrc/videoservicestestapp/inc/videoservicestestappview.h
videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby
videocollection/tsrc/videoservicestestapp/src/main.cpp
videocollection/tsrc/videoservicestestapp/src/videoservicestestappview.cpp
videocollection/tsrc/videoservicestestapp/videoservicestestapp.pro
videocollection/videocollectionview/inc/videocollectionviewutils.h
videocollection/videocollectionview/inc/videolistwidget.h
videocollection/videocollectionview/src/videocollectionuiloader.cpp
videocollection/videocollectionview/src/videocollectionviewutils.cpp
videocollection/videocollectionview/src/videolistview.cpp
videocollection/videocollectionview/src/videolistwidget.cpp
videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp
videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp
videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp
videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h
videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp
videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro
videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp
videocollection/videocollectionwrapper/src/videodatacontainer.cpp
videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp
videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp
videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro
videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp
videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh
videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h
videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp
videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp
videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp
videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp
videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp
videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h
videoplayback/hbvideoplaybackview/resources/animation.axml
videoplayback/hbvideoplaybackview/resources/animations/generic_preroll_anim.axml
videoplayback/hbvideoplaybackview/resources/animations/rn_preroll_anim.axml
videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml
videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc
videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrol.hrh
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp
videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro
videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp
videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h
videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp
videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh
videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h
videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp
videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp
videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h
videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp
videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp
videoplayback/inc/hbvideobaseplaybackview.h
videoplayback/videohelix/group/mpxvideohelixplayback.mmp
videoplayback/videohelix/inc/mpxvideodlmgrif.h
videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h
videoplayback/videohelix/inc/mpxvideoplaybackmode.h
videoplayback/videohelix/src/mpxvideodlmgrif.cpp
videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
videoplayback/videohelix/src/mpxvideoplaybackstate.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg
videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h
videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h
videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp
videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp
videoplayerapp/bwins/videoplayerengineu.def
videoplayerapp/eabi/videoplayerengineu.def
videoplayerapp/inc/videoplayerengine.h
videoplayerapp/videoplayer/resources/service_conf.xml
videoplayerapp/videoplayer/rom/videoplayer.iby
videoplayerapp/videoplayer/rom/videoplayerresources.iby
videoplayerapp/videoplayer/sis/create_videoplayer_udeb_sisx.bat
videoplayerapp/videoplayer/sis/create_videoplayer_urel_sisx.bat
videoplayerapp/videoplayer/sis/videoplayer_stub.pkg
videoplayerapp/videoplayer/sis/videoplayer_stub.sis
videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg
videoplayerapp/videoplayer/sis/videoplayer_urel.pkg
videoplayerapp/videoplayer/src/main.cpp
videoplayerapp/videoplayer/videoplayer.pro
videoplayerapp/videoplayerapp.pro
videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp
videoplayerapp/videoplayerengine/src/videoplayerengine.cpp
videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp
--- a/inc/mpxvideoplayercustomviewmsgconsts.h	Fri May 14 15:14:51 2010 +0300
+++ b/inc/mpxvideoplayercustomviewmsgconsts.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,8 @@
 */
 
 
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#4 %
+
 
 #ifndef __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
 #define __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
@@ -31,5 +32,6 @@
 
 const TInt KMpxVideoPlaybackPdlReloading = 0x20024339;
 
+const TInt KMpxVideoPlaybackPdlReloadComplete = 0x2002433A;
 
 #endif // __MPXVIDEOPLAYERCUSTOMVIEWMSGCONSTS_H__
--- a/layers.sysdef.xml	Fri May 14 15:14:51 2010 +0300
+++ b/layers.sysdef.xml	Fri May 28 09:45:19 2010 +0300
@@ -40,6 +40,12 @@
 	</layer>  
 
 	<layer name="unit_test_layer">
+		<module name="videoplayback_tsrc">
+			<unit unitID="vado.videohelix_test" name="videohelix_tsrc" bldFile="&layer_real_source_path;/videoplayback/videohelix/tsrc/ut_videohelixtest/group" mrp=""/>
+		</module>
+		<module name="videocollection_tsrc">
+			<unit unitID="vado.mpxmyvideoscollection_test" name="mpxmyvideoscollection_tsrc" bldFile="&layer_real_source_path;/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group" mrp=""/>
+		</module>
 	</layer>  
 	
   </systemModel>
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h	Fri May 28 09:45:19 2010 +0300
@@ -280,14 +280,14 @@
      * @param aObserver The db change observer.
      */
     static CVcxMyVideosMdsDb* NewL( MVcxMyVideosMdsDbObserver* aObserver,
-            MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
+            RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL );
 
     /**
      * Two-phased constructor.
      * @param aObserver The db change observer.
      */
     static CVcxMyVideosMdsDb* NewLC( MVcxMyVideosMdsDbObserver* aObserver,
-            MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
+            RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL );
 
 
     /**
@@ -434,7 +434,7 @@
      * @param aFs      Session to file server.
      */
     CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
-            MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs );
+            RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL );
 
     void ConstructL();
 
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h	Fri May 28 09:45:19 2010 +0300
@@ -24,15 +24,6 @@
 class CVcxMyVideosMdsDb;
 
 #include "vcxmyvideosmdsdb.h"
-
-enum TVcxItemType
-    {
-    EVcxItemTypeNone,
-    EVcxItemTypeVideo,
-    EVcxItemTypeCategory,
-    EVcxItemTypeAlbum
-    };
-
 /**
  */
 NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h	Fri May 28 09:45:19 2010 +0300
@@ -25,6 +25,7 @@
 // FORWARD DECLARATIONS
 class CVcxMyVideosCollectionPlugin;
 class CMPXMedia;
+class CRepository;
 
 // CONSTANTS
 
@@ -490,7 +491,7 @@
         /**
          * Set to ETrue when doing videolist fetching.
          */
-        TBool IsFetchingVideoList;
+        TBool iIsFetchingVideoList;
     private:
 
         /**
@@ -508,6 +509,12 @@
          * order for fast access.
          */
         CVcxMyVideosVideoListIndex* iVideoListIndex;
+        
+        /**
+        * Provides access to the sorting order key in cenrep. Own.
+        */
+        CRepository* iCenRep;
+
     };
 
 #endif   // VCXMYVIDEOSVIDEOCACHE_H
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp	Fri May 28 09:45:19 2010 +0300
@@ -202,11 +202,8 @@
         
         media = videoListArray->AtL( i );
         
-        if ( media->IsSupported( KVcxMediaMyVideosOrigin ) )
-            {
-            origin = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );                
-            }
-        
+        origin = TVcxMyVideosCollectionUtil::OriginL( *media );
+                
         TBool newVideo = EFalse;
         TUint32 flags  = 0;
         
@@ -549,16 +546,15 @@
         {
         case -1:
             return KVcxMyVideosAllVideosCategoryIndex;
-            
-        case EVcxMyVideosOriginDownloaded:
-            return KVcxMyVideosDownloadsCategoryIndex;
-            
+                        
         case EVcxMyVideosOriginCapturedWithCamera:
             return KVcxMyVideosCapturedCategoryIndex;
                             
+        case EVcxMyVideosOriginDownloaded:
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
+            return KVcxMyVideosDownloadsCategoryIndex;
+#endif
         case EVcxMyVideosOriginTvRecording:
-            return KVcxMyVideosTvRecordingsCategoryIndex;
-
         case EVcxMyVideosOriginSideLoaded:                
         case EVcxMyVideosOriginOther:
         default:
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp	Fri May 28 09:45:19 2010 +0300
@@ -100,8 +100,11 @@
     MPX_FUNC("CVcxMyVideosCollectionPlugin::ConstructL");
     
     User::LeaveIfError( iFs.Connect() );
-        
-    iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, &AlbumsL(), iFs );    
+#ifdef VIDEO_COLLECTION_PLUGIN_TB92        
+    iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs );    
+#else
+    iMyVideosMdsDb = CVcxMyVideosMdsDb::NewL( this, iFs, &AlbumsL() );
+#endif
     iActiveTask    = CVcxMyVideosActiveTask::NewL( *this );
     iCache         = CVcxMyVideosVideoCache::NewL( *this );
     iMessageList   = CVcxMyVideosMessageList::NewL( *this );
@@ -432,7 +435,9 @@
             MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------------'");
                         
             iCache->RemoveL( aId );
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
             AlbumsL().RemoveAlbumsL( aId );
+#endif
             }
             break;
         
@@ -457,12 +462,14 @@
             // to not be videos are added to nonVideoIds.
             iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled, &nonVideoIds );
 
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
 #if 0 //TODO: do this if we want to support albums which are being added by someone else than My Videos Collection
             
             //After the call nonVideoIds will contain only items which were actually added
             //to albums.
             AlbumsL().AddAlbumsFromMdsL( nonVideoIds );
 #endif
+#endif
             
             if ( videoListFetchingWasCancelled )
                 {
@@ -478,7 +485,9 @@
             MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() Items modified in MDS, updating cache |");
             MPX_DEBUG1("CVcxMyVideosCollectionPlugin::DoHandleMyVideosDbEventL() --------------------------------------'");
             CMPXMedia* video;
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
             CMPXMedia* album;
+#endif
             TInt count = aId.Count();
             for ( TInt i = count - 1; i >= 0; i-- )
                 {
@@ -492,6 +501,10 @@
                     }
                 else
                     {
+#ifdef VIDEO_COLLECTION_PLUGIN_TB92
+                    MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS");
+                    aId.Remove( i );
+#else
                     MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: item was not found from videos, checking albums");
                     album = iMyVideosMdsDb->iAlbums->GetAlbumL( aId[i] );
                     
@@ -506,6 +519,7 @@
                         MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: couldn't find the modified item from MDS");
                         }
                     aId.Remove( i );
+#endif
                     }
                 }
             
@@ -531,6 +545,7 @@
                 }
             }
 
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
     //nonVideoIds are albums
     count = nonVideoIds.Count();
     for ( TInt i = 0; i < count; i++ )
@@ -539,11 +554,11 @@
                 TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) );
         }
 
+    iAlbums->UpdateChangedAlbumsL();
+#endif
+
     CleanupStack::PopAndDestroy( &nonVideoIds );
-    
-    iAlbums->UpdateChangedAlbumsL();
-    
-    iMessageList->SendL();
+	iMessageList->SendL();
     }
     
 // ----------------------------------------------------------------------------
@@ -906,35 +921,6 @@
 		}
     }
 
-#if 0
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::NotifyDownloadCompletedL( CMPXMedia& aVideo )
-    {
-    const TInt KMediaExtSize( 8 );
-    
-    HBufC8* buffer = HBufC8::NewL( KMediaExtSize );
-    CleanupStack::PushL( buffer );
-    TPtr8 des = buffer->Des();
-    
-    RDesWriteStream stream;
-    CleanupClosePushL( stream );
-    stream.Open( des );
-    
-    aVideo.ExternalizeL( stream );
-    
-    stream.CommitL();
-    
-    CleanupStack::PopAndDestroy( &stream );    
-    
-    DownloadUtilL().NotifyDownloadCompleted( *buffer );
-    
-    CleanupStack::PopAndDestroy( buffer );
-    }
-#endif
-
 // ----------------------------------------------------------------------------
 // CVcxMyVideosCollectionPlugin::NotifyNewVideosCountDecreasedL
 // ----------------------------------------------------------------------------
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp	Fri May 28 09:45:19 2010 +0300
@@ -254,10 +254,19 @@
     if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) )
         {
         origin = aVideo.ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin );                
-        if ( origin == EVcxMyVideosOriginSideLoaded )
+#ifdef VIDEO_COLLECTION_PLUGIN_TB92
+        if ( origin != EVcxMyVideosOriginCapturedWithCamera )
             {
             origin = EVcxMyVideosOriginOther;
             }
+#else
+        if ( origin != EVcxMyVideosOriginCapturedWithCamera &&
+				 origin != EVcxMyVideosOriginDownloaded
+				)
+            {
+            origin = EVcxMyVideosOriginOther;
+            }
+#endif
         }
     return origin;
     }
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp	Fri May 28 09:45:19 2010 +0300
@@ -1042,7 +1042,10 @@
         TObserverNotificationType aType,
         const RArray<TMdERelation>& aRelationArray)
     {
-    iObserver->HandleRelationEvent( aType, aRelationArray );
+    if ( iObserver )
+        {
+        iObserver->HandleRelationEvent( aType, aRelationArray );
+        }
     }
 
 #if 0
@@ -1059,7 +1062,10 @@
         {
         case ENotifyAdd:
             MPX_DEBUG1("CVcxMyVideosMdsAlbums:: relation ENotifyAdd");
-            iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
+            if ( iObserver )
+                {
+                iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
+                }
             break;
         case ENotifyModify:
             MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyModify");
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp	Fri May 28 09:45:19 2010 +0300
@@ -159,15 +159,17 @@
     }
 
 // ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::CVcxMyVideosMdsDb
 // ---------------------------------------------------------------------------
 //
 CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver,
-        MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+        RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
 : iFs( aFs ), iMdsDbObserver(aObserver), iAlbumsObserver(aAlbumsObserver) 
     {
     }
 
 // ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::ConstructL
 // ---------------------------------------------------------------------------
 //
 void CVcxMyVideosMdsDb::ConstructL()
@@ -274,10 +276,10 @@
 // ---------------------------------------------------------------------------
 //
 CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewL( MVcxMyVideosMdsDbObserver* aObserver,
-        MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+        RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
     {
     CVcxMyVideosMdsDb* self =
-            CVcxMyVideosMdsDb::NewLC( aObserver, aAlbumsObserver, aFs );
+            CVcxMyVideosMdsDb::NewLC( aObserver, aFs, aAlbumsObserver );
     CleanupStack::Pop( self );
     return self;
     }
@@ -287,9 +289,9 @@
 // ---------------------------------------------------------------------------
 //
 CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewLC( MVcxMyVideosMdsDbObserver* aObserver,
-        MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver, RFs& aFs )
+        RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver )
     {
-    CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aAlbumsObserver, aFs );
+    CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aFs, aAlbumsObserver );
     CleanupStack::PushL( self );
     self->ConstructL();
     return self;
@@ -1023,8 +1025,22 @@
     //16. ORIGIN, KVcxMediaMyVideosOrigin
     if ( aObject.Property( *iOriginPropertyDef, property, 0 ) != KErrNotFound )
         {
-        aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin,
-                static_cast<CMdEUint8Property*>(property)->Value() );
+        TUint8 origin = static_cast<CMdEUint8Property*>(property)->Value();
+#ifdef VIDEO_COLLECTION_PLUGIN_TB92
+        if( origin != EVcxMyVideosOriginCapturedWithCamera )
+            {
+            origin = EVcxMyVideosOriginOther;
+            }           
+#else
+        if ( origin != EVcxMyVideosOriginCapturedWithCamera &&
+				 origin != EVcxMyVideosOriginDownloaded
+				)
+            {
+            origin = EVcxMyVideosOriginOther;
+            }
+
+#endif
+        aVideo.SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, origin );
         }
 
     //17. DURATION, (KMPXMediaGeneralDuration can't be used since it is TInt
@@ -1573,11 +1589,6 @@
 
     iAudioLanguagePropertyDef = &(iVideoObjectDef->GetPropertyDefL(
             KVcxAudioLanguagePropertyName )); //14
-
-#if 0
-    iDownloadIdPropertyDef = &(iVideoObjectDef->GetPropertyDefL(
-            KVcxDownloadIdPropertyName )); //18
-#endif
     
     }
 
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp	Fri May 28 09:45:19 2010 +0300
@@ -106,7 +106,7 @@
     MPX_DEBUG1("CVcxMyVideosMessageList:: ----------------------------------------------'" );
 #endif
     
-    if ( AlreadyInMessageListL( aId, aChange, aExtraInfo ) )
+    if ( aChange == EMPXItemModified && AlreadyInMessageListL( aId, aChange, aExtraInfo ) )
         {
         MPX_DEBUG1("CVcxMyVideosMessageList:: already in message list, skipping add");
         return;
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp	Fri May 28 09:45:19 2010 +0300
@@ -125,8 +125,10 @@
         case categoryLevel:
             {
             //we are at root level, return main level items (categories + albums)
-            
+
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92            
             iCollection.AlbumsL().CreateAlbumListL(); //async
+#endif
 
             // This is needed to update category counters.
             // Goes to queue if CreateAlbumListL command goes to execution
@@ -139,8 +141,14 @@
             
             CMPXMedia* itemList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
             CleanupStack::PushL( itemList );
+            
+            itemList->SetTObjectValueL<TBool>( KVcxMediaMyVideosVideoListIsPartial,
+                !iCache.IsComplete() );
+                
             TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.CategoriesL().iList );
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
             TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.AlbumsL().iAlbumList );
+#endif
             itemList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
             iCollection.iObs->HandleOpen( itemList, KErrNone );
             CleanupStack::PopAndDestroy( itemList );
@@ -152,7 +160,9 @@
             {
             //we are at second level, return video list from some category or album
 
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
             iCollection.AlbumsL().CreateAlbumListL(); //async
+#endif
 
             TMPXItemId categoryId( aPath.Id() );
             
@@ -229,7 +239,7 @@
             CMPXMedia* videoList = iCache.CreateVideoListByOriginL( origin );
             MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen(new list)");
             videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
-            iCache.iVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+            videoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
                     EVcxMyVideosVideoListComplete );
             iCollection.iObs->HandleOpen( videoList, KErrNone );
             delete videoList;
@@ -266,8 +276,8 @@
                 iVideoListsBeingOpened.AppendL( videoList );
                 CleanupStack::Pop( videoList );
                 MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen");
-                iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
-                iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone  );
+                videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
+                iCollection.iObs->HandleOpen( videoList, KErrNone  );
                 }
             else
                 {
@@ -326,7 +336,7 @@
         // End event arrived
         
         iCache.SetComplete( ETrue );
-        iCache.IsFetchingVideoList = EFalse;
+        iCache.iIsFetchingVideoList = EFalse;
         
 
         // Create modify event for All category.
@@ -394,9 +404,6 @@
 //
 void CVcxMyVideosOpenHandler::HandleAlbumOpenL()
     {
-    //TODO: If iVideoList is partial and fetching is already going on -> use the implementation below.
-    //      If iVideoList is partial but fetching is not going on -> fetch only album items to iCache.
-
     MPX_DEBUG1("CVcxMyVideosOpenHandler::HandleAlbumOpenL() start");
     
     CVcxMyVideosAlbum* album = iCollection.AlbumsL().Album( iPendingAlbumOpenId );
@@ -406,17 +413,18 @@
             {
             //videolist complete
             CMPXMedia* videoList = album->CreateVideoListL();
+            CleanupStack::PushL( videoList ); // 1->
             videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
             videoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
                     EVcxMyVideosVideoListComplete ); 
             iCollection.iObs->HandleOpen( videoList, KErrNone );
-            delete videoList;
+            CleanupStack::PopAndDestroy( videoList ); // <-1
             iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
             iCollection.iMessageList->SendL();
             }
         else
             {
-            if ( iCollection.iCache->IsFetchingVideoList )
+            if ( iCollection.iCache->iIsFetchingVideoList )
                 {
                 MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist fetching already in progress -> use that to populate album");
 
@@ -443,9 +451,6 @@
                 }
             else
                 {
-                // videolist incomplete and fetching hasn't been started
-                // TODO: Test how fast this is. If slow, then ditch the separate album fetching.
-
                 MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist partial and no fetching going on -> fetch the album videos separately");
 
                 delete iAlbumVideoList;
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp	Fri May 28 09:45:19 2010 +0300
@@ -14,7 +14,7 @@
 * Description:   Video list cache. Contains cached data from MDS.*
 */
 
-// Version : %version: TB101_58 %
+
 
 
 // INCLUDE FILES
@@ -344,18 +344,8 @@
         {
         media = (*allVideosArray)[i];
 
-        TUint8 mediaOrigin = EVcxMyVideosOriginOther;
-
-        if ( media->IsSupported( KVcxMediaMyVideosOrigin ) )
-            {
-            mediaOrigin = *(media->Value<TUint8>( KVcxMediaMyVideosOrigin ));
-            
-            if ( mediaOrigin == EVcxMyVideosOriginSideLoaded )
-                {
-                mediaOrigin = EVcxMyVideosOriginOther;
-                }
-            }
-            
+        TUint8 mediaOrigin = TVcxMyVideosCollectionUtil::OriginL( *media );
+                    
         if ( mediaOrigin == aOrigin )
             {
             filteredVideosArray->AppendL( *media );
@@ -749,7 +739,7 @@
     
     TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
         
-    if ( IsFetchingVideoList
+    if ( iIsFetchingVideoList
             && sortingOrder == iLastSortingOrder && !aForce )
         {
         MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList creation is already ongoing, skipping");
@@ -760,11 +750,11 @@
         {
         MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating");
 
-        if ( IsFetchingVideoList )
+        if ( iIsFetchingVideoList )
             {
             MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it");
             iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList );
-            IsFetchingVideoList = EFalse;
+            iIsFetchingVideoList = EFalse;
             }
         
         ResetVideoListL();
@@ -790,7 +780,7 @@
                 EFalse /* brief list */,
                 iVideoList /* use existing */ );
 
-        IsFetchingVideoList = ETrue;
+        iIsFetchingVideoList = ETrue;
         iLastSortingOrder   = sortingOrder;
         SetComplete( EFalse );
         }
@@ -947,14 +937,18 @@
                 TBool modified = EFalse;
                 iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
                         *videoInCache, modified );
-    
+
+                TUint8 origin = TVcxMyVideosCollectionUtil::OriginL( *videoInCache );
+                
                 iCollection.CategoriesL().NewVideoFlagChangedL(
                         oldFlags, newFlags,
-                        videoInCache->ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin ),
+                        origin,
                         modified );
 
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
                 iCollection.AlbumsL().NewVideoFlagChangedL(
                         TVcxMyVideosCollectionUtil::IdL( *videoInCache ).iId1 );
+#endif
                 }
             changed = ETrue;
             }
@@ -1146,7 +1140,7 @@
             }
         }
     
-    // 22
+    // 23
     if ( aVideo.IsSupported( KMPXMediaVideoHeight ) )
         {
         TUint16 height = aVideo.ValueTObjectL<TUint16>( KMPXMediaVideoHeight ); 
@@ -1196,8 +1190,10 @@
     iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
             *aVideoInCache, modified );
 
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
     iCollection.AlbumsL().VideoTitleChangedL(
             TVcxMyVideosCollectionUtil::IdL( *aVideoInCache ).iId1 );
+#endif
     
     TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
     if ( sortingOrder == EVcxMyVideosSortingName )
@@ -1443,17 +1439,18 @@
 //    
 TVcxMyVideosSortingOrder CVcxMyVideosVideoCache::SortingOrderL()
     {
-    TUid uid;
-    uid.iUid = KVcxMyVideosCollectionCenrepUid;
-    CRepository* cenRep = CRepository::NewL( uid );
-    CleanupStack::PushL( cenRep ); // 1->
+
+    if( !iCenRep ) 
+        {
+        TUid uid;
+        uid.iUid = KVcxMyVideosCollectionCenrepUid;
+		iCenRep = CRepository::NewL( uid );
+        }
     
     TInt sortingOrderInCenrep;
 
-    TInt cenRepError = cenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
+    TInt cenRepError = iCenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
             sortingOrderInCenrep );
-
-    CleanupStack::PopAndDestroy( cenRep ); // <-1
     
     TVcxMyVideosSortingOrder sortingOrder;
     
@@ -1504,7 +1501,9 @@
     if ( aUpdateCategories )
         {
         iCollection.CategoriesL().VideoAddedL( aVideo );
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
         iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( aVideo );
+#endif
         }
 
     return KErrNone;
@@ -1557,14 +1556,14 @@
         MPX_DEBUG1("CVcxMyVideosVideoCache:: RemoveL failed since the item wasn't on cache");
         return KErrNotFound;
         }
-
-    TUint32 flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
     
     if ( aUpdateCategories &&
             pos != KErrNotFound /* no need to update if item is on iPartialVideoList*/ )
         {
         iCollection.CategoriesL().VideoRemovedL( *video );
+#ifndef VIDEO_COLLECTION_PLUGIN_TB92
         iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( *video );
+#endif
         }
         
     if ( pos != KErrNotFound )
@@ -1611,8 +1610,7 @@
     {
     MPX_FUNC("CVcxMyVideosVideoCache::ResetVideoListL");
 
-    //TODO: when should we cancel...
-    //iCollection.iMyVideosMdsDb->Cancel();
+    iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList );
 
     CMPXMediaArray* mediaArray =
             iVideoList->ValueCObjectL<CMPXMediaArray>( KMPXMediaArrayContents );
--- a/videocollection/tsrc/stubs/inc/hbaction.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbaction.h	Fri May 28 09:45:19 2010 +0300
@@ -26,13 +26,8 @@
 #include "hbicon.h"
 #include "hbmenu.h"
 
-class XQServiceUtil
-{
-public:
-    static void toBackground(bool value);
-    static bool isEmbedded(); 
-    static bool isService();
-};
+#include "xqserviceutilstub.h"
+#include "xqserviceproviderstub.h"
 
 class  HbAction : public QAction
 {
--- a/videocollection/tsrc/stubs/inc/hbinputdialog.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbinputdialog.h	Fri May 28 09:45:19 2010 +0300
@@ -33,11 +33,9 @@
     ~HbInputDialog();
 
     /**
-     * Returns string in parameter text if mGetTextReturnValue is null QString.
+    * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
      */
-    /*
-    static QString getText(const QString &label,const QString &text = QString(),
-            bool *ok = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0);*/
+    void open( QObject* receiver = 0, const char* member = 0 );
     
     /**
      * Create new HbInputDialog after call to this and call emitDialogFinished to finish the sequence.
@@ -53,6 +51,10 @@
     
     void setAttribute(int attribute);
     
+    void setPromptText(const QString &text, int row = 0);
+    
+    void setValue(const QVariant &value, int row = 0);
+    
     QList<HbAction*> actions() const
     {
         return mActions;
@@ -68,10 +70,14 @@
 
     QList<HbAction*> mActions;
     
+    QList<QString> mSetPromptTexts;
+    QList<QVariant> mSetValues;
+    
     static QString mLastHeading;
     static QString mLastText;
     static int mGetTextCallCount;
     static int mAttribute;
+    static int mOpenCallCount;
     
     static QVariant mValueReturnValue;
     static int mValueCallCount;
--- a/videocollection/tsrc/stubs/inc/hblistview.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hblistview.h	Fri May 28 09:45:19 2010 +0300
@@ -275,6 +275,12 @@
         Q_UNUSED(position);
         return mItem;
     }
+    
+    void setObjectName(const QString name)
+    {
+        Q_UNUSED(name);
+    }
+    
 public:
     
     /**
--- a/videocollection/tsrc/stubs/inc/testobjectstore.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/testobjectstore.h	Fri May 28 09:45:19 2010 +0300
@@ -15,8 +15,8 @@
 *
 */
 
-#ifndef TESTOBJECTSTORE.h
-#define TESTOBJECTSTORE.h
+#ifndef TESTOBJECTSTORE_H
+#define TESTOBJECTSTORE_H
 
 #include <qobject.h>
 #include <qpointer.h>
--- a/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h	Fri May 28 09:45:19 2010 +0300
@@ -20,6 +20,7 @@
 
 #include <qnamespace.h>
 #include <qvariant.h>
+#include "videocollectioncommon.h"
 
 class VideoCollectionViewUtilsData
 {
@@ -36,6 +37,7 @@
         mIconString = "";
         mPressedString = "";
         mLastStatusAdditional = QVariant();
+        mWidgetLevel = VideoCollectionCommon::ELevelInvalid;
     }   
     
 public: // data
@@ -49,6 +51,7 @@
     static QString mIconString;
     static QString mPressedString;
     static QVariant mLastStatusAdditional;
+    static VideoCollectionCommon::TCollectionLevels mWidgetLevel;
 };
 
 #endif /* VIDEOCOLLECTIONVIEWUTILSDATA_H */
--- a/videocollection/tsrc/stubs/inc/videolistwidgetdata.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videolistwidgetdata.h	Fri May 28 09:45:19 2010 +0300
@@ -29,6 +29,7 @@
         mActivateReturnValue = 0;
         mActive = false;
         mDeactivateCount = 0;
+        mEmitActivatedIndex = QModelIndex();
     }
     
 public: // data
@@ -38,6 +39,7 @@
     static int mActivateReturnValue;
     static bool mActive;
     static int mDeactivateCount;
+    static QModelIndex mEmitActivatedIndex;
 };
 
 #endif /* VIDEOLISTWIDGETDATA_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoservicebrowse.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   VideoServiceBrowse stub definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef VIDEOSERVICEBROWSE_H
+#define VIDEOSERVICEBROWSE_H
+
+//INCLUDES
+#include <qobject.h>
+#include "xqserviceproviderstub.h"
+
+// FORWARD DECLARATIONS
+class VideoServices; 
+class QLatin1String;
+
+class VideoServiceBrowse : public XQServiceProvider
+{
+    Q_OBJECT
+    
+public:
+    VideoServiceBrowse( VideoServices *parent, QLatin1String service );
+    ~VideoServiceBrowse();
+    
+public:
+
+    /**
+     *  Complete pending service request
+     *
+     *  @param None
+     *  @return None
+     */
+    void complete();
+
+    /**
+     *  Get current browsing category
+     *
+     *  @param None
+     *  @return VideoServices::TVideoCategory
+     */
+    int getBrowseCategory() const;
+
+    /**
+     *  Return context title of videos application
+     *
+     *  @param None
+     *  @return QString
+     */
+    QString contextTitle() const;
+    
+    /**
+     * Return sort role.
+     * 
+     * @param None.
+     * @return int.
+     */
+    int sortRole() const;
+    
+    /**
+     * Returns service active status
+     *
+     * @return bool true if active, false if not active
+     *
+     */
+    bool isActive();
+
+public slots:
+
+    /**
+     *  Browse video
+     *
+     *  @param title, Title of the embedded Videos application
+     *  @param category, Category which type of videos are browsed
+     *  @param sort, Sort type.
+     *  @return None
+     */
+    void browseVideos(const QString &title, int category, int sortRole);
+
+    /**
+     *  Browse video
+     *
+     *  @param category, Category which type of videos are browsed
+     *  @param sort, Sort type.
+     *  @return None
+     */
+    void browseVideos(int category, int sortRole);
+
+private:
+    
+    /** request index of the service */
+    int mRequestIndex;
+    
+    /** reference to VideoServices instance */
+    VideoServices *mServiceApp;
+    
+    /** current browsing category */
+    int mCategory;
+    
+    /** title of the service client, if not set "Videos" is used */
+    QString mTitle;
+    
+    /** sorting role */
+    int mSortRole;
+    
+};
+
+#endif//VIDEOSERVICEBROWSE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoserviceurifetch.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   VideoServiceUriFetch stub definition
+*
+*/
+
+#ifndef __VIDEOSERVICESURIFETCH_H__
+#define __VIDEOSERVICESURIFETCH_H__
+
+//INCLUDES
+#include "xqserviceproviderstub.h"
+#include <QStringList>
+
+// FORWARD DECLARATIONS
+class VideoServices;
+class QLatin1String;
+
+class VideoServiceUriFetch : public XQServiceProvider
+{
+
+    /**
+     * define to be able to use signals and slots
+     */
+    Q_OBJECT
+
+public:
+
+    /**
+     * contructor
+     */
+    VideoServiceUriFetch( VideoServices *parent, QLatin1String service );
+
+    /**
+     * destructor
+     */
+    ~VideoServiceUriFetch();
+
+    /**
+     * Returns service active status
+     *
+     * @return bool true if active, false if not active
+     *
+     */
+    bool isActive();
+
+    /**
+     * Completes the service
+     *
+     * @param fileList list of file URIs
+     *
+     */
+    void complete(QStringList filesList);
+
+    /**
+     * Returns the context title set by service requestee
+     *
+     * @return QString the title
+     *
+     */
+    QString contextTitle() const;
+
+public slots:  // for QTHighway to notify provider about request
+    /*
+     *  Client can use this method launch video URI fetching
+     *
+     */
+    void fetch();
+
+    /*
+     *  Client can use this method launch video URI fetching
+     *
+     * @param title title to be set
+     *
+     */
+    void fetch(const QString& title);
+
+public slots:  // for provider to notify client
+    void fetchFailed( int errorCode );
+
+private:
+    void doComplete( QStringList filesList);
+
+private:
+    /*
+    * The request index 
+    */
+   int mRequestIndex;
+
+   /*
+    * Pointer to owning VideoServices  
+    */
+   VideoServices* mServiceApp;
+
+   /*
+    * The title requested by the service user 
+    */
+   QString mTitle;
+};
+
+#endif //__VIDEOSERVICESURIFETCH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/xqserviceproviderstub.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   stub
+*
+*/
+
+#ifndef XQSERVICEABSTRACTSERVICESTUB_H
+#define XQSERVICEABSTRACTSERVICESTUB_H
+
+#define XQ_EXPORT_PLUGIN2(x,y)
+
+#include <qobject.h>
+#include <qstring.h>
+#include <QVariant>
+
+class XQServiceProvider : public QObject
+{
+    Q_OBJECT
+    
+public:
+    XQServiceProvider( const QString& service, QObject *parent = 0 );
+    ~XQServiceProvider();
+
+    //    void SetPlugin(QObject* impl_plugin);
+
+//Q_SIGNALS:
+    //void returnValueDelivered() ;
+    //void clientDisconnected() ;
+       
+private:
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/xqserviceutilstub.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  stub 
+* 
+*/
+
+#ifndef XQSERVICEUTILSTUB_H
+#define XQSERVICEUTILSTUB_H
+
+#include <QObject>
+#include <QString>
+
+class XQServiceUtil
+{
+public:
+    static void toBackground(bool value);
+    static bool isEmbedded(); 
+    static bool isService();
+
+    static QString interfaceName();
+    static QString operationName();    
+};
+
+#endif
--- a/videocollection/tsrc/stubs/src/hbinputdialog.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbinputdialog.cpp	Fri May 28 09:45:19 2010 +0300
@@ -24,6 +24,7 @@
 QString HbInputDialog::mLastText = "";
 QVariant HbInputDialog::mValueReturnValue = QVariant();
 int HbInputDialog::mValueCallCount = 0;
+int HbInputDialog::mOpenCallCount = 0;
 
 HbInputDialog::HbInputDialog(QGraphicsItem *parent) : HbWidget(parent) 
 {
@@ -43,6 +44,14 @@
     }
 }   
 
+void HbInputDialog::open( QObject* receiver, const char* member )
+{
+    Q_UNUSED(receiver);
+    Q_UNUSED(member);
+    
+    mOpenCallCount++;
+}
+
 void HbInputDialog::getText(const QString &heading
         ,QObject *receiver
         ,const char *member
@@ -74,3 +83,21 @@
     HbInputDialog::mAttribute = attribute;
 }
 
+void HbInputDialog::setPromptText(const QString &text, int row)
+{
+    while(mSetPromptTexts.count() < row+1)
+    {
+        mSetPromptTexts.append("");
+    }
+    mSetPromptTexts[row] = text;
+}
+
+void HbInputDialog::setValue(const QVariant &value, int row)
+{
+    while(mSetValues.count() < row+1)
+    {
+        mSetValues.append("");
+    }
+    mSetValues[row] = value;
+}
+
--- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp	Fri May 28 09:45:19 2010 +0300
@@ -28,6 +28,7 @@
 QString VideoCollectionViewUtilsData::mIconString = "";
 QString VideoCollectionViewUtilsData::mPressedString = "";
 QVariant VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant();
+VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtilsData::mWidgetLevel = VideoCollectionCommon::ELevelInvalid;
 
 VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
 {
@@ -124,6 +125,17 @@
     // not stubbed
 }
 
+void VideoCollectionViewUtils::saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level)
+{
+    Q_UNUSED(level);
+    // not stubbed
+}
+  
+VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtils::loadWidgetLevel()
+{
+    return VideoCollectionViewUtilsData::mWidgetLevel;
+}
+
 void VideoCollectionViewUtils::sortModel(VideoSortFilterProxyModel *model,
     bool async, VideoCollectionCommon::TCollectionLevels target)
 {
--- a/videocollection/tsrc/stubs/src/videolistwidget.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp	Fri May 28 09:45:19 2010 +0300
@@ -25,6 +25,7 @@
 int VideoListWidgetData::mActivateReturnValue = 0;
 bool VideoListWidgetData::mActive = false;
 int VideoListWidgetData::mDeactivateCount = 0;
+QModelIndex VideoListWidgetData::mEmitActivatedIndex = QModelIndex();
 
 VideoListWidget::VideoListWidget(VideoCollectionUiLoader* uiLoader, HbView *parent):
     HbListView(parent),
@@ -48,13 +49,13 @@
 }
 
 int VideoListWidget::initialize(VideoSortFilterProxyModel &model,
-    VideoServices *videoServices)
+    VideoServices *videoServices, VideoCollectionCommon::TCollectionLevels level)
 {
     Q_UNUSED(videoServices);
 
     VideoListWidgetData::mInitializeCount++;
     mModel = &model;
-    
+    mCurrentLevel = level;
     return VideoListWidgetData::mInitializeReturnValue;
 }
 
@@ -116,8 +117,7 @@
 
 void VideoListWidget::emitActivated (const QModelIndex &modelIndex)
 {
-    Q_UNUSED(modelIndex);
-    // not stubbed
+    VideoListWidgetData::mEmitActivatedIndex = modelIndex;
 }
 
 void VideoListWidget::setSelectionMode(int mode)
--- a/videocollection/tsrc/stubs/src/videoservicebrowse.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videoservicebrowse.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,10 +15,11 @@
 *
 */
 
-// Version : %version: 5 %
+// Version : %version: 6 %
 
 #include <hbapplication.h>
 
+#include "xqserviceproviderstub.h"
 #include "videoservices.h"
 #include "videoservicebrowse.h"
 #include "mpxhbvideocommondefs.h"
--- a/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,6 +15,7 @@
  *
  */
 
+#include "xqserviceproviderstub.h"
 #include "videoserviceurifetch.h"
 #include "videoservices.h"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/xqserviceprovider.cpp	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Stub for xqserviceprovider
+ *
+ */
+ 
+#include "xqserviceproviderstub.h"
+
+XQServiceProvider::XQServiceProvider( const QString& service, QObject *parent )
+{
+    Q_UNUSED(service);
+    Q_UNUSED(parent);
+}
+
+XQServiceProvider::~XQServiceProvider()
+{
+    
+}
+
--- a/videocollection/tsrc/stubs/src/xqserviceutil.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/src/xqserviceutil.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,8 +15,9 @@
 *
 */
 
-#include "hbaction.h"
+#include "xqserviceutilstub.h"
 #include "xqserviceutilxtra.h"
+#include "videoservices.h"
 
 void XQServiceUtil::toBackground(bool value)
 {
@@ -37,4 +38,25 @@
     return service;
 }
 
+QString XQServiceUtil::interfaceName()
+{
+    VideoServices *videoServices = VideoServices::instance();
+    QString interfaceName;
+    if(videoServices->currentService() == VideoServices::EUriFetcher)
+    {
+        interfaceName = "IVideoFetch";
+    } 
+    else if(videoServices->currentService() == VideoServices::EBrowse)
+    {
+        interfaceName = "IVideoBrowse";
+    }
+    videoServices->decreaseReferenceCount();
+    return interfaceName;
+}
+
+QString XQServiceUtil::operationName()
+{
+    return QString();
+}
+
 // End of file
--- a/videocollection/tsrc/stubs/stubs.pro	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/stubs/stubs.pro	Fri May 28 09:45:19 2010 +0300
@@ -14,6 +14,8 @@
 # Description: 
 #
 
+DEFINES += XQPLUGIN_H
+DEFINES += XQSERVICEABSTRACTSERVICE_H
 DEFINES += XQSERVICEUTIL_H
     
 CONFIG += qtestlib \
@@ -23,11 +25,15 @@
 LIBS += -lestor.dll \
     -lfbscli.dll \
     -lbitgdi.dll \
+    -lmpxviewframeworkqt.dll \
     -lxqplugins.dll \
-    -lmpxviewframeworkqt.dll \
     -lxqservice.dll
 
 HEADERS_TEMP = \
+	inc/videoserviceurifetch.h \	
+	inc/videoservicebrowse.h \
+	inc/xqserviceutilstub.h \
+	inc/xqserviceproviderstub.h \
     inc/testobjectstore.h \
     inc/hbabstractitemview.h \
     inc/hbdocumentloader.h \
@@ -82,11 +88,10 @@
     ../../videocollectionwrapper/inc/videolistdatamodel.h \
     ../../videocollectionwrapper/inc/videocollectionwrapper.h \
     ../../videocollectionwrapper/inc/videosortfilterproxymodel.h \
-    ../../videocollectionwrapper/inc/videothumbnaildata.h \
-    ../../../videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h \
-    ../../../videoplayerapp/videoplayerengine/inc/videoservicebrowse.h
+    ../../videocollectionwrapper/inc/videothumbnaildata.h
 
 SOURCES_TEMP = \
+    src/xqserviceprovider.cpp \
     src/testobjectstore.cpp \
     src/hbdocumentloader.cpp \
     src/hbaction.cpp \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/inc/videoservicestestappview.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef VIDEOSERVICESTESTAPPVIEW_H_
+#define VIDEOSERVICESTESTAPPVIEW_H_
+
+#include <hbview.h>
+#include <xqappmgr.h>
+
+class XQApplicationManager;
+class XQAiwRequest;
+class HbLineEdit;
+
+class VideoServicesTestAppView : public HbView
+{
+	Q_OBJECT
+
+public:
+	VideoServicesTestAppView(QGraphicsItem *parent=0);
+	virtual ~VideoServicesTestAppView();
+
+private slots:
+    void handleOk(const QVariant &result);
+    void handleError(int errorCode, const QString& errorMessage);
+
+    void fetchVideo();
+    void fetchVideoDeprecatedOldService();
+    void fetchVideoDeprecatedNewService();
+    void browseCapturedVideos();
+    void browseCapturedVideosDeprecatedOldService();
+    void browseCapturedVideosDeprecatedNewService();
+    
+public slots:
+    
+    void browseCapturedVideosFinished(HbAction *action);
+    void browseCapturedVideosDeprecatedOldServiceFinished(HbAction *action);
+    void browseCapturedVideosDeprecatedNewServiceFinished(HbAction *action);
+
+private:
+    void createLayout();
+
+private:
+    XQApplicationManager mAppMgr;
+    XQAiwRequest* mReq;
+    HbLineEdit* mResultEdit;
+    HbLineEdit* mErrorCodeEdit;
+    HbLineEdit* mErrorEdit;
+};
+
+#endif /* VIDEOSERVICESTESTAPPVIEW_H_ */
--- a/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby	Fri May 28 09:45:19 2010 +0300
@@ -11,13 +11,13 @@
 *
 * Contributors:
 *
-* Description:     hbvideoplayer.iby
+* Description: videoservicetestapp.iby
 *
 */
 
 
-#ifndef __HBVIDEOSERVICESTESTAPP_IBY__
-#define __HBVIDEOSERVICESTESTAPP_IBY__
+#ifndef __VIDEOSERVICESTESTAPP_IBY__
+#define __VIDEOSERVICESTESTAPP_IBY__
 
 #include <bldvariant.hrh>
 #include <data_caging_paths_for_iby.hrh>
@@ -27,4 +27,4 @@
 data=DATAZ_/APP_RESOURCE_DIR/videoservicestestapp.rsc                                 APP_RESOURCE_DIR/videoservicestestapp.rsc
 
 
-#endif  // __HBVIDEOSERVICESTESTAPP_IBY__
+#endif  // __VIDEOSERVICESTESTAPP_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/src/main.cpp	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include "videoservicestestappview.h"
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication::setOrganizationName("Nokia");
+    QCoreApplication::setApplicationName("VideoServicesTestApp");
+
+    HbApplication app(argc, argv);
+    HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
+    mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
+    VideoServicesTestAppView *mainView = new VideoServicesTestAppView;
+    mainWindow.addView(mainView);
+    mainWindow.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/src/videoservicestestappview.cpp	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,504 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <xqaiwrequest.h>
+#include <QGraphicsLinearLayout>
+#include <hbpushbutton.h>
+#include <hblineedit.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbinputdialog.h>
+#include <qdebug>
+#include <vcxmyvideosdefs.h>
+#include <xqaiwdecl.h>
+#include "videoservicestestappview.h"
+
+VideoServicesTestAppView::VideoServicesTestAppView(QGraphicsItem *parent) :
+    HbView(parent),
+    mReq(0),
+    mResultEdit(0),
+    mErrorCodeEdit(0),
+    mErrorEdit(0)
+{
+    qDebug() << "VideoServicesTestAppView::VideoServicesTestAppView";
+    createLayout();
+}
+
+
+VideoServicesTestAppView::~VideoServicesTestAppView()
+{
+    qDebug() << "VideoServicesTestAppView::~VideoServicesTestAppView";
+    delete mReq;
+}
+
+
+void VideoServicesTestAppView::handleOk(const QVariant &result)
+{
+    qDebug() << "VideoServicesTestAppView::handleOk";
+
+    if (!result.canConvert<QStringList>())
+    {
+        mErrorEdit->setText("Corrupt result");
+    }
+    else
+    {
+        QString text = result.value<QString>();
+        if (text.isEmpty())
+        {
+            text = "No result available in this service";
+        }
+        mResultEdit->setText(text);
+        qDebug() << "VideoServicesTestAppView::handleOk" << ": result=" << text;
+    }
+
+}
+
+
+void VideoServicesTestAppView::handleError(int errorCode, const QString& errorMessage)
+{
+    qDebug() << "VideoServicesTestAppView::handleError" << ": errorCode=" << errorCode << ", msg:" << errorMessage;
+    mErrorEdit->setText(errorMessage);
+    mErrorCodeEdit->setText(QString::number(errorCode));
+}
+
+
+void VideoServicesTestAppView::createLayout()
+{
+    qDebug() <<  "VideoServicesTestAppView::createLayout";
+
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    if (layout)
+    {
+        QGraphicsLinearLayout *topLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+        if (topLayout)
+        {
+        	//topLayout->addStretch(5);
+
+            mResultEdit = new HbLineEdit;
+            HbLabel* label = new HbLabel("Result:");
+            if (mResultEdit && label)
+            {
+                topLayout->addItem(label);
+                mResultEdit->setMaxRows(5);
+                topLayout->addItem(mResultEdit);
+            }
+
+            mErrorCodeEdit = new HbLineEdit;
+            label = new HbLabel("Error code:");
+            if (mErrorCodeEdit && label)
+            {
+                topLayout->addItem(label);
+                topLayout->addItem(mErrorCodeEdit);
+            }
+
+            mErrorEdit = new HbLineEdit;
+            label = new HbLabel("Error description:");
+            if (mErrorEdit && label)
+            {
+                topLayout->addItem(label);
+                mErrorEdit->setMaxRows(5);
+                topLayout->addItem(mErrorEdit);
+            }
+
+            layout->addItem(topLayout);
+            //layout->setStretchFactor(topLayout, 5);
+        }
+
+        QGraphicsLinearLayout *bottomLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+        if (bottomLayout)
+        {
+            //bottomLayout->addStretch();
+/*
+            HbPushButton* button = new HbPushButton("Fetch video OLD IF OLD S");
+            if (button)
+            {
+                connect(button, SIGNAL(clicked()), this, SLOT(fetchVideoDeprecatedOldService()));
+                bottomLayout->addItem(button);
+            }
+*/
+            HbPushButton* button = new HbPushButton("Fetch video OLD IF NEW S");
+            if (button)
+            {
+                connect(button, SIGNAL(clicked()), this, SLOT(fetchVideoDeprecatedNewService()));
+                bottomLayout->addItem(button);
+            }
+
+            button = new HbPushButton("Fetch video NEW IF NEW S");
+            if (button)
+            {
+                connect(button, SIGNAL(clicked()), this, SLOT(fetchVideo()));
+                bottomLayout->addItem(button);
+            }
+
+/*
+            button = new HbPushButton("Browse \"Captured\" videos OLD IF OLD S");
+            if (button)
+            {
+                connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideosDeprecatedOldService()));
+                bottomLayout->addItem(button);
+            }
+*/
+            button = new HbPushButton("Browse \"Captured\" videos OLD IF NEW S");
+            if (button)
+            {
+                connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideosDeprecatedNewService()));
+                bottomLayout->addItem(button);
+            }
+
+
+            button = new HbPushButton("Browse \"Captured\" videos NEW IF");
+            if (button)
+            {
+                connect(button, SIGNAL(clicked()), this, SLOT(browseCapturedVideos()));
+                bottomLayout->addItem(button);
+            }
+
+            layout->addItem(bottomLayout);
+        }
+
+        setLayout(layout); // Takes ownership of layout
+    }
+}
+
+
+void VideoServicesTestAppView::fetchVideo()
+{
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo START";
+
+    mResultEdit->setText("");
+    mErrorEdit->setText("");
+    mErrorCodeEdit->setText("");
+
+    delete mReq;
+    mReq = 0;
+    mReq = mAppMgr.create(XQI_VIDEO_FETCH, "fetch()", true);
+
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo: mReq=" << mReq;
+
+    if (!mReq)
+    {
+        mErrorEdit->setText("Failed to create REQ");
+        return;
+    }
+    else
+    {
+        connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+        connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+    }
+
+    // Set arguments for request (application title)
+    XQRequestInfo info;
+    info.setInfo("WindowTitle", "<NEW IF app_name>");
+    mReq->setInfo(info);
+
+    // Make the request
+    if (!mReq->send())
+    {
+        mErrorEdit->setText("Failed to send REQ");
+        qDebug() <<  "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false";
+    }
+
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo END";
+}
+
+
+void VideoServicesTestAppView::browseCapturedVideos()
+{
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos START";
+
+    mResultEdit->setText("");
+    mErrorEdit->setText("");
+    mErrorCodeEdit->setText("");
+
+    delete mReq;
+    mReq = 0;
+
+    mReq = mAppMgr.create("com.nokia.symbian.IVideoBrowse", "browseVideos(int,int)", true);
+
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq;
+
+    if (!mReq)
+    {
+        mErrorEdit->setText("Failed to create REQ");
+        return;
+    }
+    else
+    {
+        connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant)));
+        connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+    }
+
+    // - title
+    XQRequestInfo info;
+    info.setInfo("WindowTitle", "<NEW IF app name>");
+    mReq->setInfo(info);
+
+    HbInputDialog *dialog = new HbInputDialog();
+    dialog->setAttribute(Qt::WA_DeleteOnClose);
+    dialog->setAdditionalRowVisible(true);
+    dialog->setInputMode(HbInputDialog::IntInput, 0);
+    dialog->setInputMode(HbInputDialog::IntInput, 1);
+    dialog->setPromptText("Enter category", 0);
+    dialog->setPromptText("Enter sort role", 1);
+	dialog->setValue(3, 0);
+	dialog->setValue(0, 1);
+    dialog->open(this, SLOT(browseCapturedVideosFinished(HbAction *)));
+
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos END";
+}
+
+void VideoServicesTestAppView::browseCapturedVideosFinished(HbAction *action)
+{
+    HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
+
+    int category = dialog->value(0).toInt();
+    int sortRole = dialog->value(1).toInt();
+
+    if(dialog->actions().first() == action)
+    {
+    	// set arguments
+        QList<QVariant> args;
+        args.append(QVariant(category));
+        args.append(QVariant(sortRole));
+        mReq->setArguments(args);
+
+        // Make the request
+        if (!mReq->send())
+        {
+            mErrorEdit->setText("Failed to send REQ");
+            qDebug() <<  "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false";
+        }
+    }
+}
+
+void VideoServicesTestAppView::fetchVideoDeprecatedOldService()
+{
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo START";
+
+    mResultEdit->setText("");
+    mErrorEdit->setText("");
+    mErrorCodeEdit->setText("");
+
+    delete mReq;
+    mReq = 0;
+    mReq = mAppMgr.create("com.nokia.Videos", "IVideoFetch", "fetch(QString)", true);
+
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo: mReq=" << mReq;
+
+    if (!mReq)
+    {
+        mErrorEdit->setText("Failed to create REQ");
+        return;
+    }
+    else
+    {
+        connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+        connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+    }
+
+    // Set arguments for request (application title)
+    QList<QVariant> args;
+    args << QVariant(QString("<OLD-IF-OLD-S app_name>"));
+    mReq->setArguments(args);
+
+    // Make the request
+    if (!mReq->send())
+    {
+        mErrorEdit->setText("Failed to send REQ");
+        qDebug() <<  "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false";
+    }
+
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo END";
+}
+
+void VideoServicesTestAppView::fetchVideoDeprecatedNewService()
+{
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo START";
+
+    mResultEdit->setText("");
+    mErrorEdit->setText("");
+    mErrorCodeEdit->setText("");
+
+    delete mReq;
+    mReq = 0;
+    mReq = mAppMgr.create("videoplayer", "IVideoFetch", "fetch(QString)", true);
+
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo: mReq=" << mReq;
+
+    if (!mReq)
+    {
+        mErrorEdit->setText("Failed to create REQ");
+        return;
+    }
+    else
+    {
+        connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+        connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+    }
+
+    // Set arguments for request (application title)
+    QList<QVariant> args;
+    args << QVariant(QString("<OLD-IF-NEW-S app_name>"));
+    mReq->setArguments(args);
+
+    // Make the request
+    if (!mReq->send())
+    {
+        mErrorEdit->setText("Failed to send REQ");
+        qDebug() <<  "VideoServicesTestAppView::fetchVideo: XQAiwRequest::send returned false";
+    }
+
+    qDebug() <<  "VideoServicesTestAppView::fetchVideo END";
+}
+
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedOldService()
+{
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos START";
+
+    mResultEdit->setText("");
+    mErrorEdit->setText("");
+    mErrorCodeEdit->setText("");
+
+    delete mReq;
+    mReq = 0;
+    mReq = mAppMgr.create("com.nokia.Videos", "IVideoBrowse", "browseVideos(QString,int,int)", true);
+
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq;
+
+    if (!mReq)
+    {
+        mErrorEdit->setText("Failed to create REQ");
+        return;
+    }
+    else
+    {
+        connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant)));
+        connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+    }
+
+    HbInputDialog *dialog = new HbInputDialog();
+    dialog->setAttribute(Qt::WA_DeleteOnClose);
+    dialog->setAdditionalRowVisible(true);
+    dialog->setInputMode(HbInputDialog::IntInput, 0);
+    dialog->setInputMode(HbInputDialog::IntInput, 1);
+    dialog->setPromptText("Enter category", 0);
+    dialog->setPromptText("Enter sort role", 1);
+	dialog->setValue(3, 0);
+	dialog->setValue(0, 1);
+    dialog->open(this, SLOT(browseCapturedVideosDeprecatedOldServiceFinished(HbAction *)));
+
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos END";
+}
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedOldServiceFinished(HbAction *action)
+{
+    HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
+
+    const QString title = "<OLD-IF-OLD-S app name>";
+
+    int category = dialog->value(0).toInt();
+    int sortRole = dialog->value(1).toInt();
+
+    if(dialog->actions().first() == action)
+    {
+    	// set arguments
+        QList<QVariant> args;
+        args.append(title);
+        args.append(QVariant(category));
+        args.append(QVariant(sortRole));
+        mReq->setArguments(args);
+
+        // Make the request
+        if (!mReq->send())
+        {
+            mErrorEdit->setText("Failed to send REQ");
+            qDebug() <<  "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false";
+        }
+    }
+}
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedNewService()
+{
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos START";
+
+    mResultEdit->setText("");
+    mErrorEdit->setText("");
+    mErrorCodeEdit->setText("");
+
+    delete mReq;
+    mReq = 0;
+    mReq = mAppMgr.create("videoplayer", "IVideoBrowse", "browseVideos(QString,int,int)", true);
+
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos: mReq=" << mReq;
+
+    if (!mReq)
+    {
+        mErrorEdit->setText("Failed to create REQ");
+        return;
+    }
+    else
+    {
+        connect(mReq, SIGNAL(requestOk(QVariant)), SLOT(handleOk(QVariant)));
+        connect(mReq, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+    }
+
+    HbInputDialog *dialog = new HbInputDialog();
+    dialog->setAttribute(Qt::WA_DeleteOnClose);
+    dialog->setAdditionalRowVisible(true);
+    dialog->setInputMode(HbInputDialog::IntInput, 0);
+    dialog->setInputMode(HbInputDialog::IntInput, 1);
+    dialog->setPromptText("Enter category", 0);
+    dialog->setPromptText("Enter sort role", 1);
+	dialog->setValue(3, 0);
+	dialog->setValue(0, 1);
+    dialog->open(this, SLOT(browseCapturedVideosDeprecatedNewServiceFinished(HbAction *)));
+
+    qDebug() <<  "VideoServicesTestAppView::browseCapturedVideos END";
+}
+
+void VideoServicesTestAppView::browseCapturedVideosDeprecatedNewServiceFinished(HbAction *action)
+{
+    HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
+
+    const QString title = "<OLD-IF-NEW-S app name>";
+
+    int category = dialog->value(0).toInt();
+    int sortRole = dialog->value(1).toInt();
+
+    if(dialog->actions().first() == action)
+    {
+    	// set arguments
+        QList<QVariant> args;
+        args.append(title);
+        args.append(QVariant(category));
+        args.append(QVariant(sortRole));
+        mReq->setArguments(args);
+
+        // Make the request
+        if (!mReq->send())
+        {
+            mErrorEdit->setText("Failed to send REQ");
+            qDebug() <<  "VideoServicesTestAppView::browseCapturedVideosFinished: XQAiwRequest::send returned false";
+        }
+    }
+}
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/videoservicestestapp.pro	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,34 @@
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+TEMPLATE = app
+TARGET = videoservicestestapp
+
+CONFIG += hb
+LIBS += -lxqservice -lxqserviceutil
+
+HEADERS += inc/videoservicestestappview.h 
+
+SOURCES += src/videoservicestestappview.cpp \
+           src/main.cpp
+
+
+symbian {
+    TARGET.UID2 = 0x100039CE 
+    TARGET.UID3 = 0x2002C341
+    TARGET.CAPABILITY = ALL -TCB
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE 
+    
+    BLD_INF_RULES.prj_exports += "rom/videoservicestestapp.iby CORE_APP_LAYER_IBY_EXPORT_PATH(videoservicestestapp.iby)"
+}
--- a/videocollection/videocollectionview/inc/videocollectionviewutils.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionviewutils.h	Fri May 28 09:45:19 2010 +0300
@@ -83,6 +83,21 @@
      * Initilizes model sort values.
      */
     static void sortModel(VideoSortFilterProxyModel *model, bool async, VideoCollectionCommon::TCollectionLevels target);
+    
+    /**
+     * Method saves the latest videolist widget level into activity manager db
+     * 
+     * @param level type of widget 
+     */
+    static void saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level);
+    
+    /**
+     * Method loads the latest videolist widget level from activity manager db.
+     * Possible values are ELevelCategory or ELevelVideos
+     * 
+     * @return VideoCollectionCommon::TCollectionLevels
+     */
+    static VideoCollectionCommon::TCollectionLevels loadWidgetLevel();
 
 public slots:
     
--- a/videocollection/videocollectionview/inc/videolistwidget.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistwidget.h	Fri May 28 09:45:19 2010 +0300
@@ -23,6 +23,7 @@
 #include <hblistview.h>
 #include <qmap.h>
 #include <mpxitemid.h>
+#include "videoservices.h"
 #include "videocollectioncommon.h"
 
 class VideoSortFilterProxyModel;
@@ -67,9 +68,13 @@
      * layout and activates correct view based on the current orientation
      * 
      * @param model Model for this list view.
+     * @param videoservices
+     * @param level presetted level for the widget
      * @return int 0 initialization ok, < 0 if fails.
      */
-    int initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices  = 0);
+    int initialize(VideoSortFilterProxyModel &model, 
+                   VideoServices* videoServices  = 0,
+                   VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelInvalid);
 
     /**
      * Method enables and displays current active view
@@ -165,6 +170,12 @@
      * Signaled by HbMessageBox when it's closed.
      */
     void removeCollectionDialogFinished(HbAction *action);
+    
+    /**
+     * called or signaled when delayed initialization is reauired for the widget
+     *
+     */
+    void doDelayedsSlot();
 
 protected slots:
     
@@ -227,12 +238,6 @@
     void playItemSlot();
 
     /**
-     * slot is connected to view's doDelayeds -signal
-     *
-     */
-    void doDelayedsSlot();
-    
-    /**
      * Signaled when stepping back from collection in collection view
      *
      */
@@ -403,6 +408,11 @@
      * ui loade object, not owned
      */
     VideoCollectionUiLoader     *mUiLoader;
+    
+    /**
+     * Service being provided
+     */
+    VideoServices::TVideoService mService;
 };
 
 #endif // VIDEOLISTWIDGET_H
--- a/videocollection/videocollectionview/src/videocollectionuiloader.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionuiloader.cpp	Fri May 28 09:45:19 2010 +0300
@@ -381,7 +381,7 @@
                     {
                         videoServices = VideoServices::instance();
                     }
-                    videoList->initialize(*model, videoServices);
+                    videoList->initialize(*model, videoServices, VideoCollectionCommon::ELevelVideos);
                 }
             }
         }
@@ -404,7 +404,7 @@
                     {
                         videoServices = VideoServices::instance();
                     }
-                    videoList->initialize(*model, videoServices);
+                    videoList->initialize(*model, videoServices, VideoCollectionCommon::ELevelCategory);
                 }
             }
         }
@@ -427,6 +427,7 @@
                     {
                         videoServices = VideoServices::instance();
                     }
+                    // cannot set level at this point yet: it can be either default or user defined collection
                     videoList->initialize(*model, videoServices);
                 }
             }
--- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp	Fri May 28 09:45:19 2010 +0300
@@ -18,6 +18,8 @@
 // Version : %version: 39 %
 
 // INCLUDE FILES
+#include <hbapplication.h>
+#include <hbactivitymanager.h>
 #include <hbglobal.h>
 #include <hblistview.h>
 #include <hbscrollbar.h>
@@ -49,6 +51,8 @@
 const int KAddToCollectionCountIndex(0);
 const int KAddToCollectionNameIndex(1);
 
+static const char* ACTIVITY_VIDEOS_MAINVIEW = "VideosMainView";
+
 // ---------------------------------------------------------------------------
 // instance
 // ---------------------------------------------------------------------------
@@ -311,6 +315,53 @@
 }
 
 // ---------------------------------------------------------------------------
+// saveWidgetLevel
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionViewUtils::saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level)
+{
+    FUNC_LOG;
+    HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
+    if(!activityManager)
+    {
+        return;
+    }
+    // clean up any previous versions of this activity from the activity manager.
+   activityManager->removeActivity(ACTIVITY_VIDEOS_MAINVIEW);
+   
+   QVariant data = int(level);
+   
+   activityManager->addActivity(ACTIVITY_VIDEOS_MAINVIEW, data, QVariantHash());
+
+
+}
+  
+// ---------------------------------------------------------------------------
+// loadWidgetLevel
+// ---------------------------------------------------------------------------
+//
+VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtils::loadWidgetLevel()
+{
+    FUNC_LOG;
+    // all videos view is the default value to be returned in case nothing can be read
+    // from the activity manager
+    VideoCollectionCommon::TCollectionLevels level(VideoCollectionCommon::ELevelVideos);
+    
+    HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
+    if(!activityManager)
+    {
+        return level;
+    }
+    QVariant data =activityManager->activityData(ACTIVITY_VIDEOS_MAINVIEW);
+    if(data.toInt() == VideoCollectionCommon::ELevelCategory)
+    {
+        level = VideoCollectionCommon::ELevelCategory;
+    }
+    return level;
+
+}
+
+// ---------------------------------------------------------------------------
 // showStatusMsgSlot
 // ---------------------------------------------------------------------------
 //
--- a/videocollection/videocollectionview/src/videolistview.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 106 %
+// Version : %version: 108 %
 
 // INCLUDE FILES
 #include <xqserviceutil.h>
@@ -123,14 +123,30 @@
         	connect(mVideoServices, SIGNAL(titleReady(const QString&)), this, SLOT(titleReadySlot(const QString&)));
         }
 	}
+    QList<VideoCollectionUiLoaderParam> params;
+    int videoListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
+    int collectionListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
     
+    if(VideoCollectionViewUtils::loadWidgetLevel() == VideoCollectionCommon::ELevelCategory)
+    {
+        videoListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
+        collectionListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
+       
+       
+    }
     // start loading objects and widgets
-    QList<VideoCollectionUiLoaderParam> params;
     params.append(VideoCollectionUiLoaderParam(
-        DOCML_NAME_VC_VIDEOLISTWIDGET,
-        DOCML_VIDEOCOLLECTIONVIEW_FILE,
-        true,
-        VideoCollectionUiLoaderParam::LoadPhasePrimary));
+                   DOCML_NAME_VC_VIDEOLISTWIDGET,
+                   DOCML_VIDEOCOLLECTIONVIEW_FILE,
+                   true,
+                   videoListPhase));
+    params.append(VideoCollectionUiLoaderParam(
+                   DOCML_NAME_VC_COLLECTIONWIDGET,
+                   DOCML_VIDEOCOLLECTIONVIEW_FILE,
+                   DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+                   true,
+                   collectionListPhase));
+        
     params.append(VideoCollectionUiLoaderParam(
         DOCML_NAME_OPTIONS_MENU,
         DOCML_VIDEOCOLLECTIONVIEW_FILE,
@@ -180,13 +196,7 @@
         DOCML_NAME_SORT_BY_SIZE,
         DOCML_VIDEOCOLLECTIONVIEW_FILE,
         false,
-        VideoCollectionUiLoaderParam::LoadPhaseSecondary));
-    params.append(VideoCollectionUiLoaderParam(
-        DOCML_NAME_VC_COLLECTIONWIDGET,
-        DOCML_VIDEOCOLLECTIONVIEW_FILE,
-        DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
-        true,
-        VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+        VideoCollectionUiLoaderParam::LoadPhaseSecondary));   
     params.append(VideoCollectionUiLoaderParam(
         DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
         DOCML_VIDEOCOLLECTIONVIEW_FILE,
@@ -222,6 +232,17 @@
     mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
     params.clear();
     
+    if(videoListPhase == VideoCollectionUiLoaderParam::LoadPhasePrimary)
+    {
+        mCurrentList = mUiLoader->findWidget<VideoListWidget>(
+                                DOCML_NAME_VC_VIDEOLISTWIDGET);
+    }
+    else
+    {
+        mCurrentList = mUiLoader->findWidget<VideoListWidget>(
+                                    DOCML_NAME_VC_COLLECTIONWIDGET);
+    }
+    
     return 0;
 }
 
@@ -294,7 +315,10 @@
 {
 	FUNC_LOG;
     mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
-	emit doDelayeds();
+	if(mCurrentList)
+	{
+	    mCurrentList->doDelayedsSlot();
+	}
 }
 
 // ---------------------------------------------------------------------------
@@ -375,6 +399,8 @@
     
     if(mCurrentList)
     {
+        VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+        VideoCollectionViewUtils::saveWidgetLevel(level);
         mCurrentList->deactivate();
     }
 }
@@ -473,8 +499,14 @@
         	mToolbarActions[ETBActionServices]->setCheckable(false);
         }
 
-        // Allvideos is checked at creation phase
-        mToolbarActions[ETBActionAllVideos]->setChecked(true);
+        if(mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory)
+        {
+            mToolbarActions[ETBActionCollections]->setChecked(true);
+        }
+        else
+        {
+            mToolbarActions[ETBActionAllVideos]->setChecked(true);
+        }
 
         bar->addActions(mToolbarViewsActionGroup->actions());
     }
@@ -667,39 +699,26 @@
 int VideoListView::activateVideosView()
 {
     FUNC_LOG;
-    VideoListWidget *videoList =
-        mUiLoader->findWidget<VideoListWidget>(
-            DOCML_NAME_VC_VIDEOLISTWIDGET);
-    if (videoList)
+
+    if(!mCurrentList)
+    {
+        return -1;
+    }
+    VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel(); 
+
+    int result = mCurrentList->activate(level);
+    if(result < 0)
     {
-        VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
-        if (mCurrentList)
-        {
-            level = mCurrentList->getLevel();
-        }
-        else
-        {
-            mCurrentList = videoList;
-        }
-        
-        int result = mCurrentList->activate(level);
-        if(result < 0)
-        {
-            ERROR(result, "VideoListView::activateVideosView() failed to activate.");
-            // activate failed, deactivate view so we get rid of dangling connections.
-            deactivateView();
-            return -1;
-        }
-        
-        if (createToolbar() != 0)
-        {
-            ERROR(result, "VideoListView::activateVideosView() failed to create toolbar.");
-            deactivateView();
-            return -1;
-        }
+        ERROR(result, "VideoListView::activateVideosView() failed to activate.");
+        // activate failed, deactivate view so we get rid of dangling connections.
+        deactivateView();
+        return -1;
     }
-    else
+    
+    if (createToolbar() != 0)
     {
+        ERROR(result, "VideoListView::activateVideosView() failed to create toolbar.");
+        deactivateView();
         return -1;
     }
     
@@ -858,9 +877,7 @@
         
         // activate video collection widget
         mCurrentList = collectionWidget;
-        mCurrentList->activate(VideoCollectionCommon::ELevelCategory);
-        
-        VideoSortFilterProxyModel &model = mCurrentList->getModel(); 
+        mCurrentList->activate(VideoCollectionCommon::ELevelCategory);        
 
         // the collection view is not empty, so we should hide the hint in advance.
         showHint(false);
@@ -1425,15 +1442,24 @@
     if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0)
     {
         connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
-        connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
+        if(mCurrentList != object)
+        {
+            // this widget not yet activated so it's has been created on the second phase
+            // safe to call doDelayed right away
+            qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
+        }
     }
     else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0)
     {
         connect(
             object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
             this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
-            connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
-            emit(doDelayeds());
+        if(mCurrentList != object)
+        {
+            // this widget not yet activated so it's has been created on the second phase
+            // safe to call doDelayed right away
+            qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
+        }
     }
     else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0)
     {
@@ -1441,8 +1467,12 @@
         connect(
             object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
             this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
-            connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
-            emit(doDelayeds());
+        if(mCurrentList != object)
+        {
+            // this widget not yet activated so it's has been created on the second phase
+            // safe to call doDelayed right away
+            qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
+        }        
     }
     else if (name.compare(DOCML_NAME_OPTIONS_MENU) == 0)
     {
--- a/videocollection/videocollectionview/src/videolistwidget.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistwidget.cpp	Fri May 28 09:45:19 2010 +0300
@@ -18,6 +18,7 @@
 #include "videocollectiontrace.h"
 #include "videolistwidget.h"
 
+#include <xqserviceutil.h>
 #include <qcoreapplication.h>
 #include <qtimer.h>
 #include <hbscrollbar.h>
@@ -34,7 +35,6 @@
 #include "videocollectionviewutils.h"
 #include "videocollectionuiloader.h"
 #include "videolistselectiondialog.h"
-#include "videoservices.h"
 #include "videothumbnaildata.h"
 #include "videosortfilterproxymodel.h"
 #include "videocollectioncommon.h"
@@ -75,7 +75,8 @@
 mContextMenu(0),
 mSelectionMode(HbAbstractItemView::NoSelection),
 mScrollPositionTimer(0),
-mUiLoader(uiLoader)
+mUiLoader(uiLoader),
+mService(VideoServices::ENoService)
 {
 	FUNC_LOG_ADDR(this);
 }
@@ -101,16 +102,27 @@
 // initialize
 // ---------------------------------------------------------------------------
 //
-int VideoListWidget::initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices)
+int VideoListWidget::initialize(VideoSortFilterProxyModel &model, 
+                                VideoServices* videoServices,
+                                VideoCollectionCommon::TCollectionLevels level)
 {
 	FUNC_LOG_ADDR(this);
-    mModel = &model;
-
+    mModel = &model;    
 	mVideoServices = videoServices;
+	mCurrentLevel = level;
 
 	if(mVideoServices)
 	{
 		mIsService = true;
+	
+    	if(XQServiceUtil::interfaceName().contains("IVideoFetch"))
+    	{
+    		mService = VideoServices::EUriFetcher;
+    	}
+    	else if (XQServiceUtil::interfaceName().contains("IVideoBrowse"))
+    	{
+    		mService = VideoServices::EBrowse;
+    	}
 	}
 
     // init list view
@@ -324,7 +336,7 @@
     
     if (mIsService &&
         mVideoServices &&
-        mVideoServices->currentService() == VideoServices::EBrowse)
+        mService == VideoServices::EBrowse)
     {
         isBrowsingService = true;
     }
@@ -439,14 +451,7 @@
     mContextMenu->setDismissPolicy(HbPopup::TapAnywhere);
     mContextMenu->setObjectName(LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU);
 
-    VideoServices::TVideoService service = VideoServices::ENoService;
-    if (mIsService &&
-        mVideoServices)
-    {
-        service = mVideoServices->currentService();
-    }
-    
-    if (service == VideoServices::EUriFetcher)
+    if (mService == VideoServices::EUriFetcher)
     {
         mContextMenuActions[EActionAttach] = 
                 mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot()));
@@ -460,7 +465,7 @@
                 mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot()));
         mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS);
     }
-    else if (service == VideoServices::EBrowse)
+    else if (mService == VideoServices::EBrowse)
     {
         mContextMenuActions[EActionPlay]    = 
                 mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
@@ -561,7 +566,9 @@
     	{
 			mContextMenuActions[EActionAddToCollection]->setVisible(true);
     		mContextMenuActions[EActionDelete]->setVisible(true);
-    	} else {
+    	} 
+    	else 
+    	{
             mContextMenuActions[EActionAttach]->setVisible(true);
     	}
     	mContextMenuActions[EActionPlay]->setVisible(true);
@@ -648,7 +655,7 @@
 {
     if(mIsService &&
        mVideoServices &&
-       mVideoServices->currentService() == VideoServices::EUriFetcher &&
+       mService == VideoServices::EUriFetcher &&
        mCurrentLevel != VideoCollectionCommon::ELevelCategory)
     {
         QVariant variant = mModel->data(index, VideoCollectionCommon::KeyFilePath);
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 41 %
+// Version : %version: 44 %
 
 #define private public
 #include "videoservices.h"
@@ -440,7 +440,8 @@
 	
 	HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
 	mainWnd->unsetOrientation(false);
-    mTestView->mCurrentList = 0;
+    VideoListWidget *backup = mTestView->mCurrentList;
+	mTestView->mCurrentList = 0;
 	HbDocumentLoader::mFindWidgetFails = true;
 	QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), -1	);
     QVERIFY( VideoListWidgetData::mActive == false );
@@ -448,6 +449,7 @@
     QCOMPARE( VideoListWidgetData::mActivateCount, 0 );
 	QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
 	QVERIFY( mainWnd->mOrientationSet == false );
+	mTestView->mCurrentList = backup;
 	
     HbDocumentLoader::mFindWidgetFails = false;
     videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
@@ -517,6 +519,7 @@
     // -browse service
     // -other category
     init();
+    videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
     VideoListWidgetData::reset();
     VideoSortFilterProxyModelData::reset();
     itemId.iId1 = KVcxMvcCategoryIdOther;
@@ -525,7 +528,7 @@
     QVERIFY(VideoListWidgetData::mActive);
     QCOMPARE(VideoListWidgetData::mActivateCount, 1);
     QCOMPARE(mTestView->mCollectionName.length(), 0);
-    QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
+    //QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
     QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId());
     cleanup();
 
@@ -541,7 +544,7 @@
     QVERIFY(VideoListWidgetData::mActive);
     QCOMPARE(VideoListWidgetData::mActivateCount, 1);
     QCOMPARE(mTestView->mCollectionName.length(), 0);
-    QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
+//    QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
     QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId());
     cleanup();
 
@@ -966,9 +969,11 @@
     ////////////
     // no current list
     ////////////
+    VideoListWidget *backup = mTestView->mCurrentList;
+    mTestView->mCurrentList = 0;
     emit testSignal();
     QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 0);
-    
+    mTestView->mCurrentList = backup;
     mTestView->activateView(TMPXItemId::InvalidId());
     
     ////////////
@@ -1293,30 +1298,39 @@
 //
 void TestListView::testShowHint()
 {
-    init(true);
+    init(false);
     connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
     mTestView->mModelReady = true;
     
     // current list is null. (cannot be verified, run for coverity    
     emit testLayoutChangedSignal();   
     mTestView->activateView(TMPXItemId::InvalidId());
-  
+    disconnect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
+    
+    cleanup();
+    init(true);
+    mTestView->mModelReady = true;
+    connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
+    
     // hint widget cannot be loaded. (cannot be tested, run for coverity)
     VideoCollectionUiLoaderData::mFindFailureNameList.append(DOCML_NAME_VC_VIDEOHINTWIDGET);
     emit testLayoutChangedSignal();
     VideoCollectionUiLoaderData::mFindFailureNameList.clear();
     
     VideoHintWidget *hintWidget = mUiLoader->findWidget<VideoHintWidget>(DOCML_NAME_VC_VIDEOHINTWIDGET);    
+    hintWidget->deactivate();
     
     /////
     // hint widget showing
     // model not ready, row count zero.
     mTestView->mModelReady = false;
     setRowCount(0);
+    VideoListWidget *backup = mTestView->mCurrentList;
     mTestView->mCurrentList =  mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
     emit testLayoutChangedSignal();
-    QVERIFY(hintWidget->isVisible() == false );
+    QVERIFY(hintWidget->isVisible() == false);
     QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
+    mTestView->mCurrentList = backup;
     
     // model not ready, row count not zero.
     setRowCount(1);
@@ -1348,6 +1362,7 @@
     
     ////////
     // toolbar setup
+    mTestView->activateView(TMPXItemId::InvalidId());
     mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->setVisible(true);
 
     // mToolbarViewsActionGroup is null
@@ -1468,18 +1483,22 @@
     
     // Not initialized, no mCurrentList
     emit testSignal(index, 0, 0);
-    // TODO verify
+    // no verification needed, this tests that method does not crash if mCurrentList is not set.
     
     // Good case
     QVERIFY(mTestView->initializeView() == 0);
     mTestView->activateView(TMPXItemId::InvalidId());
     setRowCount(1);
+    VideoListWidgetData::mEmitActivatedIndex = QModelIndex();
     emit testSignal(index, 0, 0);
-    // TODO verify
     
+    QModelIndex expectedIndex = mTestView->mCurrentList->mModel->index(0,0);
+    QCOMPARE(VideoListWidgetData::mEmitActivatedIndex, expectedIndex);
+    
+    VideoListWidgetData::mEmitActivatedIndex = QModelIndex();
     // Invalid index
     emit testSignal(index, -1, 0);
-    // TODO verify
+    QCOMPARE(VideoListWidgetData::mEmitActivatedIndex, QModelIndex());
     
     disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(doDelayedsSlot()));
     cleanup();
@@ -1538,7 +1557,7 @@
     
     // not initialized, no mCurrentList
     emit testSignal();
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 0);
     QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
 
     QVERIFY(mTestView->initializeView() == 0);
@@ -1546,37 +1565,37 @@
     
     // dialog canceled
     HbInputDialog::mValueCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     emit testSignal();
     dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 1);
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
     QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
-    QVERIFY(HbInputDialog::mValueCallCount == 1);
+    QCOMPARE(HbInputDialog::mValueCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     
     // empty name
     HbInputDialog::mValueCallCount = 0;
     HbInputDialog::mValueReturnValue = "";
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     emit testSignal();
     dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 0);
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
     QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
-    QVERIFY(HbInputDialog::mValueCallCount == 1);
+    QCOMPARE(HbInputDialog::mValueCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     
     // Good case.
     HbInputDialog::mValueCallCount = 0;
     HbInputDialog::mValueReturnValue = "testAlbum";
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     emit testSignal();
     dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 0);
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
     QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "testAlbum");
-    QVERIFY(HbInputDialog::mValueCallCount == 1);
+    QCOMPARE(HbInputDialog::mValueCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     
     HbInputDialog::mValueCallCount = 0;
     HbInputDialog::mValueReturnValue = "";
-    HbInputDialog::mGetTextCallCount = 0;
-    VideoSortFilterProxyModelData::mLastAddedAlbumName = "";
-    
+    HbInputDialog::mOpenCallCount = 0;
+    VideoSortFilterProxyModelData::mLastAddedAlbumName = "";    
     disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot()));
     cleanup();
 }
@@ -1662,11 +1681,11 @@
     QVERIFY(allVideos);
     setRowCount(3, allVideos->mModel);
     // Must have different model than selection dialog has. Otherwise Qt optimizes rowCount calls 
-    // to source model and VideoListDataModelData::mRowCountDecrement hack doesn't work.
+    // to source model and VideoListDataModelData::mRowCountDecrement doesn't work.
+    QVERIFY(mTestView->initializeView() == 0);
     QVERIFY(connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot())));
     emit testSignal2();
     disconnect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot()));
-    QVERIFY(mTestView->initializeView() == 0);
     mTestView->activateView(TMPXItemId::InvalidId());
     VideoListDataModelData::mRowCountDecrement = 1;
     mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
--- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 49 %
+// Version : %version: 51 %
 
 #include <qmap.h>
 #include <vcxmyvideosdefs.h>
@@ -452,12 +452,12 @@
     
     // current level is not ELevelCategory
     // mIsService is true, variant gotten is invalid
-    videoServices->mCurrentService = VideoServices::EUriFetcher;
+    mTestWidget->mService = VideoServices::EUriFetcher;
     VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
     mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
     mTestWidget->mIsService = true;
     mTestWidget->mVideoServices = videoServices;
-    fetchIndex = model->index(0, 0, QModelIndex());
+    fetchIndex = model->index(5, 0, QModelIndex());
     mTestWidget->callEmiteActivated(fetchIndex);
     QVERIFY(spysignal.count() == 0);
     QVERIFY(spysignalFileUri.count() == 0);
@@ -466,7 +466,7 @@
     
     // current level is not ELevelCategory
     // mIsService is true, variant gotten is valid
-    videoServices->mCurrentService = VideoServices::EUriFetcher;
+    mTestWidget->mService = VideoServices::EUriFetcher;
     VideoListDataModelData::setData(VideoCollectionCommon::KeyFilePath, data);
     fetchIndex = model->index(0, 0, QModelIndex());
     mTestWidget->callEmiteActivated(fetchIndex);
@@ -778,16 +778,16 @@
     init();
     setRowCount(1);
     model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
-    mTestWidget->initialize(*model);
+    VideoServices *videoServices = VideoServices::instance();
+    mTestWidget->mIsService = true;
+    videoServices->mCurrentService = VideoServices::EUriFetcher;
+    mTestWidget->initialize(*model, videoServices);
     HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
     mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
-    VideoServices *videoServices = VideoServices::instance();
     
     mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
     VideoSortFilterProxyModelData::mItemIds.append(itemId);
-    mTestWidget->mIsService = true;
-    mTestWidget->mVideoServices = videoServices;
-    videoServices->mCurrentService = VideoServices::EUriFetcher;
+
     mTestWidget->callLongPressedSlot(item, point);
     iter = mTestWidget->mContextMenuActions.begin();
     QVERIFY(iter != mTestWidget->mContextMenuActions.end());
@@ -937,7 +937,7 @@
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     HbInputDialog::mValueReturnValue = "renamedVideo";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     setRowCount(1);
     VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
     QVariant data = QString("albumName");
@@ -946,13 +946,13 @@
     emit testSignal();
     dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     QVERIFY(HbInputDialog::mValueCallCount == 1);
         
     // New name is same as previous 
     HbInputDialog::mValueReturnValue = "";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     data = QString("albumName");
     VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
@@ -960,13 +960,13 @@
     emit testSignal();
     dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     QVERIFY(HbInputDialog::mValueCallCount == 1);
     
     // Dialog canceled 
     HbInputDialog::mValueReturnValue = "";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     data = QString("albumName");
     VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
@@ -974,21 +974,21 @@
     emit testSignal();
     dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1);
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     QVERIFY(HbInputDialog::mValueCallCount == 1);
     
     // New name is empty.
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     HbInputDialog::mValueReturnValue = "";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     data = QString("albumName");
     VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
     mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
     emit testSignal();
     dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 1);
     QVERIFY(HbInputDialog::mValueCallCount == 1);
     
     // Item is video
@@ -997,20 +997,20 @@
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     HbInputDialog::mValueReturnValue = "";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     data = QString("albumName");
     VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
     mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
     emit testSignal();
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 0);
     QVERIFY(HbInputDialog::mValueCallCount == 0);
 
     // No model
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     HbInputDialog::mValueReturnValue = "renamedVideo";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     VideoSortFilterProxyModelData::mItemIds.clear();
     VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
     data = QString("albumName");
@@ -1021,13 +1021,13 @@
     emit testSignal();
     mTestWidget->mModel = tmp;    
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 0);
     
     // Variant data is invalid
     VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
     HbInputDialog::mValueReturnValue = "renamedVideo";
     HbInputDialog::mValueCallCount = 0;
-    HbInputDialog::mGetTextCallCount = 0;
+    HbInputDialog::mOpenCallCount = 0;
     VideoSortFilterProxyModelData::mItemIds.clear();
     VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
     data = QVariant();
@@ -1035,7 +1035,7 @@
     mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
     emit testSignal();
     QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
-    QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+    QCOMPARE(HbInputDialog::mOpenCallCount, 0);
     
     disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
 }
--- a/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp	Fri May 28 09:45:19 2010 +0300
@@ -865,9 +865,9 @@
     {
         if (name == DOCML_NAME_VIEW)
         {
-            HbMainWindow *window = hbInstance->allMainWindows().at(0);
-            if (window)
+            if(hbInstance->allMainWindows().count())
             {
+                HbMainWindow *window = hbInstance->allMainWindows().at(0);
                 HbView *view = qobject_cast<HbView*>(object);
                 if (view)
                 {
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h	Fri May 28 09:45:19 2010 +0300
@@ -79,7 +79,11 @@
      * verifies sortModel
      */
     void testSortModel();
-
+    
+    /**
+     * verifies saveWidgetLevel & loadWidgetLevel
+     */
+    void testSaveAndLoadWidgetLevel();
 };
 
 
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp	Fri May 28 09:45:19 2010 +0300
@@ -27,6 +27,8 @@
 #include "hbmessageboxdata.h"
 #include "hbnotificationdialog.h"
 #include "hblistview.h"
+#include <hbactivitymanager.h>
+#include <hbapplication.h>
 
 #define private public
 #include "videocollectionviewutils.h"
@@ -44,7 +46,9 @@
 //
 int main(int argc, char *argv[])
 {
-    QApplication app(argc, argv);
+    HbApplication app(argc, argv);
+    //HbMainWindow window;
+    //QApplication app(argc, argv);
     
     TestVideoVideoCollectionViewUtils tv;
 
@@ -91,96 +95,148 @@
 {
     VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
     QVariant additional;
+    QList<QVariant> dataList;
     QString txt = "__test__";      
-    HbMessageBoxData::mWarningCallCount = 0;
     HbNotificationDialog::mNotifDialogTitle = "";
     HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
     HbNotificationDialog::mAttribute = Qt::WA_Disabled;
-
+    HbMessageBoxData::mType = -1;
+    HbMessageBoxData::mShowCallCount = 0;
     
     // status: VideoCollectionCommon::statusSingleDeleteFail
     additional = txt;
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
+    HbMessageBoxData::mType = -1;
+    HbMessageBoxData::mShowCallCount = 0;
     HbMessageBoxData::mInformationCallCount = 0;
-
     
     // - invalid additional
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+    HbMessageBoxData::mType = -1;
+    HbMessageBoxData::mShowCallCount = 0;
     
     // status: VideoCollectionCommon::statusMultipleDeleteFail
     additional = txt;
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    HbMessageBoxData::mType = -1;
+    HbMessageBoxData::mShowCallCount = 0;
 
     // - invalid additional (no change, since additional not excepted)
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    HbMessageBoxData::mType = -1;
+    HbMessageBoxData::mShowCallCount = 0;
     
     // status: VideoCollectionCommon::statusMultipleRemoveFail (additional not needed)
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    HbMessageBoxData::mType = -1;
+    HbMessageBoxData::mShowCallCount = 0;
     
     // status: VideoCollectionCommon::statusVideosAddedToCollection
     // notification dialog shown
-    additional = txt;
+    dataList.clear();
+    dataList.append(QVariant(1)); // count
+    dataList.append(QVariant(txt)); // name
+    additional = dataList;
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose);
-    HbMessageBoxData::mWarningCallCount = 0;
     HbNotificationDialog::mNotifDialogTitle = "";
     HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
     HbNotificationDialog::mAttribute = Qt::WA_Disabled;
+        
+    // - too few additional
+    dataList.clear();
+    dataList.append(QVariant(txt)); // name
+    additional = dataList;
+    testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
+    QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+    QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+    QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
     
+    // - empty message
+    dataList.clear();
+    dataList.append(QVariant(1)); // count
+    dataList.append(QVariant("")); // name
+    additional = dataList;
+    testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
+    QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+    QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+    QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+    
+    // - with zero video count
+    dataList.clear();
+    dataList.append(QVariant(0)); // count
+    dataList.append(QVariant(txt)); // name
+    additional = dataList;
+    testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
+    QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+    QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+    QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);    
+
     // - invalid additional
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
     
     // status: VideoCollectionCommon::statusAllVideosAlreadyInCollection
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusAllVideosAlreadyInCollection, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    HbMessageBoxData::mShowCallCount = 0;
+    HbMessageBoxData::mType = -1;
     
     // status: VideoCollectionCommon::statusDeleteInProgress
     additional = txt;
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose);
-    HbMessageBoxData::mWarningCallCount = 0;
     HbNotificationDialog::mNotifDialogTitle = "";
     HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
     HbNotificationDialog::mAttribute = Qt::WA_Disabled;
@@ -188,7 +244,8 @@
     // - invalid additional
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
@@ -196,16 +253,19 @@
     // status: VideoCollectionCommon::statusSingleRemoveFail
     additional = txt;
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    HbMessageBoxData::mShowCallCount = 0;
+    HbMessageBoxData::mType = -1;
     
     // - invalid additional
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
@@ -213,33 +273,34 @@
     // status: statusMultiRemoveFail
     additional = txt;
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
+    HbMessageBoxData::mShowCallCount = 0;
+    HbMessageBoxData::mType = -1;
     
     // invalid additional (no change, since additional not excepted)
     additional = QVariant();
     testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 1);
+    QVERIFY(HbMessageBoxData::mType == HbMessageBox::MessageTypeWarning);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
-    
+    HbMessageBoxData::mShowCallCount = 0;
+    HbMessageBoxData::mType = -1;
     
     // invalid state
     additional = txt;
     testObject.showStatusMsgSlot(0, additional);
-    QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+    QVERIFY(HbMessageBoxData::mShowCallCount == 0);
+    QVERIFY(HbMessageBoxData::mType == -1);
     QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
     QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
     QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
-    HbMessageBoxData::mWarningCallCount = 0;
-   
 }   
-    
 
 // -----------------------------------------------------------------------------
 // testSaveSortingValues
@@ -636,6 +697,25 @@
     QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
 }
 
+void TestVideoVideoCollectionViewUtils::testSaveAndLoadWidgetLevel()
+{
+    static const char* ACTIVITY_VIDEOS_MAINVIEW = "VideosMainView";
+    
+    VideoCollectionCommon::TCollectionLevels level;
+    
+    // Invalid level
+    level = VideoCollectionCommon::ELevelInvalid;
+    VideoCollectionViewUtils::saveWidgetLevel(level);
+    level = VideoCollectionViewUtils::loadWidgetLevel();
+    QVERIFY(level == VideoCollectionCommon::ELevelVideos);
+    
+    // Category level.
+    level = VideoCollectionCommon::ELevelCategory;
+    VideoCollectionViewUtils::saveWidgetLevel(level);
+    level = VideoCollectionViewUtils::loadWidgetLevel();
+    QVERIFY(level == VideoCollectionCommon::ELevelCategory);
+}
+
 // End of file
     
 
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro	Fri May 28 09:45:19 2010 +0300
@@ -53,7 +53,7 @@
     \ # sources needed in test
     ../../src/videocollectionviewutils.cpp
    
-TESTEDCLASS = videocollectionviewutils.cpp
+TESTEDCLASS = videocollectionviewutils
 include(../../../tsrc/stubs/stubs.pro)
     
            
--- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp	Fri May 28 09:45:19 2010 +0300
@@ -211,6 +211,8 @@
 {
     VideoCollectionWrapperData::reset();
     VideoListWidgetData::reset();
+    cleanup();
+    init();
     
     QVERIFY(mInitOk == true);
     QVERIFY(mModel != 0);
--- a/videocollection/videocollectionwrapper/src/videodatacontainer.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videodatacontainer.cpp	Fri May 28 09:45:19 2010 +0300
@@ -14,7 +14,7 @@
 * Description:   VideoDataContainer class declaration*
 */
 
-// Version : %version: %
+// Version : %version: 14 %
 
 // INCLUDE FILES
 #include <mpxmediageneraldefs.h>
@@ -119,6 +119,7 @@
     // if item exist, do not add into container
     if(iter != mMediaData.end())
     {
+        delete media;
         return;
     }      
     mMediaIds.append(mediaId);
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 65 %
+// Version : %version: 66 %
 
 // INCLUDE FILES
 #include <qstringlist.h>
@@ -525,11 +525,14 @@
 //
 TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
 {
-    QModelIndex sourceIndex = mapToSource(index);
     TMPXItemId mpxId = TMPXItemId::InvalidId();
-    if(mModel && sourceIndex.isValid())
+    if(index.isValid())
     {
-        mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+        QModelIndex sourceIndex = mapToSource(index);
+        if(mModel && sourceIndex.isValid())
+        {
+            mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+        }
     }
     return mpxId;
 }
--- a/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 4 %
+// Version : %version: 6 %
 
 // INCLUDE FILES
 #include <qpixmap.h>
@@ -302,13 +302,15 @@
 void VideoThumbnailFetcher::thumbnailReadySlot(QPixmap tnData, void *internal, int requestId, int error)
 {
     INFO_2("VideoThumbnailFetcher::thumbnailReadySlot() requestId: %d, error: %d", requestId, error);
+    Q_UNUSED(requestId);
     
     TMPXItemId mediaId = TMPXItemId::InvalidId();
     if(internal)
     {
-        mediaId = *(static_cast<TMPXItemId*>(internal));
+        TMPXItemId *idPointer = static_cast<TMPXItemId*>(internal); 
+        mediaId = *idPointer;
+        delete idPointer;
     }
-    delete internal;
 
     // Thumbnail has not been generated yet, put it into creation list.
     if(error == -1)
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/testvideocollectionlistener.pro	Fri May 28 09:45:19 2010 +0300
@@ -35,8 +35,7 @@
            inc/mediaobjectfactory.h \
            stub/inc/stubcollection.h  \ 
            stub/inc/videocollectionclient.h  \
-           stub/inc/stubsignalreceiver.h \  
-           stub/inc/stubsignalreceiver.h \  
+           stub/inc/stubsignalreceiver.h \
            ../../inc/videocollectionutils.h \
            ../../inc/videodatasignalreceiver.h \
            ../../inc/videocollectionlistener.h
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp	Fri May 28 09:45:19 2010 +0300
@@ -162,12 +162,21 @@
 //
 void TestVideoThumbnailData_p::testDestructor()
 {
-    mWrapper = 0;
+    init();
     
-    mTestObject = new VideoThumbnailDataTester();
-    delete mTestObject; mTestObject = 0;
+    mTestObject->getThumbnail(TMPXItemId(1, 0));
+    mTestObject->getThumbnail(TMPXItemId(0, 1));
+
+    QPointer<VideoThumbnailFetcher> thumbFetcher = mTestObject->mThumbnailFetcher;
+    QPointer<QTimer> reportTimer = mTestObject->mTbnReportTimer;
+    QPointer<QTimer> fetchTimer = mTestObject->mBgFetchTimer;
     
-    //TODO
+    cleanup();
+    
+    QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
+    QVERIFY(thumbFetcher == 0);
+    QVERIFY(reportTimer == 0);
+    QVERIFY(fetchTimer == 0);
 }
 
 // ---------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrol.hrh	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  6 %
+// Version : %version:  7 %
 
 
 #ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
@@ -57,7 +57,6 @@
     //
     //  Bitmaps
     //
-    EMPXBlackBitmap,
     EMPXIndicatorBitmap,
     EMPXRealLogoBitmap,
 
@@ -89,7 +88,8 @@
     EMPXControlCmdSoftKeyPressed,
     EMPXControlCmdFullScreenViewOpened,
     EMPXControlCmdDetailsViewOpened,
-    EMPXControlCmdAudionOnlyViewOpened
+    EMPXControlCmdAudionOnlyViewOpened,
+    EMPXControlCmdRemoveRNLogo
 };
 
 enum TMPXVideoSeekingType
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 2 %
+// Version : %version: 3 %
 
 
 
@@ -114,7 +114,6 @@
         TMPXSeekingState                     mSeekingState;
 
         bool    mInitialized;
-        bool    mNeverVisibled;
         int     mPosition;
         int     mDuration;
         int     mAspectRatio;
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#19 %
+// Version : %version: da1mmcf#20 %
 
 
 
@@ -64,6 +64,8 @@
 
     QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
 
+    addControlToList( EMPXStatusPane );
+
     if ( fileDetails->mPlaybackMode == EMPXVideoStreaming ||
          fileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
     {
@@ -72,8 +74,10 @@
         //
         addControlToList( EMPXBufferingAnimation );
     }
-
-    addControlToList( EMPXStatusPane );
+    else if ( fileDetails->mRNFormat )
+    {
+        addControlToList( EMPXRealLogoBitmap );
+    }
 
     emit controlListUpdated();
 }
@@ -143,12 +147,12 @@
 
             break;
         }
-        case EMPXControlCmdTvOutDisconnected:
+        case EMPXControlCmdRemoveRNLogo:
         {
-            break;
-        }
-        default:
-        {
+            MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() RN Logo removed"));
+
+            deleteControlFromList( EMPXRealLogoBitmap );
+
             break;
         }
     }
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#13 %
+// Version : %version: da1mmcf#14 %
 
 
 
@@ -127,6 +127,7 @@
         }
         case EMPXFileDetailsWidget:
         case EMPXIndicatorBitmap:
+        case EMPXRealLogoBitmap:
         case EMPXDetailsViewPlaybackWindow:
         {
             //
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#39 %
+// Version : %version: da1mmcf#40 %
 
 
 
@@ -67,6 +67,7 @@
     , mControlsPolicy( NULL )
     , mControlsConfig( NULL )
     , mControlsTimer( NULL )
+    , mRNLogoTimer( NULL )
     , mLoader( NULL )
     , mVolumeControl( NULL )
     , mThumbnailManager( NULL )
@@ -126,6 +127,8 @@
         mLoader = NULL;
     }
 
+    mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
+
     mControlsTimer = new QTimer( this );
     mControlsTimer->setInterval( KMPXControlsTimeOut );
     mControlsTimer->setSingleShot( false );
@@ -139,6 +142,9 @@
     connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
     mControlsConfig->createControlList();
 
+    //
+    // Create volume popup control
+    //
     mVolumeControl = new HbVolumeSliderPopup();
     mVolumeControl->setVisible( false );
     mVolumeControl->setTimeout( KMPXControlsTimeOut );
@@ -175,7 +181,6 @@
             }
         }
     }
-
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -202,6 +207,14 @@
         mControlsTimer = NULL;
     }
 
+    if ( mRNLogoTimer )
+    {
+        disconnect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );        
+
+        delete mRNLogoTimer;
+        mRNLogoTimer = NULL;
+    }
+
     if ( mControlsPolicy )
     {
         delete mControlsPolicy;
@@ -249,7 +262,6 @@
     	mVideoServices->decreaseReferenceCount();
     	mVideoServices = 0;
     }
-    
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -263,8 +275,6 @@
 
     mFileDetails = details;
 
-    mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
-
     mControlsConfig->updateControlsWithFileDetails();
 
     //
@@ -480,7 +490,7 @@
             //  Control exists in new list.
             //
             myList.removeAt( index );
-            i++;            
+            i++;
         }
     }
 
@@ -519,11 +529,27 @@
         case EMPXBufferingAnimation:
         {
             //
+            // Load animation icons
+            //
+            QString animationName = ":/hbvideoplaybackview/animations/";
+
+            if ( mFileDetails->mRNFormat )
+            {
+                animationName.append( "rn_preroll_anim.axml" );
+            }
+            else
+            {
+                animationName.append( "generic_preroll_anim.axml" );
+            }
+
+            HbIconAnimationManager* manager = HbIconAnimationManager::global();
+            bool ok = manager->addDefinitionFile( animationName );
+
+            MPX_DEBUG(_L("    EMPXBufferingAnimation add animation definition ok = %d"), ok);
+
+            //
             // Buffering animation icon
             //
-            HbIconAnimationManager* manager = HbIconAnimationManager::global();
-            manager->addDefinitionFile(":/hbvideoplaybackview/animation.axml");
-			
             QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
             HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
 
@@ -594,6 +620,22 @@
 
             break;
         }
+        case EMPXRealLogoBitmap:
+        {
+            QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
+            HbWidget *bitmapWidget = qobject_cast<HbWidget*>( widget );
+
+            control = new QMPXVideoPlaybackFullScreenControl( this,
+                                                              controlIndex,
+                                                              bitmapWidget,
+                                                              properties );
+            mControls.append( control );
+
+            connect( bitmapWidget, SIGNAL( visibleChanged() ),
+                     this, SLOT( handleRNLogoVisibleChanged() ) );
+
+            break;
+        }
         case EMPXDetailsViewPlaybackWindow:
         {
             QGraphicsWidget *widget = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
@@ -1038,7 +1080,7 @@
 //   QMPXVideoPlaybackControlsController::isSoftKeyVisible()
 // -------------------------------------------------------------------------------------------------
 //
-bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ )
+bool QMPXVideoPlaybackControlsController::isSoftKeyVisible()
 {
     bool visible = false;
 
@@ -1381,6 +1423,79 @@
 }
 
 // -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::handleRNLogoVisibleChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::handleRNLogoVisibleChanged()
+{
+    MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleRNLogoVisibleChanged()"));
+
+    QGraphicsWidget *widget = mLoader->findWidget( QString( "rnLogoBitmap" ) );
+
+    if ( widget->isVisible() )
+    {
+        if ( mRNLogoTimer )
+        {
+            delete mRNLogoTimer;
+            mRNLogoTimer = NULL;
+        }
+
+        mRNLogoTimer = new QTimer( this );
+        mRNLogoTimer->setInterval( KMPXRNLogoTimeOut );
+        mRNLogoTimer->setSingleShot( true );
+        connect( mRNLogoTimer, SIGNAL( timeout() ), this, SLOT( handleRNLogoTimeout() ) );        
+
+        mRNLogoTimer->start();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::handleRNLogoTimeout()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::handleRNLogoTimeout()
+{
+    MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleRNLogoTimeout()"));
+
+    if ( mRNLogoTimer->isActive() )
+    {
+        mRNLogoTimer->stop();
+    }
+
+    //
+    // Remove RN logo from the controls list and issue play command if needed
+    //
+    mControlsConfig->updateControlList( EMPXControlCmdRemoveRNLogo );
+    handleCommand( EMPXPbvCmdRealOneBitmapTimeout );
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList()
+// -------------------------------------------------------------------------------------------------
+//
+bool QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList()
+{
+    bool exist = false;
+
+    //
+    // If we have a rn logo in the list, we are supposed to show the logo all the time
+    // unless we are in the middle of orientation transition
+    //
+    for ( int i = 0 ; i < mControls.count() ; i++ )
+    {
+        if ( mControls[i]->controlIndex() == EMPXRealLogoBitmap )
+        {
+            exist = true;
+            break;
+        }
+    }
+
+    MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList() [%d]"), exist);
+
+    return exist;
+}
+
+// -------------------------------------------------------------------------------------------------
 // QMPXVideoPlaybackControlsController::handleOrientationChanged()
 // -------------------------------------------------------------------------------------------------
 //
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#22 %
+// Version : %version: da1mmcf#23 %
 
 
 
@@ -128,7 +128,6 @@
         //
         positionChanged( 0 );
 
-
         //
         // Set framedrawer for semi transparent background
         //
@@ -364,8 +363,8 @@
 {
     MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateControlsWithFileDetails()"));
 
-    if ( details->mPlaybackMode == EMPXVideoLiveStreaming )
-    {
+    if ( ! details->mPausableStream || ! details->mSeekable )
+    {    
         mProgressSlider->setEnabled( false );
     }
     else if ( ! mProgressSlider->isEnabled() )
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  4 %
+// Version : %version:  6 %
 
 
 
@@ -51,7 +51,6 @@
     , mRetrieveButtonTimer( NULL )
     , mSeekingState( EMPXNotSeeking )
     , mInitialized( false )
-    , mNeverVisibled( true )
     , mPosition( 0 )
     , mDuration( 0 )
     , mAspectRatio( EMPXPbvCmdNaturalAspectRatio )
@@ -206,7 +205,6 @@
         TReal32 width = (TReal32) displayRect.Width();
         TReal32 height = (TReal32) displayRect.Height();            
         mDisplayAspectRatio = (width > height)? (width / height) : (height / width);
-        
     }
 }
 
@@ -408,7 +406,13 @@
 
     mAspectRatio = aspectRatio;
 
-    if ( ! mController->isAttachOperation() )
+    //
+    // If we are in attach service or audio only view, then don't update the icon.
+	// Aspect ratio icon slots are shared with attach and share icon.
+	// Just update the mAspectRatio 
+	// and once we go back to full screen, we will show the correct aspect ratio icon
+	//
+    if ( ! mController->isAttachOperation() && mController->viewMode() == EFullScreenView )
     {
         switch( mAspectRatio )
         {
@@ -590,25 +594,42 @@
         mButtonActions[EMPX5thButton]->setEnabled( true );
     }
 
-    if ( ! details->mSeekable )
-    {
-        mButtonActions[EMPX2ndButton]->setEnabled( false );
-        mButtonActions[EMPX4thButton]->setEnabled( false );
-    }
-    else
+    if ( details->mSeekable && details->mPausableStream )
     {
         mButtonActions[EMPX2ndButton]->setEnabled( true );
         mButtonActions[EMPX4thButton]->setEnabled( true );
     }
+    else
+    {
+        mButtonActions[EMPX2ndButton]->setEnabled( false );
+        mButtonActions[EMPX4thButton]->setEnabled( false );
+    }
 
-    if ( ! details->mPausableStream )
+    if ( details->mPausableStream )
+    {
+        mButtonActions[EMPX3rdButton]->setEnabled( true );
+    }
+    else
     {
         mButtonActions[EMPX3rdButton]->setEnabled( false );
     }
-    else
+
+    //
+    // toolbar creates button once it gets visible, so we don't know exact timing when toolbar 
+    // creates button, so start timer to get layout information once the toolbar gets visible.
+    // This is needed since we don't use toolbar in proper way.
+    //
+    if ( ! mRetrieveButtonTimer && ! mButtons.count() )
     {
-        mButtonActions[EMPX3rdButton]->setEnabled( true );
-    }        
+        mRetrieveButtonTimer = new QTimer();
+        mRetrieveButtonTimer->setSingleShot( false );
+        mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut );
+        connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );            
+
+        mRetrieveButtonTimer->start();        
+    }
+
+    durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier );
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -636,7 +657,6 @@
     MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position );
 
     mPosition = position;
-    retrieveButtons();
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -661,24 +681,6 @@
     if ( visible )
     {
         mController->view()->showItems( Hb::ToolBarItem );
-
-        if ( mNeverVisibled )
-        {
-            mNeverVisibled = false;
-
-
-            //
-            // toolbar creates button once it gets visible, so we don't know exact timing when toolbar 
-            // creates button, so start timer to get layout information once the toolbar gets visible.
-            // This is needed since we don't use toolbar in proper way.
-            //
-            mRetrieveButtonTimer = new QTimer();
-            mRetrieveButtonTimer->setSingleShot( false );
-            mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut );
-            connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
-
-            mRetrieveButtonTimer->start();
-        }
     }
     else
     {
@@ -700,10 +702,13 @@
 
         if ( layout )
         {
-		    disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
-            if ( mRetrieveButtonTimer->isActive() )
+            if ( mRetrieveButtonTimer )
             {
-                mRetrieveButtonTimer->stop();
+                disconnect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) );
+                if ( mRetrieveButtonTimer->isActive() )
+                {
+                    mRetrieveButtonTimer->stop();
+                }                
             }
 
             for ( int i = 0 ; i < layout->count() ; i++ )
--- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#18 %
+// Version : %version: da1mmcf#19 %
 
 
 
@@ -73,6 +73,7 @@
 };
 
 const int KMPXControlsTimeOut = 4000;
+const int KMPXRNLogoTimeOut = 600;
 
 const QString KMPXPLAYBACKVIEW_XML = ":/hbvideoplaybackview/hbvideoplaybackview.docml";
 
@@ -148,6 +149,8 @@
 
         inline bool isAttachOperation();
 
+        bool isRNLogoBitmapInControlList();
+
     private:
         /**
         * Initialize controller
@@ -230,9 +233,9 @@
         void handleErrors(); 
         
         /**
-		* Return ETrue if control is visible
+		* Return true if control is visible
 		*/
-		bool isSoftKeyVisible( int value );
+		bool isSoftKeyVisible();
 
         /**
         * Handle tvout connected/disconnected event
@@ -266,6 +269,8 @@
         void controlsListUpdated();
         void attachVideo();
         void sendVideo();
+        void handleRNLogoVisibleChanged();
+        void handleRNLogoTimeout();
         void handleOrientationChanged( Qt::Orientation orientation );
 
     private:
@@ -279,6 +284,7 @@
         QMPXVideoPlaybackControlConfiguration     *mControlsConfig;
 
         QTimer                                    *mControlsTimer;
+        QTimer                                    *mRNLogoTimer;
 
         QMPXVideoPlaybackDocumentLoader           *mLoader;
         HbVolumeSliderPopup                       *mVolumeControl;
--- a/videoplayback/hbvideoplaybackview/resources/animation.axml	Fri May 14 15:14:51 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<animations>
-<icon name="frame_anim_looping" frame_duration="100" playmode="loop">
-<frame>qtg_anim_loading_1</frame>
-<frame>qtg_anim_loading_2</frame>
-<frame>qtg_anim_loading_3</frame>
-<frame>qtg_anim_loading_4</frame>
-<frame>qtg_anim_loading_5</frame>
-<frame>qtg_anim_loading_6</frame>
-<frame>qtg_anim_loading_7</frame>
-<frame>qtg_anim_loading_8</frame>
-<frame>qtg_anim_loading_9</frame>
-<frame>qtg_anim_loading_10</frame>
-</icon>
-</animations>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/resources/animations/generic_preroll_anim.axml	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,14 @@
+<animations>
+    <icon name="preroll_anim" frame_duration="100" playmode="loop">
+        <frame>qtg_anim_loading_1</frame>
+        <frame>qtg_anim_loading_2</frame>
+        <frame>qtg_anim_loading_3</frame>
+        <frame>qtg_anim_loading_4</frame>
+        <frame>qtg_anim_loading_5</frame>
+        <frame>qtg_anim_loading_6</frame>
+        <frame>qtg_anim_loading_7</frame>
+        <frame>qtg_anim_loading_8</frame>
+        <frame>qtg_anim_loading_9</frame>
+        <frame>qtg_anim_loading_10</frame>
+    </icon>
+</animations>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/resources/animations/rn_preroll_anim.axml	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,13 @@
+<animations>
+    <icon name="preroll_anim" frame_duration="100" playmode="loop">
+        <frame>qtg_anim_longtap_1</frame>
+        <frame>qtg_anim_longtap_2</frame>
+        <frame>qtg_anim_longtap_3</frame>
+        <frame>qtg_anim_longtap_4</frame>
+        <frame>qtg_anim_longtap_5</frame>
+        <frame>qtg_anim_longtap_6</frame>
+        <frame>qtg_anim_longtap_7</frame>
+        <frame>qtg_anim_longtap_8</frame>
+        <frame>qtg_anim_longtap_9</frame>
+    </icon>
+</animations>
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml	Fri May 28 09:45:19 2010 +0300
@@ -3,7 +3,7 @@
     <widget name="content" type="HbWidget">
         <widget name="bufferingIcon" type="HbLabel">
             <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-            <icon iconName="frame_anim_looping" name="icon"/>
+            <icon iconName="preroll_anim" name="icon"/>
             <real name="z" value="6"/>
             <sizehint height="70" type="PREFERRED" width="70"/>
             <bool name="visible" value="FALSE"/>
@@ -149,6 +149,12 @@
                 <linearitem itemname="attachShareButton"/>
             </layout>
         </widget>
+        <widget name="rnLogoBitmap" type="HbLabel">
+            <real name="z" value="7"/>
+            <sizehint height="200" type="PREFERRED" width="200"/>
+            <icon iconName="qtg_large_realplayer" name="icon"/>
+            <bool name="visible" value="FALSE"/>
+        </widget>
         <size height="360" name="size" width="640"/>
         <real name="z" value="1"/>
         <rect height="360" name="geometry" width="640" x="0" y="0"/>
@@ -180,6 +186,8 @@
             <anchoritem dst="fileDetailsLayout" dstEdge="TOP" spacing="0" src="titleLayout" srcEdge="BOTTOM"/>
             <anchoritem dst="fileDetailsLayout" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
             <anchoritem dst="fileDetailsLayout" dstEdge="BOTTOM" spacing="0" src="" srcEdge="BOTTOM"/>
+            <anchoritem dst="rnLogoBitmap" dstEdge="CENTERH" spacing="0" src="" srcEdge="CENTERH"/>
+            <anchoritem dst="rnLogoBitmap" dstEdge="CENTERV" spacing="0" src="" srcEdge="CENTERV"/>
         </layout>
     </widget>
     <metadata activeUIState="Common ui state" display="NHD landscape" unit="px">
--- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.qrc	Fri May 28 09:45:19 2010 +0300
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <RCC>
     <qresource prefix="hbvideoplaybackview">
-        <file>animation.axml</file>
+        <file>animations/rn_preroll_anim.axml</file>
+        <file>animations/generic_preroll_anim.axml</file>
         <file>hbvideoplaybackview.docml</file>
         <file>effects/controlbar_appear.fxml</file>
         <file>effects/controlbar_disappear.fxml</file>
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 * 
 */
 
-// Version : %version: %
+// Version : %version: 4 %
 
 #include <hbapplication.h>
 #include <hbinstance.h>
@@ -82,7 +82,6 @@
     mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails );
                                                                      
     mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController );
-    mControlConfig->createControlList();
 }
 
 // ---------------------------------------------------------------------------
@@ -121,11 +120,54 @@
     MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()"));
 
     setup();
-    
+
+    //
+    // Streaming case
+    //
+    mFileDetails->mPlaybackMode = EMPXVideoStreaming;
+
+    mControlConfig->createControlList();
     QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList();
-    
+
+    QVERIFY( controlsList.contains( EMPXStatusPane ) );
+    QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) );
+    QVERIFY( controlsList.contains( EMPXBufferingAnimation ) );
+
+    cleanup();
+
+    //
+    // local + RN
+    //
+    setup();
+
+    mFileDetails->mPlaybackMode = EMPXVideoLocal;
+    mFileDetails->mRNFormat = true;
+
+    mControlConfig->createControlList();
+    controlsList = mControlConfig->controlList();
+
     QVERIFY( controlsList.contains( EMPXStatusPane ) );
-        
+    QVERIFY( controlsList.contains( EMPXRealLogoBitmap ) );
+    QVERIFY( ! controlsList.contains( EMPXBufferingAnimation ) );
+
+    cleanup();
+
+    //
+    // local + non RN
+    //
+    setup();
+
+    mFileDetails->mPlaybackMode = EMPXVideoLocal;
+    mFileDetails->mRNFormat = false;
+
+    mControlConfig->createControlList();
+    controlsList = mControlConfig->controlList();
+
+    QVERIFY( controlsList.contains( EMPXStatusPane ) );
+    QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) );
+    QVERIFY( ! controlsList.contains( EMPXBufferingAnimation ) );
+
+    cleanup();
 }
 
 // ---------------------------------------------------------------------------
@@ -137,8 +179,11 @@
     MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()"));
 
     setup();
-    
+    mControlConfig->createControlList();
+
+    //
     // 1. test with mVideoEnabled = false
+    //
     mControlsController->mFileDetails->mVideoEnabled = false;
     
     mControlConfig->updateControlsWithFileDetails();
@@ -146,8 +191,10 @@
     QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList();
     
     QVERIFY( controlsList.contains( EMPXControlBar ) );
-    
+
+    //
     // 2. test with mVideoEnabled = true
+    //
     mControlsController->mFileDetails->mVideoEnabled = false;
     
     mControlConfig->updateControlsWithFileDetails(); 
@@ -158,6 +205,8 @@
             mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
 
     QVERIFY( widget->isVisible() );
+
+    cleanup();
 }
 
 // ---------------------------------------------------------------------------
@@ -169,30 +218,48 @@
     MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()"));
 
     setup();    
-    
+    mControlConfig->createControlList();
+
+    //
     // 1.  Test for Details View
+    //
     mControlConfig->updateControlList( EMPXControlCmdDetailsViewOpened );
-
     QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList();
 
     QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) );    
+    QVERIFY( controlsList.contains( EMPXDetailsViewPlaybackWindow ) );
+    QVERIFY( ! controlsList.contains( EMPXIndicatorBitmap ) );    
 
 
+    //
     // 2. Test for Fullscreen View
+    //
     mControlConfig->updateControlList( EMPXControlCmdFullScreenViewOpened );
-
     controlsList = mControlConfig->controlList();
     
     QVERIFY( ! controlsList.contains( EMPXFileDetailsWidget ) );    
-    
-    
+    QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) );    
+    QVERIFY( ! controlsList.contains( EMPXIndicatorBitmap ) );
+
+    //
     // 3. Test for Audio Only View
+    //
     mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened );
-
     controlsList = mControlConfig->controlList();
     
     QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); 
-    QVERIFY( controlsList.contains( EMPXIndicatorBitmap ) );        
+    QVERIFY( controlsList.contains( EMPXIndicatorBitmap ) );
+    QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) );
+
+    //
+    // 4. RN log gets removed
+    //
+    mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened );
+    controlsList = mControlConfig->controlList();
+
+    QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); 
+
+    cleanup();
 }
 
 // End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 * 
 */
 
-// Version : %version:  3 %
+// Version : %version:  4 %
 
 
 #include <qdebug>
@@ -33,9 +33,9 @@
 #include "mpxvideoplaybacktoolbar.h"
 #undef private
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // main
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 int main(int argc, char *argv[])
 {
@@ -49,17 +49,16 @@
     char *pass[3];
     pass[0] = argv[0];
     pass[1] = "-o";
-    pass[2] = "c:\\data\\TestMPXVideoPlaybackToolBar.txt";
+    pass[2] = "c:\\data\\testmpxvideoplaybacktoolbar.txt";
     
     int res = QTest::qExec(&tv, 3, pass);
     
     return res;
 }
 
-
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // init
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::init( bool attachOperation )
 {
@@ -69,14 +68,15 @@
     mVideoToolBar = new QMPXVideoPlaybackToolBar( mController );
 
     mVideoToolBar->setVisible( true );
+
     connect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) );
     emit commandSignal();
     disconnect( this, SIGNAL( commandSignal() ), mVideoToolBar, SLOT( retrieveButtons() ) );
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // cleanup
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::cleanup()
 {
@@ -95,9 +95,9 @@
     }
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testPlay
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testPlay()
 {
@@ -113,9 +113,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testLongTapOnFF
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testLongTapOnFF()
 {
@@ -148,9 +148,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testLongTapOnRW
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testLongTapOnRW()
 {
@@ -183,9 +183,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testShortTapOnFF
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testShortTapOnFF()
 {
@@ -217,9 +217,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testShortTapOnRW
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testShortTapOnRW()
 {
@@ -250,9 +250,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testPause
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testPause()
 {
@@ -268,9 +268,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testChangeAspectRatio
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testChangeAspectRatio()
 {
@@ -308,9 +308,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testUpdateState
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testUpdateState()
 {
@@ -345,9 +345,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testAspectRatioChanged
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testAspectRatioChanged()
 {
@@ -379,9 +379,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testHandleButtonPressed
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testHandleButtonPressed()
 {
@@ -396,9 +396,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testUpdateWithFileDetails
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testUpdateWithFileDetails()
 {
@@ -455,13 +455,13 @@
     details->mVideoWidth = 1;
     details->mTvOutConnected = true;
     details->mSeekable = false;
-    details->mPausableStream = false;
+    details->mPausableStream = true;
 
     mVideoToolBar->updateWithFileDetails( details );
 
     QVERIFY( mVideoToolBar->mButtons[EMPX1stButton]->isEnabled() == false );
     QVERIFY( mVideoToolBar->mButtons[EMPX2ndButton]->isEnabled() == false );
-    QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == false );
+    QVERIFY( mVideoToolBar->mButtons[EMPX3rdButton]->isEnabled() == true );
     QVERIFY( mVideoToolBar->mButtons[EMPX4thButton]->isEnabled() == false );
     QVERIFY( mVideoToolBar->mButtons[EMPX5thButton]->isEnabled() == false );
 
@@ -472,7 +472,7 @@
     details->mVideoHeight = 0;
     details->mVideoWidth = 1;
     details->mTvOutConnected = true;
-    details->mSeekable = false;
+    details->mSeekable = true;
     details->mPausableStream = false;
     mController->mViewMode = EAudioOnlyView;
 
@@ -490,6 +490,8 @@
     details->mVideoEnabled = false;
     details->mPlaybackMode = EMPXVideoStreaming;
     mController->mViewMode = EAudioOnlyView;
+    details->mSeekable = false;
+    details->mPausableStream = false;
 	
     mVideoToolBar->updateWithFileDetails( details );
 
@@ -527,9 +529,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testOpenDetailsView
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testOpenDetailsView()
 {
@@ -554,9 +556,9 @@
     cleanup();
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testAttach
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testAttach()
 {
@@ -604,9 +606,9 @@
     
 }
 
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 // testSend
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
 //
 void TestMPXVideoPlaybackToolBar::testSend()
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,85 @@
+/**
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   tester for methods in Video Playback View Plugin
+* 
+*/
+
+#ifndef __TESTMPXVIDEOVIEWWRAPPER_H__
+#define __TESTMPXVIDEOVIEWWRAPPER_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class CMPXVideoViewWrapper;
+class HbVideoBasePlaybackView;
+
+class TestMPXVideoViewWrapper : public QObject
+{
+    Q_OBJECT
+
+    public:
+
+        /**
+         * will be called before each testfunction is executed.
+         *
+         */
+        void init(); 
+    
+        /**
+         * will be called after every testfunction.
+         *
+         */
+        void cleanup();
+    
+    private slots:
+		// the order in which these testXX methods are declared is important
+		// changing this order will affect the test results
+		void testRequestMedia();
+		void testIsLive();
+		void testIsPlaylist();
+		void testHandleCommand();
+		void testHandlePluginError();
+		void testHandlePlaybackMessage();
+		void testSetProperty();
+		void testHandleProperty();
+		void testRetrieveFileNameAndMode();
+		void testActivateClosePlayerActiveObject();
+		void testDoClosePlayer();
+		void testSetAspectRatio();
+		void testIsAppInFront();
+		void testClosePlaybackView();
+		void testHandleVolumeCmd();
+		void testHandleShortPressBackward();
+		void testIssueVideoAppForegroundCmd();
+		void testCreateControls();
+		void testIsMultiItemPlaylist();
+		void testUpdateVideoRect();
+		void testUpdateVideoRectDone();
+		void testHandleBufferingState();
+		void testHandleVideoPlaybackMessage();
+		void testHandlePlaybackCommandComplete();
+		void testHandleMedia();
+
+    signals:
+        void commandSignal(int);
+    
+    private:
+        CMPXVideoViewWrapper    *mVideoViewWrapper;
+        HbVideoBasePlaybackView *mBaseVideoView; 
+};
+
+#endif  // __TESTMPXVIDEOVIEWWRAPPER_H__
+
+// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 * 
 */
 
-// Version : %version:  %
+// Version : %version:  7 %
 
 #include <e32err.h>
 #include <w32std.h>
@@ -36,12 +36,10 @@
 
 #include "../stub/inc/hbvideobaseplaybackview.h"
 #include "../stub/inc/mpxvideoplaybackviewfiledetails.h"
-#include "../stub/inc/mpxplaybackutilityimpl.h"
 #include "../stub/inc/mpxvideoplaybackdisplayhandler.h"
 #include "../stub/inc/mpxvideoplaybackcontrolscontroller.h"
 
 
-
 #define protected public
 #include "mpxvideoviewwrapper.h"
 #undef protected
@@ -61,23 +59,22 @@
     char *pass[3];
     pass[0] = argv[0];
     pass[1] = "-o";
-    pass[2] = "c:\\data\\TestMPXVideoViewWrapper.txt";
+    pass[2] = "c:\\data\\testmpxvideoviewwrapper.txt";
     
     int res = QTest::qExec(&tv, 3, pass);
     
     return res;
 }
 
-
 // ---------------------------------------------------------------------------
 // init
 // ---------------------------------------------------------------------------
 //
 void TestMPXVideoViewWrapper::init()
 {	  
-	  mBaseVideoView    = new HbVideoBasePlaybackView();
-	  TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) );	  
-	  QVERIFY( err == KErrNone );
+    mBaseVideoView    = new HbVideoBasePlaybackView();
+    TRAPD( err, mVideoViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView ) );	  
+    QVERIFY( err == KErrNone );
 }
 
 // ---------------------------------------------------------------------------
@@ -86,14 +83,19 @@
 //
 void TestMPXVideoViewWrapper::cleanup()
 {
-    delete mVideoViewWrapper;
-    mVideoViewWrapper = NULL;
-    
-    delete mBaseVideoView;
-    mBaseVideoView = NULL;
+    if ( mVideoViewWrapper )
+    {
+        delete mVideoViewWrapper;
+        mVideoViewWrapper = NULL;        
+    }
+
+    if ( mBaseVideoView )
+    {
+        delete mBaseVideoView;
+        mBaseVideoView = NULL;
+    }
 }
 
-
 void TestMPXVideoViewWrapper::testRequestMedia()
 {
     init();
@@ -101,10 +103,9 @@
     TRAPD(err, mVideoViewWrapper->RequestMediaL());
     QVERIFY( err == KErrNone );
 	        
-    QVERIFY( mVideoViewWrapper->iMediaRequested == true );
+    QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaRequested );
     
     cleanup();
-
 }
 
 void TestMPXVideoViewWrapper::testIsLive()
@@ -114,51 +115,202 @@
     TRAPD(err, mVideoViewWrapper->RequestMediaL());
     QVERIFY( err == KErrNone );
     
-    mVideoViewWrapper->IsLive();       
-    
-    mVideoViewWrapper->iFileDetails->clearFileDetails();
-    
+    mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
+    QVERIFY( mVideoViewWrapper->IsLive() );
+
+    mVideoViewWrapper->iFileDetails->mPlaybackMode = EMPXVideoLocal;
     QVERIFY( ! mVideoViewWrapper->IsLive() );
                 
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testIsPlaylist()
 {
     init();
 
-    mVideoViewWrapper->IsPlaylist();
-            
-    QVERIFY( mVideoViewWrapper->IsPlaylist() == false );
+    mVideoViewWrapper->iPlaylistView = true;
+    QVERIFY( mVideoViewWrapper->IsPlaylist() == true );
         
-    cleanup();
+    mVideoViewWrapper->iPlaylistView = false;
+    QVERIFY( mVideoViewWrapper->IsPlaylist() == false );
 
+    cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testHandleCommand()
 {
     init();
     
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+    TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
     QVERIFY( errReqMedia == KErrNone );
+
+    //
+    // Test 'Play' command
+    //
+    TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
     
-    TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ));    
+    //
+    // Test 'Pause' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPause ) );    
     QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause );
+
+    //
+    // Test 'Close' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdClose ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdClose );
+    
+    //
+    // Test 'Seek Forward' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdSeekForward ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStartVideoSeekingForward );
 
-    int state;
-    TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL());
-    QVERIFY( errState == KErrNone );
+    //
+    // Test 'Seek Backward' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdSeekBackward ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStartVideoSeekingBackward );
+    
+    //
+    // Test 'End Seek' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdEndSeek ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStopVideoSeeking );
+    
+    //
+    // Test 'PlayPause' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlayPause ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlayPause );
+    
+    //
+    // Test 'Stop' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStop ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdStop );
+    
+    //
+    // Test 'Decrease Volume' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleDecreaseVolume );
+    
+    //
+    // Test 'Increase Volume' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdIncreaseVolume ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleIncreaseVolume );
+        
+    //
+    // Test 'Natural Aspect Ratio' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdNaturalAspectRatio ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iDisplayHandler->iCommand == EPbCmdNaturalAspectRatio );
+    
+    //
+    // Test 'Zoom Aspect Ratio' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdZoomAspectRatio ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iDisplayHandler->iCommand == EPbCmdZoomAspectRatio );
+    
+    //
+    // Test 'Stretch Aspect Ratio' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iDisplayHandler->iCommand == EPbCmdStretchAspectRatio );
     
-    QVERIFY( state == EPbStatePlaying );        
+    //
+    // Test 'Mute' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdMute ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdMuteVolume );
+    
+    //
+    // Test 'Un-mute' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdUnMute ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdUnMuteVolume );
+    
+    //
+    // Test 'Short Press Backward' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdShortPressBackward ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == EPbPropertyPosition );
+    
+    //
+    // Test 'Reset Controls' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdResetControls ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdInitView );
+    
+    //
+    // Test 'Next List Item' command
+    //
+    mVideoViewWrapper->iPlaylistView = true;
+    mVideoViewWrapper->iFileDetails->mMultiItemPlaylist = true;    
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdNextListItem ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdNext );
+    
+    //
+    // Test 'Previous List Item' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPreviousListItem ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPrevious );
+    
+    //
+    // Test 'End Of Clip' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdEndOfClip ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdEndofClipReached );
+    
+    //
+    // Test 'Custom Pause' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdCustomPause ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdCustomPause );
+    
+    //
+    // Test 'Custom Play' command
+    //
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdCustomPlay ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdCustomPlay );
+    
+    //
+    // Test 'RealOne Bitmap Timeout' command
+    //
+    mVideoViewWrapper->iMediaRequestStatus = MediaDelivered;
+    TRAP( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdRealOneBitmapTimeout ) );    
+    QVERIFY( errHdlCmd == KErrNone );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
     
     cleanup();
-
 }
 
-
-
 void TestMPXVideoViewWrapper::testHandlePluginError()
 {
     init();
@@ -171,10 +323,8 @@
     QVERIFY( mVideoViewWrapper->iView->mCurrentError == KErrNotSupported );
     
     cleanup();
-
 }
 
-
 void TestMPXVideoViewWrapper::testHandlePlaybackMessage()
 {
     init();
@@ -198,8 +348,6 @@
         message = NULL;
     }    
 
-    
-    
     //***************************
     // Test General Msg
     //***************************
@@ -217,8 +365,7 @@
         delete message;
         message = NULL;
     } 
-    
-      
+
     //***************************
     // Test Video Msg with err
     //***************************
@@ -234,276 +381,300 @@
     cleanup();
 }
 
+void TestMPXVideoViewWrapper::testSetProperty()
+{
+    init();
 
-void TestMPXVideoViewWrapper::testSetProperty()
+    TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL()) ;
+    QVERIFY( errReqMedia == KErrNone );
+
+    TMPXPlaybackProperty property = EPbPropertyMute;
+    TInt propertyValue = 1;
+
+    TRAPD( errSetProp, mVideoViewWrapper->SetPropertyL( property, propertyValue ) );
+    QVERIFY( errSetProp == KErrNone );
+
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == property );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iPropertyValue == propertyValue );
+
+    cleanup();
+}
+
+void TestMPXVideoViewWrapper::testHandleProperty()
 {
     init();
 
     TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
     QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errSetProp, mVideoViewWrapper->SetPropertyL( EPbPropertyMute, 1 ) );   // 0=>noraml  1=>muted
-    QVERIFY( errSetProp == KErrNone );
-    
-    QVERIFY( ! mVideoViewWrapper->iFileDetails->mAudioEnabled );
-            
+
+    //
+    // Duration
+    //
+    int value = 5000;
+    TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, value, KErrNone ) );   
+    QVERIFY( errHdlProp == KErrNone );
+
+    QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetDuration );
+    QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+    //
+    // Position
+    //
+    value = 500;
+
+    TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyPosition, value, KErrNone ) );   
+    QVERIFY( errHdlProp == KErrNone );
+
+    QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetPosition );
+    QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+    //
+    // Volume
+    //
+    value = 10;
+
+    TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyVolume, value, KErrNone ) );   
+    QVERIFY( errHdlProp == KErrNone );
+
+    QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetVolume );
+    QVERIFY( mVideoViewWrapper->iControlsController->mValue == value );
+
+    //
+    // Mute
+    //
+    value = 1;
+
+    TRAP(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyMute, value, KErrNone ) );   
+    QVERIFY( errHdlProp == KErrNone );
+
+    QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetVolume );
+    QVERIFY( mVideoViewWrapper->iControlsController->mValue == 0 );
+
     cleanup();
 }
 
-
-void TestMPXVideoViewWrapper::testHandleProperty()
-{
-    init();
-    
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
-    QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errHdlProp, mVideoViewWrapper->HandlePropertyL( EPbPropertyDuration, 5000, KErrNone ));   
-    QVERIFY( errHdlProp == KErrNone );
-    
-    QVERIFY( mVideoViewWrapper->iFileDetails->mDuration == 5000 );
-            
-    cleanup();
-}
-
-
 void TestMPXVideoViewWrapper::testRetrieveFileNameAndMode()
 {
     init();
-    
+
     mVideoViewWrapper->iFileDetails->clearFileDetails();  
-    
+
     CMPXCommand* cmd = NULL;
     
     TRAP_IGNORE( cmd = CMPXCommand::NewL() );
 
-    TRAPD(errRetFileName, mVideoViewWrapper->RetrieveFileNameAndModeL( cmd ) );
-    QVERIFY( errRetFileName == KErrNone );
-    
-    int state;
-    TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL());
-    QVERIFY( errState == KErrNone );    
-    
-    QVERIFY( state == EPbStateInitialised );
-    
-    QCOMPARE( mVideoViewWrapper->iFileDetails->mClipName, QString("testClip.3gp"));
-    
-    delete cmd;
-    cmd = NULL;
-    
+    if ( cmd )
+    {
+        TRAPD(errRetFileName, mVideoViewWrapper->RetrieveFileNameAndModeL( cmd ) );
+        QVERIFY( errRetFileName == KErrNone );
+        
+        QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdInitView );    
+        
+        QCOMPARE( mVideoViewWrapper->iFileDetails->mClipName, QString("testClip.3gp"));
+
+        delete cmd;
+        cmd = NULL;
+    }
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testActivateClosePlayerActiveObject()
 {
     init();
-        
+
     mVideoViewWrapper->ActivateClosePlayerActiveObject();
-        
+
     QVERIFY( mVideoViewWrapper->iCloseAO->IsActive() );
-    
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testDoClosePlayer()
 {
     init();
-        
+
     TRAPD(err, mVideoViewWrapper->DoClosePlayerL());
     QVERIFY( err == KErrNone );  
-        
+
     QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
-    
+
     cleanup();
 }
 
-
-void TestMPXVideoViewWrapper::testIssuePlayCommand()
-{
-    init();
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
-    QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
-    QVERIFY( errIssuePlay == KErrNone );
-    
-    
-    int state;
-    TRAPD(errState, state = mVideoViewWrapper->iPlaybackUtility->StateL());
-    QVERIFY( errState == KErrNone );    
-    
-    QVERIFY( state == EPbStatePlaying );    
-    
-    cleanup();
-}
-
-
 void TestMPXVideoViewWrapper::testSetAspectRatio()
 {
     init();
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+    TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
     QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdStretchAspectRatio));
+
+    TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdStretchAspectRatio ) );
     QVERIFY( errHdlCmd == KErrNone );
-            
-    QVERIFY( mVideoViewWrapper->iDisplayHandler->iCurrentIndexForAspectRatio == 1 );
-        
+
+    QVERIFY( mVideoViewWrapper->iDisplayHandler->iAspectRatio == EMMFStretch );
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testIsAppInFront()
 {
     init();
-    
+
     TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
     QVERIFY( errReqMedia == KErrNone );
-    
+
     bool front = false;
-    TRAPD(errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL());
-    
+    TRAPD( errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL() );
+
     QVERIFY( errIsAppInFrnt == KErrNone );
-        
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testClosePlaybackView()
 {
     init();
-        
+
     TRAPD(err, mVideoViewWrapper->ClosePlaybackViewL());
     QVERIFY( err == KErrNone );
-        
+
     QVERIFY( ! mVideoViewWrapper->iView->mViewActive );
-    
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testHandleVolumeCmd()
 {
     init();
-        
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+
+    TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
     QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
+
+    TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
     QVERIFY( errIssuePlay == KErrNone );
-    
-    TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdDecreaseVolume));
+
+    TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdDecreaseVolume ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleDecreaseVolume );
     QVERIFY( errHdlCmd == KErrNone );    
-        
+
     QVERIFY( mVideoViewWrapper->iFileDetails->mAudioEnabled );
-    
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testHandleShortPressBackward()
 {
     init();
-        
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+
+    TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
     QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
+
+    TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
     QVERIFY( errIssuePlay == KErrNone );
-    
-    TRAPD(errHdlCmd, mVideoViewWrapper->HandleCommandL(EMPXPbvCmdShortPressBackward));
+
+    TRAPD( errHdlCmd, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdShortPressBackward ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iProperty == EPbPropertyPosition );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iPropertyValue == 0 );
+
     QVERIFY( errHdlCmd == KErrNone );  
-            
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testIssueVideoAppForegroundCmd()
 {
     init();
-        
-    TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
+
+    TRAPD( errReqMedia, mVideoViewWrapper->RequestMediaL() );
     QVERIFY( errReqMedia == KErrNone );
-    
-    TRAPD(errIssuePlay, mVideoViewWrapper->IssuePlayCommandL());
+
+    TRAPD( errIssuePlay, mVideoViewWrapper->HandleCommandL( EMPXPbvCmdPlay ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+
     QVERIFY( errIssuePlay == KErrNone );
-    
-    TRAPD(errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue ));
+
+    //
+    // test foreground
+    //
+    TRAPD( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleForeground );
     QVERIFY( errIssueVidAppFGCmd == KErrNone );
-                    
+
+    //
+    // test background
+    //
+    TRAP( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( EFalse ) );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleBackground );
+    QVERIFY( errIssueVidAppFGCmd == KErrNone );
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testCreateControls()
 {
     init();
-        
+
     TRAPD(err, mVideoViewWrapper->CreateControlsL());
     QVERIFY( err == KErrNone );
-    
+
     QVERIFY( mVideoViewWrapper->iControlsController );
-                        
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testIsMultiItemPlaylist()
 {
     init();
-        
+
     TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
     QVERIFY( errReqMedia == KErrNone );
-    
+
     QVERIFY( ! mVideoViewWrapper->IsMultiItemPlaylist() );
-                        
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testUpdateVideoRect()
 {
     init();
-        
+
     TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
     QVERIFY( errReqMedia == KErrNone );
-        
-    mVideoViewWrapper->UpdateVideoRect(0,0,50,50,false);
-        
-    float brY = 50;
-    
-    QCOMPARE(mVideoViewWrapper->iDisplayHandler->iBrYDiff, brY);
-                        
+
+    TRect rect( 0, 0, 50, 50 );
+
+    mVideoViewWrapper->UpdateVideoRect( 
+        rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY, false );       
+
+    QVERIFY( rect == mVideoViewWrapper->iDisplayHandler->iRect );
+
     cleanup();
 }
 
 void TestMPXVideoViewWrapper::testUpdateVideoRectDone()
 {
     init();
-        
+
     TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
     QVERIFY( errReqMedia == KErrNone );
-        
+
     mVideoViewWrapper->UpdateVideoRectDone();
-                                    
+
     cleanup();
 }
 
-
-
 void TestMPXVideoViewWrapper::testHandleBufferingState()
 {
     init();
-        
+
     TRAPD(err, mVideoViewWrapper->HandleBufferingStateL());
     QVERIFY( err == KErrNone );
-                        
+
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testHandleVideoPlaybackMessage()
 {
     init();
@@ -529,27 +700,11 @@
     cleanup();
 }
 
-
-
-
-void TestMPXVideoViewWrapper::testCreateGeneralPlaybackCommand()
-{
-    init();
-
-    TRAPD(err, mVideoViewWrapper->CreateGeneralPlaybackCommandL( EPbCmdDecreaseVolume ));  
-    QVERIFY( err == KErrNone );
-    
-    QVERIFY( ! mVideoViewWrapper->iFileDetails->mAudioEnabled );         
-                        
-    cleanup();
-}
-
-
 void TestMPXVideoViewWrapper::testHandlePlaybackCommandComplete()
 {
     init();
 
-	  CMPXCommand* cmd = NULL;
+    CMPXCommand* cmd = NULL;
 	  
     TRAP_IGNORE( cmd = CMPXCommand::NewL() );
     
@@ -563,13 +718,15 @@
     cleanup();
 }
 
-
 void TestMPXVideoViewWrapper::testHandleMedia()
 {
     init();
         
     CMPXMedia* media = NULL;
-    
+
+    //
+    // Error case
+    //
     TRAP_IGNORE(
         RArray<TInt> suppIds;
         CleanupClosePushL( suppIds );            
@@ -579,27 +736,92 @@
         media = CMPXMedia::NewL( suppIds.Array() );
         CleanupStack::PopAndDestroy( &suppIds );
     
-        media->SetTObjectValueL<TInt>( TMPXAttribute( KMPXMediaVideoError ), 
-                                       KErrCancel );
+        media->SetTObjectValueL<TInt>( TMPXAttribute( KMPXMediaVideoError ), KErrCancel );
     );
     
-    TRAPD(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+    TRAPD( err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
     QVERIFY( err == KErrNone );
     
     QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrCancel );
+    QVERIFY( ! mVideoViewWrapper->iControlsController->mFileDetailsAdded );
+    QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaNotRequested );
 
     if ( media )
     {    
         delete media;
         media = NULL;      
     }
-  
-                            
+    
+    //
+    // working case - RN logo is not visible
+    //
+    TRAP_IGNORE(
+        RArray<TInt> suppIds;
+        CleanupClosePushL( suppIds );            
+        suppIds.AppendL( KMPXMediaIdGeneral );
+        suppIds.AppendL( KMPXMediaIdVideo );
+    
+        media = CMPXMedia::NewL( suppIds.Array() );
+        CleanupStack::PopAndDestroy( &suppIds );
+    );
+
+    mVideoViewWrapper->iView->mCurrentError = KErrNone;
+    mVideoViewWrapper->iFileDetails->mVideoEnabled = true;
+    mVideoViewWrapper->iDisplayHandler->SetAspectRatioL( EPbCmdNaturalAspectRatio );
+    mVideoViewWrapper->iControlsController->mRNLogoVisible = false;
+
+    TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+
+    QVERIFY( err == KErrNone );
+    QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNone );
+    QVERIFY( mVideoViewWrapper->iControlsController->mFileDetailsAdded );
+    QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetAspectRatio );
+    QVERIFY( mVideoViewWrapper->iControlsController->mValue == EMMFNatural );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPlay );
+    QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered );
+
+    if ( media )
+    {    
+        delete media;
+        media = NULL;      
+    }
+
+    //
+    // working case - RN logo is visible
+    //
+    TRAP_IGNORE(
+        RArray<TInt> suppIds;
+        CleanupClosePushL( suppIds );            
+        suppIds.AppendL( KMPXMediaIdGeneral );
+        suppIds.AppendL( KMPXMediaIdVideo );
+    
+        media = CMPXMedia::NewL( suppIds.Array() );
+        CleanupStack::PopAndDestroy( &suppIds );
+    );
+
+    mVideoViewWrapper->iFileDetails->mVideoEnabled = false;
+    mVideoViewWrapper->iPlaybackUtility->iCommand = EPbCmdPause;
+    mVideoViewWrapper->iControlsController->mFileDetailsAdded = false;
+    mVideoViewWrapper->iDisplayHandler->SetAspectRatioL( EPbCmdZoomAspectRatio );
+    mVideoViewWrapper->iControlsController->mRNLogoVisible = true;
+
+    TRAP(err, mVideoViewWrapper->HandleMediaL( *media, KErrNone ) );
+
+    QVERIFY( err == KErrNone );
+    QVERIFY( ! mVideoViewWrapper->iControlsController->mFileDetailsAdded );
+    QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EMPXControlCmdSetAspectRatio );
+    QVERIFY( mVideoViewWrapper->iControlsController->mValue == EMMFNatural );
+    QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdPause );
+    QCOMPARE( mVideoViewWrapper->iView->mCurrentError, KErrNone );
+    QVERIFY( mVideoViewWrapper->iMediaRequestStatus == MediaDelivered );
+
+    if ( media )
+    {    
+        delete media;
+        media = NULL;      
+    }
+
     cleanup();
 }
 
-
 // End of file
-    
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/hbvideobaseplaybackview.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  3 %
+// Version : %version:  5 %
 
 
 
@@ -76,6 +76,8 @@
         
         virtual void doClosePlayer();
 
+        void handleStoppedState();
+
     signals:
         void tappedOnScreen();
 
@@ -85,6 +87,7 @@
     public:
         int mCurrentError;   // default = KErrNone 
         bool mViewActive;
+        bool mSyncClose;
         
         
     public:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutility.h	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of interface for playbackutility
+*
+*/
+
+// Version : %version:  2 %
+
+#ifndef CMPXPLAYBACKUTILITY_H
+#define CMPXPLAYBACKUTILITY_H
+
+#include <e32base.h>
+#include <mpxcommand.h>
+#include <mpxattributespecs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxplaybackframeworkdefs.h>
+
+class TMPXAttribute;
+class MMPXPlaybackObserver;
+class CMPXCollectionPlaylist;
+class MMPXPlaybackCallback;
+class CMPXPlaybackUtility;
+
+class MMPXSource
+{
+    public:
+        virtual CMPXCollectionPlaylist* PlaylistL() = 0;
+
+        virtual void MediaL( const TArray<TMPXAttribute>& aAttrs,
+                             MMPXPlaybackCallback& aCallback,
+                             CMPXAttributeSpecs* aSpecs ) = 0;
+
+};
+
+class MMPXPlaybackUtility : public CBase
+{
+    public:
+        static MMPXPlaybackUtility* UtilityL( const TMPXCategory aCategory,
+                                              const TUid& aModeId = KPbModeDefault );
+
+        virtual TMPXPlaybackState StateL() const = 0;
+        virtual void AddObserverL( MMPXPlaybackObserver& aObs ) = 0;
+        virtual void CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL ) = 0;
+        virtual void CommandL( TMPXPlaybackCommand aCmd ) = 0;
+        virtual MMPXSource* Source() = 0;
+        virtual void PropertyL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty ) = 0;
+        virtual void RemoveObserverL( MMPXPlaybackObserver& aObs ) = 0;
+        virtual void Close() = 0;
+        virtual void SetPrimaryClientL() = 0;
+        virtual void SetL( TMPXPlaybackProperty aProperty,TInt aValue ) = 0;
+
+    public:
+        TMPXPlaybackState iState;
+        TMPXPlaybackProperty iProperty;
+        TInt iPropertyValue;
+        TInt iCommand;
+};
+
+class CMPXPlaybackUtility : public MMPXPlaybackUtility,
+                            public MMPXSource
+{
+    public:
+
+        static CMPXPlaybackUtility* NewL();							
+
+        ~CMPXPlaybackUtility();
+
+    private:
+
+        CMPXPlaybackUtility();
+
+        void ConstructL();
+
+        void AddObserverL( MMPXPlaybackObserver& aObs );
+
+        void RemoveObserverL( MMPXPlaybackObserver& aObs );
+
+        void Close();
+
+        void CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback );
+        void CommandL( TMPXPlaybackCommand aCmd );
+
+        TMPXPlaybackState StateL() const;
+
+        MMPXSource* Source();
+
+        void SetL( TMPXPlaybackProperty aProperty,TInt aValue );
+
+        void PropertyL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty );
+
+        CMPXCollectionPlaylist* PlaylistL();
+
+        void MediaL( const TArray<TMPXAttribute>& aAttrs,
+                     MMPXPlaybackCallback& aCallback,
+                     CMPXAttributeSpecs* aSpecs );
+
+        void SetPrimaryClientL();
+};
+
+#endif // CMPXPLAYBACKUTILITY_H
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h	Fri May 14 15:14:51 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,656 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Implementation of interface for playbackutility
-*
-*/
-
-// Version : %version:  3 %
-
-#ifndef CMPXPLAYBACKUTILITY_H
-#define CMPXPLAYBACKUTILITY_H
-
-#include <e32base.h>
-#include <f32file.h>
-#include <mpxplaybackobserver.h>
-#include <mpxplaybackmessage.h>
-#include <mpxsession.h>
-#include <mpxmessageobserver.h>
-#include "mpxplaybackutility.h"
-
-class CMPXMessageMonitor;
-class CMPXTaskQueue;
-
-NONSHARABLE_STRUCT( TMPXPlaybackUtilityStruct )
-    {
-    // Default mode playback utility
-    MMPXPlaybackUtility* iDefaultPlaybackUtility;
-    };
-
-/**
-*  Implementation of playback utility interface
-*  this interface:
-*/
-NONSHARABLE_CLASS(CMPXPlaybackUtility) : public MMPXPlaybackUtility,
-                                         public MMPXSource,
-                                         public MMPXPlayerManager
-    {
-public:
-    /**
-    * Two-phased constructor
-    *
-    * @param aModeId playback mode id
-    * @param aObs observer
-	* @param aCategory category of client / engine
-    * @return object of constructed
-    */
-    static CMPXPlaybackUtility* NewL(const TUid& aModeId,
-                                     MMPXPlaybackObserver* aObs,
-                                     const TMPXCategory aCategory);
-
-    /**
-    * Gets the interface for the client, or creates a new one.
-    * This interface could be a singleton
-    */
-    static MMPXPlaybackUtility* UtilityL( const TUid& aModeId,
-                                        const TMPXCategory aCategory);										
-
-private:
-    /**
-    * Destructor
-    */
-    ~CMPXPlaybackUtility();
-
-    /**
-    * C++ constructor
-    */
-    CMPXPlaybackUtility();
-
-    /**
-    * Second phase constructor
-    *
-    * @param aModeId playback mode id
-    * @param aObs observer
-	* @param aCategory category of client / engine
-    */
-    void ConstructL(const TUid& aModeId, MMPXPlaybackObserver* aObs, const TMPXCategory aCategory);
-    /**
-    * Second phase constructor
-    *
-    * @param aObs observer
-    */
-    void ConstructL(MMPXPlaybackObserver* aObs);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Add a Observer. Clients only receive events from the engine corresponding
-    *  to the specific mode the interface was created in
-    *
-    *  @param aObs, observer to be added
-    */
-    void AddObserverL(MMPXPlaybackObserver& aObs);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Remove a observer.
-    *
-    *  @param aObs, observer to be removed
-    */
-    void RemoveObserverL(MMPXPlaybackObserver& aObs);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Returns PIds of clients that are using the engine in the mode this
-    *  interface was created in. For example, if a client was interested in all
-    *  the clients' pids with an active engine, they would:
-    *
-    *       MMPXPlaybackUtility* m=MMPXPlaybackUtility::NewL(EActivePlayer);
-    *       RArray<TProcessId> pids;
-    *       m->GetClients(pids);
-    *       .........
-    *       pids->Close();
-    *       m->Close();
-    *
-    *  @param aClients Array of Pids returned.
-    */
-    void GetClientsL(RArray<TProcessId>& aClients);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Initializes a track given by aCollectionPath
-    *
-    *  @param aCollectionPath collection path
-    *  @param aPlay Whether to initialize for playback, or
-    *               else just to setup the engine first
-    */
-    virtual void InitL(const CMPXCollectionPlaylist& aPlaylist,
-                       TBool aPlay=ETrue);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Inititialises with a single item, may not be part of any collection
-    *
-    *  @param aUri URI of the item
-    *  @param aType the mime type of the item
-    */
-    void InitL(const TDesC& aUri,const TDesC8* aType=NULL);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Inititialises with a single item, may not be part of any collection
-    *  Before this function can be called, the file server session which owns
-    *  this file handle must first be marked as shareable by calling
-    *  RFs::ShareProtected().
-    *
-    *  @param aFile file handle
-    */
-    void InitL(RFile& aShareableFile);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Frees up client side resources only; a player is freed when there are no
-    *  clients using it, and all resources are freed when the last client closed
-    */
-    void Close();
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Stops any async operations that are currently under way
-    */
-    void CancelRequest();
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Issue player commands, with optional data. ECommandReceived and
-    *  ECommandComplete events should follow
-    *
-    *  @param aCmd the command
-    *  @param aData optional data
-    */
-    void CommandL(TMPXPlaybackCommand aCmd,TInt aData=0);
-
-    /**
-     *  From MMPXPlaybackUtility
-     *  Send a command to the playback server
-     *
-     *  @param aCmd, reference to command object
-     *  @param aCallback, call back when command exection completed.
-     *                    Asynchronously command only
-     */
-    void CommandL(CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback=NULL);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Current state of player
-    *  @return current state
-    */
-    TMPXPlaybackState StateL() const;
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Current source being played, NULL if none was supplied
-    *
-    *  @return source object
-    */
-    MMPXSource* Source();
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Player manager
-    *
-    *  @return reference to player manager
-    */
-    MMPXPlayerManager& PlayerManager();
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Set playback property, EPropertyChanged event when complete
-    *
-    *  @param aProperty the property to be set
-    *  @param aValue the the value of the property
-    */
-    void SetL(TMPXPlaybackProperty aProperty,TInt aValue);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Get value of a playback property, Asyc
-    *
-    *  @param aCallback playback callback
-    *  @param aProperty the property
-    */
-    void ValueL(MMPXPlaybackCallback& aCallback,TMPXPlaybackProperty aProperty);
-
-    /**
-     *  Get value of a playback property, Asyc
-     *  Result will be called back in HandleProperty
-     *
-     *  @param aCallback playback callback
-     *  @param aProperty the property
-     */
-    void PropertyL(MMPXPlaybackCallback& aCallback,
-                   TMPXPlaybackProperty aProperty);
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Return a list of mime types supported by playback framework
-    *
-    *  @return an array of mime types
-    */
-    virtual CDesCArray* SupportedMimeTypes();
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Return a list of file extensions supported by playback framework
-    *
-    *  @return an array of extensions
-    */
-    virtual CDesCArray* SupportedExtensions();
-
-    /**
-    *  From MMPXPlaybackUtility
-    *  Return a list of schemas supported by playback framework
-    *
-    *  @return an array of schemas
-    */
-    virtual CDesCArray* SupportedSchemas();
-
-    /**
-    *  Sets the priority of the playback utility
-    *
-    *  @param aPriority Priority to set
-    */
-    virtual void SetPriority( TInt aPriority );
-
-    /**
-    * Adds a message subscription for this client.
-    * @param aSubscription subscription to be added
-    */
-    void AddSubscriptionL(const CMPXSubscription& aSubscription);
-
-    /**
-    * Removes a message subscription for this client.
-    * @param aSubscription subscription to be removed.
-    */
-    void RemoveSubscriptionL(const CMPXSubscription& aSubscription);
-
-    /**
-    * Removes all message subscriptions for this client.
-    */
-    void ClearSubscriptionsL();
-
-    /**
-    *  From MMPXPlayerManager
-    *  Typically, a client will obtain the list of all the (non-duplicated)
-    *  player 'types' in the system from GetPlayerTypesL and present localized
-    *  type names (e.g. "Local","Home network", if possible, else if
-    *  non-standard type,should use PlayerTypeDisplayNameL to get text from
-    *  player).
-    *
-    *  User should be given opportunity to choose IF there is more than one
-    *  type available, or if there is one type but more than one sub players,
-    *  the user could be presented with the sub player list.
-    *
-    *  @param aTypes the list of player types
-    */
-    void GetPlayerTypesL(RArray<TMPXPlaybackPlayerType>& aTypes);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Returns display name for custom types; standard types should be
-    *  recognized by client and localized - calling this method would then not
-    *  be required
-    *
-    *  @param aType playback type
-    */
-    HBufC* PlayerTypeDisplayNameL(TMPXPlaybackPlayerType aType);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Get the list of UIDs of all players
-    *
-    *  @param aPlayers All the players' uids in the system
-    */
-    void GetPlayerListL(RArray<TUid>& aPlayers);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Get the list of UIDs of players with the specific type
-    *
-    *  @param aPlayers All the players' uids with the same type
-    *  @param aType the type of players
-    */
-    void GetPlayerListL(RArray<TUid>& aPlayers,TMPXPlaybackPlayerType aType);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Get the list of sub player names, Async
-    *
-    *  @param aCallback sub players returned in call back interface
-    *  @param aPlayer UID of the player
-    */
-    void SubPlayerNamesL(MMPXPlaybackCallback& aCallback,TUid aPlayer);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Client selects all players with the type aType, the specific player used
-    *  then being resolved on the basis of the content.
-    *
-    *  @param aType the type of player
-    */
-    void SelectPlayersL(TMPXPlaybackPlayerType aType);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Client selects specific player aPlayer and sub player aSubPlayerIndex
-    *  from array returned by SubPlayerNamesL
-    *
-    *  @param aPlayer the UID of player
-    *  @param aSubPlayerIndex the index of the sub player
-    */
-    void SelectSubPlayerL(TUid aPlayer,TInt aSubPlayerIndex);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Client selects a specific player
-    *
-    *  @param aPlayer the UID of the player
-    */
-    void SelectPlayerL(TUid aPlayer);
-
-    /**
-    *  From MMPXPlayerManager
-    *  Clears all selection criteria. Essentially the same as
-    *  SelectPlayersL(EPbLocal).
-    */
-    void ClearSelectPlayersL();
-
-    /**
-    *  From MMPXPlayerManager
-    *  Retreives the current selection: KNullUid and KErrNotFound are possible
-    *  return values for aPlayer and aSubPlayerIndex respectively if none are
-    *  explicitly selected
-    *
-    *  @param aType player type
-    *  @param aPlayer the UID of player
-    *  @param aSubPlayerIndex index of the subplayer
-    *  @param aSubPlayerName friendly name of the subplayer
-    *         Notes: Client owns the returned aSubPlayerName object.
-    */
-    void GetSelectionL(TMPXPlaybackPlayerType& aType,
-                       TUid& aPlayer,
-                       TInt& aSubPlayerIndex,
-                       HBufC*& aSubPlayerName);
-
-    /**
-    *  From MMPXPlayerManager
-    *  The current player, may change with each item, NULL if none found
-    *
-    *  @return object of current player
-    */
-    MMPXPlayer* CurrentPlayer();
-
-    /**
-    *  From MMPXPlayer
-    *  The 'type' of the player. Built-in types are EPbLocal and EPbRemote, but
-    *  the plug-ins could extend this if they desire to be a different type
-    *  which can be selected by the user
-    *
-    *  @return player type
-    */
-    TMPXPlaybackPlayerType TypeL();
-
-    /**
-    *  From MMPXPlayer
-    *  If TypeL returns a value that is not known to the UI (and therefore
-    *  can't localize it),then TypeNameL can be used for unlocalized display
-    *  purposes.
-    *
-    *  @return player name.
-    */
-    HBufC* TypeNameL();
-
-    /**
-    *  From MMPXPlayer
-    *  If the player supports other 'players', else array count == 0.
-    *
-    *  @param aCallback sub players returned in the callback
-    */
-    void SubPlayerNamesL(MMPXPlaybackCallback& aCallback);
-
-    /**
-    *  From MMPXPlayer
-    *  Selected sub player index, corresponding to sub player names array.
-    *
-    *  @return sub player index. KErrNotFound if none
-    */
-    TInt SubPlayerL() const;
-
-    /**
-    *  From MMPXPlayer
-    *  The UID identifying this player
-    *
-    *  @return UID of the player
-    */
-    TUid UidL() const;
-
-    /**
-    *  From MMPXSource
-    *  Path to the collection, or NULL if not in any collection
-    *  Ownership transferred
-    *
-    *  @return collection path
-    */
-    CMPXCollectionPlaylist* PlaylistL();
-
-    /**
-    *  From MMPXSource
-    *  File passed in, or NULL if none passed in
-    *
-    *  @return pointer to file handle
-    */
-    RFile* FileL();
-
-    /**
-    *  From MMPXSource
-    *  URI of current item
-    *
-    *  @return URI of the item
-    */
-    HBufC* UriL();
-
-    /**
-    *  From MMPXSource
-    *
-    *  DEPRECATED
-    *
-    *  Media request
-    *  HandleMediaL of the callback
-    *
-    *  @param aAttrs attributes requested
-    *  @param aCallback playback callback
-    */
-    void MediaL(const TArray<TMPXAttribute>& aAttrs,
-                MMPXPlaybackCallback& aCallback);
-
-    /**
-    *  From MMPXSource
-    *  Media request
-    *  HandleMediaL of the callback
-    *
-    *  @param aAttrs attributes requested
-    *  @param aCallback playback callback
-    *  @param aSpecs, specifications for attributes
-    */
-    void MediaL(const TArray<TMPXAttribute>& aAttrs,
-                MMPXPlaybackCallback& aCallback,
-                CMPXAttributeSpecs* aSpecs);
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-    /**
-    *  From MMPXSource
-    *  File passed in, or NULL if none passed in
-    *
-    *  @return pointer to file handle
-    */
-    RFile64* File64L();
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
-    /**
-    * From CActive
-    * Handles an active object's request completion event
-    */
-    void RunL();
-
-    /**
-    * From CActive
-    * Implements cancellation of an outstanding request.
-    */
-    void DoCancel();
-
-    /**
-    * From CActive
-    * Handles a leave occurring in the request completion event handler RunL()
-    *
-    * @param aError error code
-    */
-    TInt RunError(TInt aError);
-
-    /**
-     * From MMPXMessageObserver
-     * Message received
-     * @param aMsgData message data
-     * @param aError error code
-     */
-    void MessageReceived(TInt aMsgData, TInt aError);
-    
-    /**
-    *  Inititialises for streaming with URI and Access Point
-    *
-    *  @since S60 9.2
-    *  @param aUri URI of the item
-    *  @param aType the mime type of the item
-    *  @param aAccessPoint the access point of the item
-    */
-    virtual void InitStreamingL(const TDesC& aUri, const TDesC8* aType, const TInt aAccessPoint);
-
-    /**
-    *  Inititialises for streaming with URI and Access Point, the file may not be part of any collection
-    *  Before this function can be called, the file server session which owns
-    *  this file handle must first be marked as shareable by calling
-    *  RFs::ShareProtected().
-    *
-    *  @since S60 9.2
-    *  @param aShareableFile shareable file handle
-    *  @param aAccessPoint the access point of the item
-    */
-    virtual void InitStreamingL(RFile& aShareableFile, const TInt aAccessPoint); 
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-    /** 
-    *  Inititialises with a single item, may not be part of any collection 
-    *  Before this function can be called, the file server session which owns 
-    *  this file handle must first be marked as shareable by calling 
-    *  RFs::ShareProtected(). 
-    * 
-    *  @since S60 9.2 
-    *  @param aShareableFile shareable RFile64 file handle 
-    */ 
-    virtual void Init64L(RFile64& aShareableFile);
-     
-    /** 
-     *  Inititialises for streaming with URI and Access Point, the file may not be part of any collection 
-     *  Before this function can be called, the file server session which owns 
-     *  this file handle must first be marked as shareable by calling 
-     *  RFs::ShareProtected(). 
-     * 
-     *  @since S60 9.2 
-     *  @param aShareableFile shareable RFile64 file handle 
-     *  @param aAccessPoint the access point of the item 
-     */ 
-    virtual void InitStreaming64L(RFile64& aShareableFile, const TInt aAccessPoint);
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-    
-private:
-
-
-    /**
-    * Helper to return a descriptor buffer
-    *
-    * @param aSize size of the buffer
-    */
-    HBufC* DesL(TInt aSize);
-
-    /**
-    *  Add a request
-    *
-    *  @param aFunction function code
-    *  @param aCallback callback
-    *  @param aParamData data
-    *  @param aBuf buffer data, ownership transferred
-    *  @param aPtr, pointer to a object
-    *  @param aAlivePtr1, object to keep alive for a task
-    *                     ownership transferred
-    *  @leave leave with system error code when failed
-    */
-    void AddRequestL(TMPXPlaybackServerOp aFunction,
-                     MMPXPlaybackCallback* aCallback=NULL,
-                     TInt aParamData=0,
-                     CBufBase* aBuf=NULL,
-                     TAny* aPtr=NULL,
-                     CBase* aAlivePtr=NULL);
-
-    /**
-    *  Send next request to server
-    */
-    void ExecuteNextRequest();
-
-    /**
-     *  Handle message from message queue
-     *  @param aMsgData message data
-     *  @param aError error code
-     */
-    void HandleMessageL(TInt aMsgData, TInt aError);
-
-    /**
-     * Handles error in RunL
-     *
-     * @param aError error code
-     */
-    void HandleRunErrorL(TInt aError);
-
-
-public:
-	
-	TMPXPlaybackState iState;
-
-    RArray<MMPXPlaybackObserver*> iObservers;
-    CMPXMessageMonitor* iMsgMonitor;
-    CMPXTaskQueue* iTaskQueue;
-    RMPXSession iPbs;
-    CBufBase* iBuffer;
-    TPckgBuf<TInt> iPropertyValuePckg;
-    TPckgBuf<TBool> iCompletePckg;
-    TPckgBuf<TInt> iResultSizePckg;
-    RFile iFile;
-    TBool iCallbackOngoing; // whether client is processing callback or not
-#ifdef _ENABLE_GUARD_TIMER
-    CPeriodic* iGuardTimer; // guard timer for async request
-#endif
-    CMPXMedia* iMediaOnError; // media object while handling error
-    TInt iRefCount;
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-    RFile64 iFile64;
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-    };
-
-#endif // CMPXPLAYBACKUTILITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrol.hrh	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  header file of CMPXVideoPlaybackControl
+*
+*/
+
+// Version : %version:  1 %
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
+#define MPXVIDEOPLAYBACKCONTROL_HRH_
+
+// DATA TYPES
+const TInt KMPXVideoPlaybackVolumeMax = 10;
+
+enum TMPFXVideoPlaybackControlProperties
+{
+    EMPXShownWhenInitializing = 0x1,
+    EMPXShownWhenBuffering = 0x2,
+    EMPXShownWhenPlaying =  0x4,
+    EMPXShownWhenPaused = 0x8,
+    EMPXShownWhenSeeking = 0x10,
+    EMPXAllProperties = 0xffffffff
+};
+
+enum TMPXVideoPlaybackControls
+{
+    EMPXStatusPane,
+    EMPXControlBar,
+
+    // Only for streaming case
+    // Can handle from NotInitilized state
+    //
+    EMPXBufferingAnimation,
+
+    //
+    // For details view and audio only view
+    //
+    EMPXFileDetailsWidget,
+
+    //
+    // For details view
+    //
+    EMPXDetailsViewPlaybackWindow,
+
+    //
+    //  Bitmaps
+    //
+    EMPXIndicatorBitmap,
+    EMPXRealLogoBitmap,
+
+    EMPXDownloadPausedIcon,
+
+    EMPXControlsCount  // has to be last
+};
+
+/** Command ID's. */
+enum TMPXVideoPlaybackControlCommandIds
+{
+    EMPXControlCmdPluginInitialized,
+    EMPXControlCmdTvOutConnected,
+    EMPXControlCmdTvOutDisconnected,
+    EMPXControlCmdSetAspectRatio,
+    EMPXControlCmdSetVolume,
+    EMPXControlCmdSetDuration,
+    EMPXControlCmdSetPosition,
+    EMPXControlCmdStateChanged,
+    EMPXControlCmdDownloadUpdated,
+    EMPXControlCmdSetDownloadSize,
+    EMPXControlCmdDownloadComplete,
+    EMPXControlCmdSetDownloadPaused,
+    EMPXControlCmdClearDownloadPaused,
+    EMPXControlCmdHandleBackgroundEvent,
+    EMPXControlCmdHandleForegroundEvent,
+    EMPXControlCmdHandleErrors,
+    EMPXControlCmdShowVolumeControls,
+    EMPXControlCmdSoftKeyPressed,
+    EMPXControlCmdFullScreenViewOpened,
+    EMPXControlCmdDetailsViewOpened,
+    EMPXControlCmdAudionOnlyViewOpened,
+    EMPXControlCmdRemoveRNLogo
+};
+
+enum TMPXVideoSeekingType
+{
+    EMpxVideoSeekingForward,
+    EMpxVideoSeekingBackward,
+    EMpxVideoSeekingStop
+};
+
+enum TMPXVideoControlType
+{
+    EMpxVideoPlaybackContainer,
+    EMpxVideoPlaybackControl
+};
+
+enum TMPXVideoUserInputType
+{
+    EMpxVideoKeyboard,
+    EMpxVideoTouch,
+    EMpxVideoMediaKeys,
+    EMpxVideoSpecialHWKeys,
+    EMpxVideoNone
+};
+
+#endif /*MPXVIDEOPLAYBACKCONTROL_HRH_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 6 %
+// Version : %version: 7 %
 
 
 
@@ -72,30 +72,17 @@
         //
         void updateVideoRectDone();
 
-    public:
-    	
-        /**
-        * Initialize controller
-        */
-        void initializeController();
-
-        /**
-        * Handle tvout connected/disconnected event
-        */
-        void handleTvOutEvent( bool connected, 
-		                           TMPXVideoPlaybackControlCommandIds event,
-		                           int value );
-
-    private slots:
-
-        void handleTappedOnScreen();
+        bool isRNLogoBitmapInControlList();
 
     public:
         HbVideoBasePlaybackView                   *mView;
         CMPXVideoViewWrapper                      *mViewWrapper;
         QMPXVideoPlaybackViewFileDetails          *mFileDetails;
+        TMPXVideoPlaybackControlCommandIds         mReceivedEvent;
 
-        bool                                       mViewTransitionIsGoingOn;
+        int   mValue;
+        bool  mRNLogoVisible;
+        bool  mFileDetailsAdded;
 };
 
 #endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackdisplayhandler.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  4 %
+// Version : %version:  6 %
 
 
 #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
@@ -26,11 +26,7 @@
 #include <mpxmessage2.h>
 #include <mmfscalingcustomcommandconstants.h>
 #include <mpxvideoplaybackdefs.h>
-#ifdef SYMBIAN_BUILD_GCE
 #include <mediaclientvideodisplay.h>
-#else
-#include <w32std.h>
-#endif
 
 
 // 
@@ -45,20 +41,7 @@
  *
  */
 class CMPXVideoPlaybackDisplayHandler : public CBase
-#ifndef SYMBIAN_BUILD_GCE
-                                      , public MDirectScreenAccess
-#endif
 {
-    //
-    //  To save user's preference for scaling type in video ratio + screen ratio
-    //
-    typedef struct
-    {
-        TReal32         videoRatio;
-        TReal32         screenRatio;
-        TMMFScalingType scalingType;
-    } TMPXAspectRatio ;
-    
     public:
 
         ~CMPXVideoPlaybackDisplayHandler();
@@ -80,7 +63,7 @@
         TInt SetDefaultAspectRatioL( QMPXVideoPlaybackViewFileDetails* aFileDetails, 
                                      TReal32 aDisplayAspectRatio );
 
-        void UpdateVideoRectL(  TRect aRect, TBool transitionEffect  );
+        void UpdateVideoRectL( TRect aRect, TBool transitionEffect );
 
     private:
 
@@ -88,86 +71,15 @@
                                          CMPXVideoViewWrapper* aViewWrapper );
 
         void ConstructL();
-        
-        void LoadAspectRatioL();
-        
-        void SaveAspectRatioL();
-
-        void SetVideoRectL( TRect aClipRect );
-
-        void CalculateVideoRectL();
-
-        static TInt UpdateVideoRectTimeOutL( TAny* aPtr );
-
-#ifdef SYMBIAN_BUILD_GCE
-
-    private:
-        void AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
-                                RWindowBase& aWindowBase,
-                                RWindow* aWin );
-
-        void SurfaceCreatedL( CMPXMessage* aMessage );
-        void SurfaceChangedL( CMPXMessage* aMessage );
-        void SurfaceRemoved();
-        TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd );
-
-#else
-
-    private:
-        //
-        //  MDirectScreenAccess Implementation
-        //
-        void AbortNow( RDirectScreenAccess::TTerminationReasons aReason );
-        void Restart( RDirectScreenAccess::TTerminationReasons aReason );
-
-        TInt CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd );
-        
-        void SetDisplayWindowL( RWsSession& aWs,
-                                CWsScreenDevice& aScreenDevice,
-                                RWindowBase& aWin,
-                                TRect aClipRect );
-        void RestartDsaL();
-        void CreateAbortDsaCmdL();
-
-#endif
 
     public:
         MMPXPlaybackUtility*                iPlaybackUtility;
-
-        RArray<TMPXAspectRatio>             iAspectRatioArray;
-        TInt                                iCurrentIndexForAspectRatio;
-        TReal                               iDisplayAspectRatio;
-
-        TRect                               iWindowRect;
-
-        TReal32                             iTlXDiff;
-        TReal32                             iTlYDiff;
-        TReal32                             iBrXDiff;
-        TReal32                             iBrYDiff;
-
-        TInt                                iTransitionEffectCnt;
-
-        CPeriodic*                          iResizingTimer;
         CMPXVideoViewWrapper*               iViewWrapper;
-
-#ifdef SYMBIAN_BUILD_GCE
         CMediaClientVideoDisplay*           iVideoDisplay;
 
-        RWindowBase*                        iWindowBase;
-        TBool                               iSurfaceCached;
-        TSurfaceId                          iSurfaceId;
-        TRect                               iCropRect;
-        TVideoAspectRatio                   iAspectRatio;
-        TReal32                             iScaleWidth;
-        TReal32                             iScaleHeight;
-        TInt                                iHorizontalPosition;
-        TInt                                iVerticalPosition;
-        TVideoRotation                      iRotation;
-        TAutoScaleType                      iAutoScale;   
-#else
-        CDirectScreenAccess*                iDirectScreenAccess;
-#endif
-
+        TRect                               iRect;
+        TInt                                iAspectRatio;
+        TInt                                iCommand;
 };
 
 #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/hbvideobaseplaybackview.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  5 %
+// Version : %version:  7 %
 
 
 
@@ -38,6 +38,7 @@
 {
     mCurrentError = KErrNone;
     mViewActive = false;
+    mSyncClose = false;
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -198,4 +199,13 @@
 {
 }
 
+// -------------------------------------------------------------------------------------------------
+//   HbVideoBasePlaybackView::handleStoppedState()
+// -------------------------------------------------------------------------------------------------
+//
+void HbVideoBasePlaybackView::handleStoppedState()
+{
+    
+}
+
 // EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutility.cpp	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Factory method to create playback utility object
+*
+*/
+
+#include <bamdesca.h>
+#include <s32mem.h>
+#include <e32math.h>
+#include <mpxcmn.h>
+#include <mpxplaybackobserver.h>
+#include <mpxcollectionplaylist.h>
+#include <mpxmedia.h>
+#include <mpxmessagemonitor.h>
+#include <mpxtaskqueue.h>
+#include <mpxuser.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxcollectionpath.h>
+#include <mpxvideoplaybackdefs.h>
+
+#include"mpxplaybackutility.h"
+
+
+// ============================== MEMBER FUNCTIONS =================================================
+	
+// -------------------------------------------------------------------------------------------------
+// Creates the playback utility object if not already created
+// -------------------------------------------------------------------------------------------------
+//
+MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory /*aCategory*/,
+                                                    const TUid& /*aModeId*/ )
+{
+    return CMPXPlaybackUtility::NewL();
+}
+
+// -------------------------------------------------------------------------------------------------
+// Two phases constructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXPlaybackUtility* CMPXPlaybackUtility::NewL()
+{
+    CMPXPlaybackUtility* p = new(ELeave)CMPXPlaybackUtility();
+    CleanupStack::PushL(p);
+    p->ConstructL();
+    CleanupStack::Pop(p);
+    return p;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+CMPXPlaybackUtility::~CMPXPlaybackUtility()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// C++ constructor
+// Create a unique name out of thread ID and this pointer: no other instance of
+// this object will have the same name; used to identify this object for
+// recieving messages
+// -------------------------------------------------------------------------------------------------
+//
+CMPXPlaybackUtility::CMPXPlaybackUtility()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// 2nd construtor
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::ConstructL()
+{
+    iState = EPbStateInitialised;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Add a observer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& /*aObs*/ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Remove a observer
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& /* aObs */ )
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Delete this
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::Close()
+{
+    delete this;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Issue player commands
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd )
+{
+    iCommand = aCmd;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Issue player commands
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /* aCallback */ )
+{
+    TInt cmdType = aCmd.ValueTObjectL<TInt>( KMPXCommandGeneralId );
+
+    if ( cmdType == KMPXCommandIdPlaybackGeneral )
+    {
+        iCommand = aCmd.ValueTObjectL<TInt>( KMPXCommandPlaybackGeneralType );
+    }
+    else
+    {
+        iCommand = aCmd.ValueTObjectL<TInt>( KMPXMediaVideoPlaybackCommand );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// Current state of player
+// -------------------------------------------------------------------------------------------------
+//
+TMPXPlaybackState CMPXPlaybackUtility::StateL() const
+{
+    return iState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Determine whether there is a song by the state of the engine: if there is,
+// its OK to return MMPXMedia, else NULL is returned
+// -------------------------------------------------------------------------------------------------
+//
+MMPXSource* CMPXPlaybackUtility::Source()
+{
+    return NULL;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Set playback property, EPropertyChanged event when complete
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty aProperty, TInt aValue )
+{
+    iProperty = aProperty;
+    iPropertyValue = aValue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Send property request
+// Result will be called back in HandleProperty
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::PropertyL(
+    MMPXPlaybackCallback& /* aCallback */,
+    TMPXPlaybackProperty /* aProperty */)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// Path to the collection
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
+{
+    CMPXCollectionPlaylist *p = NULL;
+
+    return p;
+}
+
+// -------------------------------------------------------------------------------------------------
+// Request for media properties.
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::MediaL(
+    const TArray<TMPXAttribute>& /* aAttrs */,
+    MMPXPlaybackCallback& /* aCallback */,
+    CMPXAttributeSpecs* /* aSpecs */)
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// set primary client
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXPlaybackUtility::SetPrimaryClientL()
+{
+}
+
+// End of file
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp	Fri May 14 15:14:51 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,723 +0,0 @@
-/*
-* Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Playback Utility implementation
-*
-*/
-
-// Version : %version: 4 %
-
-#include <bamdesca.h>
-#include <s32mem.h>
-#include <e32math.h>
-#include <mpxcmn.h>
-#include <mpxplaybackobserver.h>
-#include <mpxcollectionplaylist.h>
-#include <mpxmedia.h>
-#include <mpxmessagemonitor.h>
-#include <mpxtaskqueue.h>
-#include <mpxuser.h>
-#include <mpxmessagegeneraldefs.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxcollectionpath.h>
-#include <mpxplaybackcommanddefs.h>
-#include <mpxsubscription.h>
-#include <mpxlog.h>
-
-#include "mpxplaybackutilityimpl.h"
-
-// ============================== MEMBER FUNCTIONS ============================
-
-// ---------------------------------------------------------------------------
-// Retrieves playback utility from TLS. Creates if it's not there.
-// ---------------------------------------------------------------------------
-//
-MMPXPlaybackUtility* CMPXPlaybackUtility::UtilityL(
-    const TUid& aModeId,
-    const TMPXCategory aCategory)
-    {
-    MMPXPlaybackUtility* utility( NULL );
-    
-    utility = CMPXPlaybackUtility::NewL( aModeId, NULL, aCategory );
-
-    return utility;
-    }
-
-// ----------------------------------------------------------------------------
-// Two phases constructor
-// ----------------------------------------------------------------------------
-//
-CMPXPlaybackUtility* CMPXPlaybackUtility::NewL(const TUid& aModeId,
-                                               MMPXPlaybackObserver* aObs,
-                                               const TMPXCategory aCategory)
-    {
-    CMPXPlaybackUtility* p=new(ELeave)CMPXPlaybackUtility();
-    CleanupStack::PushL(p);
-    p->ConstructL(aModeId,aObs,aCategory);
-    CleanupStack::Pop(p);
-    return p;
-    }
-
-// ----------------------------------------------------------------------------
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CMPXPlaybackUtility::~CMPXPlaybackUtility()
-    {
-    iObservers.Close();
-    }
-
-// ----------------------------------------------------------------------------
-// C++ constructor
-// Create a unique name out of thread ID and this pointer: no other instance of
-// this object will have the same name; used to identify this object for
-// recieving messages
-// ----------------------------------------------------------------------------
-//
-CMPXPlaybackUtility::CMPXPlaybackUtility()
-    : iCallbackOngoing(EFalse)
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// 2nd construtor
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ConstructL(const TUid& /* aModeId */,
-                                     MMPXPlaybackObserver* /* aObs */, 
-                                     const TMPXCategory /* aCategory */)
-    {
-    	iState = EPbStateInitialised;
-    }
-
-// ----------------------------------------------------------------------------
-// Add a observer
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddObserverL(MMPXPlaybackObserver& aObs)
-    {
-    iObservers.AppendL(&aObs);
-    }
-
-// ----------------------------------------------------------------------------
-// Remove a observer
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RemoveObserverL(MMPXPlaybackObserver& /* aObs */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Returns PIds of clients that are using the engine in the mode
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetClientsL(RArray<TProcessId>& /* aClients */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Initializes a track given by aIndex in path aCollectionPath
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitL(
-    const CMPXCollectionPlaylist& /* aPlaylist */,
-    TBool /*aPlay */ )
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a single song, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitL(const TDesC& /* aUri */, const TDesC8* /* aType */ )
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a single song, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitL(RFile& /* aShareableFile */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Inititialises with a URI
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitStreamingL(const TDesC& /* aUri */, const TDesC8* /* aType */, const TInt /* aAccessPoint */)
-{
-
-}
-
-
-// ----------------------------------------------------------------------------
-// Inititialises with a file, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitStreamingL(RFile& /* aShareableFile */, const TInt /* aAccessPoint */)
-{
-
-}
-
-// ----------------------------------------------------------------------------
-// Frees up client side resources only; a player is freed when there are no
-// clients using it, and all resources are freed when the last client closed
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::Close()
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Stops any async operations that are currently under way
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CancelRequest()
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Issue player commands, with optional data.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CommandL(TMPXPlaybackCommand /* aCmd */, TInt /* aData */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Issue player commands
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::CommandL(
-    CMPXCommand& aCmd,
-    MMPXPlaybackCallback* /* aCallback */)
-    {
-    TMPXPlaybackCommand cmdType = static_cast<TMPXPlaybackCommand>(
-                          aCmd.ValueTObjectL<TInt>(KMPXCommandPlaybackGeneralType));
-        
-    switch ( cmdType )
-        {
-        case EPbCmdPlay:
-            {
-            iState = EPbStatePlaying;
-            break;
-            }
-        case EPbCmdDecreaseVolume:
-            {
-            CMPXMessage* message = CMPXMessage::NewL();
-            message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged ); 
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, EPbPropertyVolume );
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );                      
-            iObservers[0]->HandlePlaybackMessage( message, KErrNone );            
-            }
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// Current state of player
-// ----------------------------------------------------------------------------
-//
-TMPXPlaybackState CMPXPlaybackUtility::StateL() const
-    {
-    return iState;
-    }
-
-// ----------------------------------------------------------------------------
-// Determine whether there is a song by the state of the engine: if there is,
-// its OK to return MMPXMedia, else NULL is returned
-// ----------------------------------------------------------------------------
-//
-MMPXSource* CMPXPlaybackUtility::Source()
-    {
-    return this;
-    }
-
-// ----------------------------------------------------------------------------
-// Get player manager
-// ----------------------------------------------------------------------------
-//
-MMPXPlayerManager& CMPXPlaybackUtility::PlayerManager()
-    {
-    return *this;
-    }
-
-// ----------------------------------------------------------------------------
-// Set playback property, EPropertyChanged event when complete
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SetL(TMPXPlaybackProperty aProperty,TInt /* aValue */ )
-    {
-        if ( aProperty == EPbPropertyMute )
-        {
-            CMPXMessage* message = CMPXMessage::NewL();
-            message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged ); 
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, 0 );
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 0 );                      
-            iObservers[0]->HandlePlaybackMessage( message, KErrNone );
-        } 
-        else if ( aProperty == EPbPropertyPosition )
-        {
-            CMPXMessage* message = CMPXMessage::NewL();
-            message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, TMPXPlaybackMessage::EPropertyChanged ); 
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralType, EPbPropertyPosition );
-            message->SetTObjectValueL<TInt>( KMPXMessageGeneralData, 50 );                      
-            iObservers[0]->HandlePlaybackMessage( message, KErrNone );            
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// Send property request
-// Result will be called back in HandleProperty
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ValueL(MMPXPlaybackCallback& /* aCallback */,
-                                 TMPXPlaybackProperty /* aProperty */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Send property request
-// Result will be called back in HandleProperty
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::PropertyL(
-    MMPXPlaybackCallback& /* aCallback */,
-    TMPXPlaybackProperty /* aProperty */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Return a list of mime types supported by playback framework
-// ----------------------------------------------------------------------------
-//
-CDesCArray* CMPXPlaybackUtility::SupportedMimeTypes()
-    {
-    CDesCArray* desArray = NULL;
-
-    return desArray;
-    }
-
-// ----------------------------------------------------------------------------
-// Return a list of mime types supported by playback framework
-// ----------------------------------------------------------------------------
-//
-CDesCArray* CMPXPlaybackUtility::SupportedExtensions()
-    {
-    CDesCArray* desArray = NULL;
-
-    return desArray;
-    }
-
-// ----------------------------------------------------------------------------
-// Return a list of mime types supported by playback framework
-// ----------------------------------------------------------------------------
-//
-CDesCArray* CMPXPlaybackUtility::SupportedSchemas()
-    {
-    CDesCArray* desArray = NULL;
-
-    return desArray;
-    }
-
-// ----------------------------------------------------------------------------
-// Sets the priority of the playback utility
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SetPriority( TInt /* aPriority */ )
-    {
-
-    }
-
-
-// ----------------------------------------------------------------------------
-// CMPXPlaybackUtility::AddSubscriptionL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddSubscriptionL(
-    const CMPXSubscription& /* aSubscription */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// CMPXPlaybackUtility::RemoveSubscriptionL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RemoveSubscriptionL(
-    const CMPXSubscription& /* aSubscription */ )
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// CMPXPlaybackUtility::ClearSubscriptionsL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ClearSubscriptionsL()
-    {
-
-    }
-// ----------------------------------------------------------------------------
-// Get a list of player types
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetPlayerTypesL(
-    RArray<TMPXPlaybackPlayerType>& /* aTypes */ )
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Returns display name for custom types
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::PlayerTypeDisplayNameL(TMPXPlaybackPlayerType /* aType */ )
-    {
-		HBufC* buf=NULL;
-		return buf;
-    }
-
-// ----------------------------------------------------------------------------
-// Get the list of UIDs of all players
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetPlayerListL(RArray<TUid>& /* aPlayers */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Get the list of UIDs of players with the specific type
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetPlayerListL(RArray<TUid>& /* aPlayers */,
-                                         TMPXPlaybackPlayerType /* aType */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Asynchronous method: when server completes message, RunL() will be called
-// and then the observer is notified of the results. Data required for the
-// results that is not supplied by the server is stored; data supplied by the
-// server is written back into packaged descriptors in this address space
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SubPlayerNamesL(MMPXPlaybackCallback& /* aCallback */,
-                                          TUid /* aPlayer */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Selects all players with the type
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SelectPlayersL(TMPXPlaybackPlayerType /* aType */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Selects a specific player
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SelectPlayerL(TUid /* aPlayer */ )
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Selects a specific player and sub player
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SelectSubPlayerL(TUid /* aPlayer */, TInt /* aSubPlayerIndex */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Clears all selection criteria.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ClearSelectPlayersL()
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Retreives the current selection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::GetSelectionL(TMPXPlaybackPlayerType& /* aType */,
-                                        TUid& /* aPlayer */,
-                                        TInt& /* aSubPlayerIndex */,
-                                        HBufC*& /* aSubPlayerName */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// The current player
-// ----------------------------------------------------------------------------
-//
-MMPXPlayer* CMPXPlaybackUtility::CurrentPlayer()
-    {
-    return NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// The 'type' of the player
-// ----------------------------------------------------------------------------
-//
-TMPXPlaybackPlayerType CMPXPlaybackUtility::TypeL()
-    {
-    MPX_FUNC_EX("CMPXPlaybackUtility::TypeL()");
-    return EPbLocal;
-    }
-
-// ----------------------------------------------------------------------------
-// The name of player type
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::TypeNameL()
-    {
-		HBufC* buf=NULL;
-		return buf;
-    }
-
-// ----------------------------------------------------------------------------
-// Get sub players
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::SubPlayerNamesL(MMPXPlaybackCallback& aCallback)
-    {
-    MPX_FUNC_EX("CMPXPlaybackUtility::SubPlayerNamesL()");
-    SubPlayerNamesL(aCallback,UidL());
-    }
-
-// ----------------------------------------------------------------------------
-// Selected sub player index
-// ----------------------------------------------------------------------------
-//
-TInt CMPXPlaybackUtility::SubPlayerL() const
-    {
-    return 0;
-    }
-
-// ----------------------------------------------------------------------------
-// The UID identifying this player
-// ----------------------------------------------------------------------------
-//
-TUid CMPXPlaybackUtility::UidL() const
-    {
-    return TUid::Uid( 0 );
-    }
-
-// ----------------------------------------------------------------------------
-// Path to the collection
-// ----------------------------------------------------------------------------
-//
-CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
-    {
-    MPX_FUNC_EX("CMPXPlaybackUtility::PlaylistL()");
-    CMPXCollectionPlaylist *p = NULL;
-
-    return p;
-    }
-
-// ----------------------------------------------------------------------------
-// Return file handle
-// ----------------------------------------------------------------------------
-//
-RFile* CMPXPlaybackUtility::FileL()
-    {
-    RFile* file(NULL);
-    return file;
-    }
-
-// ----------------------------------------------------------------------------
-// URI of current song
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::UriL()
-    {
-		HBufC* buf=NULL;
-		return buf;
-    }
-
-// ----------------------------------------------------------------------------
-// Request for media properties.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::MediaL(
-    const TArray<TMPXAttribute>& aAttrs,
-    MMPXPlaybackCallback& aCallback)
-    {
-    MediaL( aAttrs, aCallback, NULL );
-    }
-
-// ----------------------------------------------------------------------------
-// Request for media properties.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::MediaL(
-    const TArray<TMPXAttribute>& /* aAttrs */,
-    MMPXPlaybackCallback& /* aCallback */,
-    CMPXAttributeSpecs* /* aSpecs */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Server has completed the message, and if there's no error, the results are
-// available. The server completes with the function id (or error) so the correct
-// callback is made
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::RunL()
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Canceling by the server
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::DoCancel()
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Sends error message to all observers - maybe it should only be to the
-// client that calls the async method
-// ----------------------------------------------------------------------------
-//
-TInt CMPXPlaybackUtility::RunError(TInt /* aError */)
-    {
-    return KErrNone;
-    }
-
-// ----------------------------------------------------------------------------
-// Distributes messages to all observers
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::MessageReceived(TInt /* aMsgData */, TInt /* aError */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Distributes messages to all observers
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::HandleMessageL(TInt /* aMsgData */, TInt /* aError */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-//  Handle error in RunL
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::HandleRunErrorL(TInt /* aError */)
-    {
-
-    }
-
-
-// ----------------------------------------------------------------------------
-// Read a buffer from server
-// ----------------------------------------------------------------------------
-//
-HBufC* CMPXPlaybackUtility::DesL(TInt /* aSize */)
-    {
-    HBufC* des=NULL;
-
-    return des;
-    }
-
-// ----------------------------------------------------------------------------
-// Adds a sync request to the queue: if there is no outstanding request,
-// it will be executed immediately
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::AddRequestL(TMPXPlaybackServerOp /*aFunction */,
-                                      MMPXPlaybackCallback* /* aCallback */,
-                                      TInt /* aParamData */,
-                                      CBufBase* /* aBuf */,
-                                      TAny* /* aPtr */,
-                                      CBase* /* aAlivePtr */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Executes the next request in the queue.
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::ExecuteNextRequest()
-    {
-
-    }
-
-
-
-#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-// ----------------------------------------------------------------------------
-// Inititialises with a single song, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::Init64L(RFile64& /* aShareableFile */)
-    {
-
-    }
- 
-// ----------------------------------------------------------------------------
-// Inititialises with a file, may not be part of any collection
-// ----------------------------------------------------------------------------
-//
-void CMPXPlaybackUtility::InitStreaming64L(RFile64& /* aShareableFile */, const TInt /* aAccessPoint */)
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// Return file handle
-// ----------------------------------------------------------------------------
-//
-RFile64* CMPXPlaybackUtility::File64L()
-    {
-    RFile64* file(NULL);
-
-    return file;
-    }
-
-#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 7 %
+// Version : %version: 8 %
 
 
 
@@ -39,18 +39,9 @@
         QMPXVideoPlaybackViewFileDetails *details )
     : mView( view )
     , mViewWrapper( viewWrapper )
-    , mFileDetails( details )   
+    , mFileDetails( details ) 
+    , mFileDetailsAdded( false )
 {
-    initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
-    connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -61,6 +52,8 @@
     QMPXVideoPlaybackViewFileDetails* details )
 {
     Q_UNUSED( details );
+
+    mFileDetailsAdded = true;
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -70,9 +63,6 @@
 QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
 {
     MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-
-    disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
-
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -82,51 +72,8 @@
 void QMPXVideoPlaybackControlsController::handleEvent(
     TMPXVideoPlaybackControlCommandIds event, int value )
 {
-    switch ( event )
-    {
-        case EMPXControlCmdTvOutConnected:
-        {
-            handleTvOutEvent( true, event, value );
-            break;
-        }
-        case EMPXControlCmdTvOutDisconnected:
-        {
-            handleTvOutEvent( false, event, value );
-            break;
-        }
-        case EMPXControlCmdSetVolume:
-        {
-            mFileDetails->mAudioEnabled = false;
-            break;
-        }
-        case EMPXControlCmdSetDuration:
-        {
-            mFileDetails->mDuration = value;
-            break;
-        }
-        case EMPXControlCmdShowVolumeControls:
-        {
-            mFileDetails->mAudioEnabled = true;   
-            break;
-        }
-        case EMPXControlCmdSetPosition:
-        {
-            mFileDetails->mSeekable = true;
-            break;    
-        }
-    }
-}
-
-// -------------------------------------------------------------------------------------------------
-//   QMPXVideoPlaybackControlsController::handleTvOutEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTvOutEvent(
-        bool connected, TMPXVideoPlaybackControlCommandIds event, int value )
-{
-    Q_UNUSED( event );
-    Q_UNUSED( value );
-    mFileDetails->mTvOutConnected = connected;
+    mReceivedEvent = event;
+    mValue = value;
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -135,16 +82,15 @@
 //
 void QMPXVideoPlaybackControlsController::updateVideoRectDone()
 {
-    mViewTransitionIsGoingOn = false;
 }
 
 // -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
+// QMPXVideoPlaybackControlsController::isRNLogoBitmapVisible()
 // -------------------------------------------------------------------------------------------------
 //
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-
+bool QMPXVideoPlaybackControlsController::isRNLogoBitmapInControlList()
 {
-    MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTappedOnScreen"));
+    return mRNLogoVisible;
 }
+
 // End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackdisplayhandler.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  5 %
+// Version : %version:  7 %
 
 #include <sysutil.h>
 #include <s32file.h>
@@ -29,11 +29,6 @@
 #include "mpxvideoregion.h"
 #include "mpxvideoplaybackviewfiledetails.h"
 
-const TInt KVIDEORESIZINGREPEATRATE = 50000;
-const TReal32 KTRANSITIONEFFECTCNT = 8;
-
-_LIT( KAspectRatioFile, "c:\\private\\200159b2\\mpxvideoplayer_aspect_ratio.dat" );
-
 
 CMPXVideoPlaybackDisplayHandler::CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil,
                                                                   CMPXVideoViewWrapper* aViewWrapper )
@@ -67,7 +62,6 @@
 //
 void CMPXVideoPlaybackDisplayHandler::ConstructL()
 {
-    LoadAspectRatioL();
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -92,69 +86,51 @@
 //
 void CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()
 {
-#ifdef SYMBIAN_BUILD_GCE
     if ( iVideoDisplay )
     {
         delete iVideoDisplay;
         iVideoDisplay = NULL;
     }
-#else
-    if ( iDirectScreenAccess )
-    {
-        delete iDirectScreenAccess;
-        iDirectScreenAccess = NULL;
-    }
-#endif
 }
 
 // -------------------------------------------------------------------------------------------------
 //   CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL()
 // -------------------------------------------------------------------------------------------------
 //
-void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* aMessage )
+void CMPXVideoPlaybackDisplayHandler::HandleVideoDisplayMessageL( CMPXMessage* /*aMessage*/ )
 {
-
-    TMPXVideoDisplayCommand message =
-        ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)) );
-
-    switch ( message )
-    {
-#ifdef SYMBIAN_BUILD_GCE    	
-        case EPbMsgVideoSurfaceCreated:
-        {
-            SurfaceCreatedL( aMessage );
-            break;
-        }
-        case EPbMsgVideoSurfaceChanged:
-        {
-            SurfaceChangedL( aMessage );
-            break;
-        }
-        case EPbMsgVideoSurfaceRemoved:
-        {
-            SurfaceRemoved();
-            break;
-        }
-#endif        
-    }
 }
 
-
 // -------------------------------------------------------------------------------------------------
 //   CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()
 // -------------------------------------------------------------------------------------------------
 //
 TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
 {
-    Q_UNUSED( aCmd );
-    TInt aspectRatio = 0;
+    iCommand = aCmd;
+    
+    switch ( aCmd )
+    {
+        case EPbCmdNaturalAspectRatio:
+        {
+            iAspectRatio = EMMFNatural;
+            break;
+        }
+        case EPbCmdZoomAspectRatio:
+        {
+            iAspectRatio = EMMFZoom;
+            break;
+        }
+        case EPbCmdStretchAspectRatio:
+        {
+            iAspectRatio = EMMFStretch;
+            break;
+        }
+    }
 
-    iCurrentIndexForAspectRatio = 1;
-    
-    return aspectRatio;
+    return iAspectRatio;
 }
 
-
 // -------------------------------------------------------------------------------------------------
 //   CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL
 // -------------------------------------------------------------------------------------------------
@@ -165,187 +141,21 @@
 {
     Q_UNUSED( aFileDetails );
     Q_UNUSED( aDisplayAspectRatio );
-    TInt newAspectRatio = EMMFNatural;
 
-    return newAspectRatio;
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SaveAspectRatioL()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::LoadAspectRatioL()
-{
+    return iAspectRatio;
 }
 
 // -------------------------------------------------------------------------------------------------
 //   CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()
 // -------------------------------------------------------------------------------------------------
 //
-void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL(  TRect aClipRect, TBool transitionEffect  )
+void CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL( TRect aClipRect, TBool transitionEffect  )
 {
     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::UpdateVideoRectL()"));
-    Q_UNUSED( transitionEffect );
-    
-    iTlXDiff = (TReal32)( aClipRect.iTl.iX );
-    iTlYDiff = (TReal32)( aClipRect.iTl.iY );
-    iBrXDiff = (TReal32)( aClipRect.iBr.iX );
-    iBrYDiff = (TReal32)( aClipRect.iBr.iY );    
-
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::UpdateVideoRectTimeOutL( TAny* aPtr )
-{
-    Q_UNUSED( aPtr );
-    return KErrNone;
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CalculateVideoRectL()
-{
-
-}
 
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SetVideoRectL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SetVideoRectL( TRect aRect )
-{
-    Q_UNUSED( aRect );
-}
-
-#ifdef SYMBIAN_BUILD_GCE
+    Q_UNUSED( transitionEffect );
 
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL( CWsScreenDevice& aScreenDevice,
-                                                         RWindowBase& aWindowBase,
-                                                         RWindow* aWin )
-{
-    Q_UNUSED( aScreenDevice );
-    Q_UNUSED( aWindowBase );
-    Q_UNUSED( aWin );
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL( CMPXMessage* aMessage )
-{
-    Q_UNUSED( aMessage );
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceChangedL( CMPXMessage* aMessage )
-{
-    Q_UNUSED( aMessage );
+    iRect = aClipRect;
 }
 
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd )
-{
-    Q_UNUSED( aCmd );
-    return KErrNone;
-}
-
-
-#else
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::SetDisplayWindowL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::SetDisplayWindowL( RWsSession& aWs,
-                                                         CWsScreenDevice& aScreenDevice,
-                                                         RWindowBase& aWin,
-                                                         TRect aClipRect )
-{
-    Q_UNUSED( aWs );
-    Q_UNUSED( aScreenDevice );
-    Q_UNUSED( aWin );
-    Q_UNUSED( aClipRect );
-}
-
-// -------------------------------------------------------------------------------------------------
-//  CMPXVideoPlaybackDisplayHandler::Restart()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::Restart( RDirectScreenAccess::TTerminationReasons aReason )
-{
-    Q_UNUSED( aReason );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::RestartDsaL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::RestartDsaL()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::AbortNow()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::AbortNow( RDirectScreenAccess::TTerminationReasons aReason )
-{
-    Q_UNUSED( aReason );
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::CreateAbortDsaCmdL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackDisplayHandler::CreateAbortDsaCmdL()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-//   CMPXVideoPlaybackDisplayHandler::CreateAspectRatioCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackDisplayHandler::CreateAspectRatioCommandL( TMPXVideoPlaybackCommand aCmd )
-{
-    Q_UNUSED( aCmd );
-}
-
-#endif
-
 // End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro	Fri May 28 09:45:19 2010 +0300
@@ -14,7 +14,7 @@
 # Description: Project file for building testmpxvideoviewwrapper
 #
 #
-# Version : %version: 5 %
+# Version : %version: 6 %
 
 
 TEMPLATE = app
@@ -23,12 +23,11 @@
 
 DEPENDPATH += inc src stub/src stub/inc
 
-INCLUDEPATH += ../inc \
-               ../../inc \   
-               ../../../inc \            
-               ../../../../inc \                                          
-               ../../controlinc \ 
-               ../../viewinc \ 
+INCLUDEPATH += stub/inc \
+               ../inc \
+               ../../inc \
+               ../../../inc \
+               ../../../../inc \
                $$MW_LAYER_SYSTEMINCLUDE                                            
 
 LIBS += -lmpxcommon.dll \
@@ -43,7 +42,7 @@
            mpxvideoplaybackuserinputhandler.h \
            mpxvideoplaybackcontrolscontroller.h \           
            mpxvideoplaybackviewfiledetails.h \
-           mpxplaybackutilityimpl.h \
+           mpxplaybackutility.h \
            ../../viewinc/mpxvideoviewwrapper.h
 					                
 SOURCES += testmpxvideoviewwrapper.cpp \
@@ -52,6 +51,5 @@
             mpxvideoplaybackviewfiledetails.cpp \
             mpxvideoplaybackcontrolscontroller.cpp \
             mpxplaybackutility.cpp \
-            mpxplaybackutilityimpl.cpp \
             mpxvideoplaybackuserinputhandler.cpp \
             ../../viewsrc/mpxvideoviewwrapper.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 * 
 */
 
-// Version : %version:  4 %
+// Version : %version:  5 %
 
 
 #include <qdebug>
@@ -252,20 +252,35 @@
 
     setup();
 
-    // test for tv-out
-    mController->mFileDetails->mPlaybackMode = EMPXVideoLocal; 
-    mController->mFileDetails->mTvOutConnected = true;
-    mProgBar->updateWithFileDetails( mController->mFileDetails );
-    QVERIFY( mProgBar->mProgressSlider->isEnabled() );
-
-    // live streaming
-    mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming; 
+    //
+    // pausable + non seekable
+    //
+    mController->mFileDetails->mPausableStream = true;
+    mController->mFileDetails->mSeekable = false;
     mProgBar->updateWithFileDetails( mController->mFileDetails );
     QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
 
+    //
+    // non pausable + seekable
+    //
+    mController->mFileDetails->mPausableStream = false;
+    mController->mFileDetails->mSeekable = true;
+    mProgBar->updateWithFileDetails( mController->mFileDetails );
+    QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+    //
+    // non pausable + non seekable
+    //
+    mController->mFileDetails->mPausableStream = false;
+    mController->mFileDetails->mSeekable = false;
+    mProgBar->updateWithFileDetails( mController->mFileDetails );
+    QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+    //
     // other cases
-    mController->mFileDetails->mPlaybackMode = EMPXVideoLocal; 
-    mController->mFileDetails->mTvOutConnected = false;
+    //
+    mController->mFileDetails->mPausableStream = true;
+    mController->mFileDetails->mSeekable = true;
     mProgBar->updateWithFileDetails( mController->mFileDetails );
     QVERIFY( mProgBar->mProgressSlider->isEnabled() );
 
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 * 
 */
 
-// Version : %version:  4 %
+// Version : %version:  5 %
 
 #ifndef __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
 #define __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
@@ -116,6 +116,10 @@
     // test private slot handleOrientationChanged()
     //
     void testslot_handleOrientationChanged();
+
+    void testslot_handleRNLogoVisibleChanged();
+    void testslot_handleRNLogoTimeout();
+    void testIsRNLogoBitmapVisible();
   
 signals:
     void commandSignal();
@@ -134,6 +138,4 @@
 #endif  // __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
 
 // End of file
-    
 
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 * 
 */
 
-// Version : %version:  8 %
+// Version : %version:  9 %
 
 #include <e32err.h>
 #include <w32std.h>
@@ -55,7 +55,6 @@
 {
     HbApplication app(argc, argv);
     HbMainWindow window;
-    
     TestMPXVideoPlaybackControlsController tv;
 
     char *pass[3];
@@ -68,7 +67,6 @@
     return res;
 }
 
-
 // ---------------------------------------------------------------------------
 // init
 // ---------------------------------------------------------------------------
@@ -78,7 +76,11 @@
     MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::init()"));
     
     mBaseVideoView = new HbVideoBasePlaybackView();
-    mFileDetails   = new QMPXVideoPlaybackViewFileDetails();
+
+    if ( ! mFileDetails )
+    {
+        mFileDetails   = new QMPXVideoPlaybackViewFileDetails();        
+    }
     mViewWrapper   = CMPXVideoViewWrapper::NewL( mBaseVideoView );	  
     mController    = new QMPXVideoPlaybackControlsController( mBaseVideoView,
                                                               mViewWrapper,
@@ -113,32 +115,40 @@
 void TestMPXVideoPlaybackControlsController::testAddFileDetails()
 {
     MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testAddFileDetails()") );
-    
-    init();    
-    
+
     //
     // local real media with no video
     //
-    mFileDetails->mClipName = QString("testClip.rm");
-    mFileDetails->mMimeType = QString("video/x-pn-realvideo");
-        
+    mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+    mFileDetails->mClipName = QString( "testClip.rm" );
+    mFileDetails->mMimeType = QString( "video/x-pn-realvideo" );
+
+    init();
+
     mController->addFileDetails( mFileDetails );    
     
     QVERIFY( mController->mFileDetails->mRNFormat == true );
     QVERIFY( mController->mViewMode == EAudioOnlyView );
     QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
     QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected );
-            
+
+    cleanup();    
+
     //
     // local 3GPP media with video-only
-    //    
+    //
+    mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+
     mFileDetails->mClipName = QString("testClip.3gp");
     mFileDetails->mMimeType = QString("video/3gpp");
     mFileDetails->mVideoEnabled = true;
+    mFileDetails->mTvOutConnected = true;
+
+    init();
+
     mController->mViewMode = EFullScreenView;
-    mFileDetails->mTvOutConnected = true;
     QFileInfo videoOnlyFile( mFileDetails->mClipName );
-    
+
     mController->addFileDetails( mFileDetails );    
     
     QVERIFY( mController->mFileDetails->mRNFormat == false );
@@ -167,16 +177,21 @@
             break;
         }
     }    
-    
+    cleanup();    
+
     //
     // non-local audio-video media, TvOut is not connected
     //
+    mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+
     mFileDetails->mClipName = QString("rtsp:://www.youtube.com/testClip.rm");
     mFileDetails->mPlaybackMode = EMPXVideoStreaming;
     mFileDetails->mTvOutConnected = false;
     mFileDetails->mAudioEnabled = true;
     mFileDetails->mTitle = QString("Clip Title");
-    
+
+    init();
+
     mController->addFileDetails( mFileDetails );    
     
     QVERIFY( mController->mFileDetails->mRNFormat == true );
@@ -210,11 +225,8 @@
     int value = 20000;    
     
     mController->handleEvent( EMPXControlCmdSetPosition, value );  
-    
-    for ( int i = 0 ; i < mController->mControls.count() ; i++ )
-    {
-        QVERIFY( mController->mControls[i]->mPosition == ( value / KPbMilliMultiplier ) );
-    }
+
+    QVERIFY( mController->mControls[0]->mPosition == ( value / KPbMilliMultiplier ) );
     
     cleanup();    
 }
@@ -231,11 +243,8 @@
     int value = 30000;    
     
     mController->handleEvent( EMPXControlCmdSetDuration, value );  
-    
-    for ( int i = 0 ; i < mController->mControls.count() ; i++ )
-    {
-        QVERIFY( mController->mControls[i]->mDuration == ( value / KPbMilliMultiplier ) );    
-    }
+
+    QVERIFY( mController->mControls[0]->mDuration == ( value / KPbMilliMultiplier ) );
     
     cleanup();    
 }
@@ -250,7 +259,8 @@
     
     init();    
     TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdStateChanged;
-    
+    mController->mOrientation = Qt::Horizontal;
+
     //
     // state change (EPbStateInitialising)
     //
@@ -395,10 +405,7 @@
     {    
         mController->handleEvent( EMPXControlCmdSetAspectRatio, i );   
     
-        for ( int j = 0 ; j < mController->mControls.count() ; j++ )
-        {
-            QVERIFY( mController->mControls[j]->mAspectRatio == i );  
-        }    
+        QVERIFY( mController->mControls[0]->mAspectRatio == i );  
     }
     
     cleanup();    
@@ -417,10 +424,7 @@
     
     mController->handleEvent( EMPXControlCmdSetDownloadSize, value );    
     
-    for ( int i = 0 ; i < mController->mControls.count() ; i++ )
-    {
-        QVERIFY( mController->mControls[i]->mDownloadSize == value );  
-    }
+    QVERIFY( mController->mControls[0]->mDownloadSize == value );  
     
     cleanup();    
 }
@@ -437,11 +441,8 @@
     int value = 55;
     
     mController->handleEvent( EMPXControlCmdDownloadUpdated, value );    
-    
-    for ( int i = 0 ; i < mController->mControls.count() ; i++ )
-    {
-        QVERIFY( mController->mControls[i]->mDownloadPosition == value );  
-    }
+
+    QVERIFY( mController->mControls[0]->mDownloadPosition == value );  
     
     cleanup();    
 }
@@ -458,11 +459,8 @@
     int value = 60;
     
     mController->handleEvent( EMPXControlCmdDownloadComplete, value );    
-    
-    for ( int i = 0 ; i < mController->mControls.count() ; i++ )
-    {
-        QVERIFY( mController->mControls[i]->mDownloadPosition == value );  
-    }
+
+    QVERIFY( mController->mControls[0]->mDownloadPosition == value );  
     
     cleanup();    
 }
@@ -1072,16 +1070,12 @@
     // emit signal, this will in turns invoke mController handleOrientationChanged() slot
     //
     mController->mOrientation = Qt::Vertical;
+    mController->mState = EPbStatePlaying;                
 
     emit commandSignal( Qt::Horizontal );     
-    
-    //
-    // verify command EMPXPbvCmdClose has been issued
-    //
+
     QVERIFY( mController->mOrientation == Qt::Horizontal ); 
 
-    mController->mState = EPbStatePlaying;                
-
     for ( int i = 0 ; i < mController->mControls.count() ; i++ )
     {
         QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );    
@@ -1099,4 +1093,116 @@
     cleanup();      
 }
 
+// -------------------------------------------------------------------------------------------------
+// TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged
+// -------------------------------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged()
+{
+    MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged()") );
+        
+    //
+    // initialize controlscontroller
+    //
+    init();    
+        
+    //
+    // connect signal with controller handleRNLogoVisibleChanged() slot
+    //
+    bool res = connect( this, SIGNAL( commandSignal() ),
+                        mController, SLOT( handleRNLogoVisibleChanged() ) );
+    
+    //
+    // emit signal, this will in turns invoke mController handleRNLogoVisibleChanged() slot
+    //
+    emit commandSignal();     
+
+    QVERIFY( mController->mRNLogoTimer->isActive() ); 
+    QVERIFY( mController->mRNLogoTimer->interval() == KMPXRNLogoTimeOut ); 
+
+    //
+    // disconnect signal
+    //
+    disconnect( this, SIGNAL( commandSignal() ), 
+                mController, SLOT( handleRNLogoVisibleChanged() ) );
+    
+    //
+    // clean up
+    //
+    cleanup();      
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout()
+{
+    MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout()") );
+        
+    //
+    // initialize controlscontroller
+    //
+    init();    
+
+    if ( ! mController->mRNLogoTimer )
+    {
+        mController->mRNLogoTimer = new QTimer( mController );
+    }
+
+    //
+    // connect signal with controller handleRNLogoTimeout() slot
+    //
+    bool res = connect( this, SIGNAL( commandSignal() ),
+                        mController, SLOT( handleRNLogoTimeout() ) );
+    
+    //
+    // emit signal, this will in turns invoke mController handleRNLogoTimeout() slot
+    //
+    emit commandSignal();     
+
+    QVERIFY( ! mController->mRNLogoTimer->isActive() ); 
+    QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );                    
+    QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdRealOneBitmapTimeout ); 
+
+    //
+    // disconnect signal
+    //
+    disconnect( this, SIGNAL( commandSignal() ), 
+                mController, SLOT( handleRNLogoTimeout() ) );
+    
+    //
+    // clean up
+    //
+    cleanup();      
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible
+// -------------------------------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible()
+{
+    MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible()"));  
+
+    init();
+
+    QVERIFY( mController->isRNLogoBitmapInControlList() );
+
+    //
+    // Remove RN logo from the list
+    //
+    for ( int i = 0 ; i < mController->mControls.count() ; i++ )
+    {
+        if( mController->mControls[i]->mControlIndex == EMPXRealLogoBitmap )
+        {
+            mController->mControls.removeAt( i );
+        }
+    }
+
+    QVERIFY( ! mController->isRNLogoBitmapInControlList() );
+
+    cleanup();    
+}
+
 // End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrol.hrh	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  %
+// Version : %version:  2 %
 
 
 #ifndef MPXVIDEOPLAYBACKCONTROL_HRH_
@@ -57,7 +57,6 @@
     //
     //  Bitmaps
     //
-    EMPXBlackBitmap,
     EMPXIndicatorBitmap,
     EMPXRealLogoBitmap,
 
@@ -89,7 +88,8 @@
     EMPXControlCmdSoftKeyPressed,
     EMPXControlCmdFullScreenViewOpened,
     EMPXControlCmdDetailsViewOpened,
-    EMPXControlCmdAudionOnlyViewOpened
+    EMPXControlCmdAudionOnlyViewOpened,
+    EMPXControlCmdRemoveRNLogo
 };
 
 enum TMPXVideoSeekingType
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackfullscreencontrol.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  1 %
+// Version : %version:  2 %
 
 
 
@@ -114,7 +114,6 @@
         TMPXPlaybackState         mState;
         TMPXPlaybackState         mVisibilityState;
         
-    protected:
         QMPXVideoPlaybackControlsController* mController;
         HbWidget                 *mControl;
         TMPXVideoPlaybackControls mControlIndex;
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackcontrolconfiguration.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 1 %
+// Version : %version: 2 %
 
 
 
@@ -41,7 +41,6 @@
         QMPXVideoPlaybackControlsController* controller)
     : mControlsController( controller )
 {
-    createControlList();
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -64,17 +63,11 @@
 {
     MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::createControlList()"));
 
-    QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
+    addControlToList( EMPXBufferingAnimation );
+    addControlToList( EMPXStatusPane );
+    addControlToList( EMPXRealLogoBitmap );
 
-    if ( fileDetails->mPlaybackMode != EMPXVideoLocal )
-    {
-        //
-        // if it's not local mode, add branding animation control to show while initializing
-        //
-        addControlToList( EMPXBufferingAnimation );
-    }
-
-    addControlToList( EMPXStatusPane );
+    emit controlListUpdated();
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -112,8 +105,8 @@
     {
         mState = KControlListUpdated;    
     }
-    
-    
+
+    emit controlListUpdated();
 }
 
 // -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  3 %
+// Version : %version:  4 %
 
 
 
@@ -178,6 +178,16 @@
         MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[HbRatingSlider] to object list") );                        
         mWidgets.append( object );
     }
+    else if ( name == "rnLogoBitmap" )
+    {
+        MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating rnLogoBitmap") );
+        
+        object = new HbWidget();
+        object->setObjectName( name );
+
+        MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[rnLogoBitmap] to object list") );                        
+        mWidgets.append( object );
+    }
 
     return object;
 }
--- a/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewinc/mpxvideoviewwrapper.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  da1mmcf#12 %
+// Version : %version:  da1mmcf#14 %
 
 
 
@@ -35,7 +35,12 @@
 
 #include "mpxvideoplaybackcontrol.hrh"
 
-//  Constants
+enum TMPXMediaRequestStatus
+{
+    MediaNotRequested,
+    MediaRequested,
+    MediaDelivered
+};
 
 //  Forward Declarations
 class MMPXPlaybackUtility;
@@ -167,7 +172,7 @@
         
         void RequestMediaL();  
         
-        void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd );
+        void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
         
         TBool IsAppInFrontL();
         
@@ -191,9 +196,6 @@
 
         void HandleBufferingStateL();
 
-        void IssuePlayCommandL();
-
-
         /*
          *  Provides the static function for the callback to close the player
          *  Called by CIdle iIdle
@@ -252,6 +254,8 @@
 
         void HandleShortPressBackwardL();
 
+        void IssuePlayCommandL();
+
     protected: // data
         MMPXPlaybackUtility*                 iPlaybackUtility;
         MMPXCollectionUtility*               iCollectionUtility;
@@ -265,8 +269,8 @@
         CMPXVideoPlaybackUserInputHandler*   iUserInputHandler;
         QMPXVideoPlaybackControlsController* iControlsController;
         
-        TBool                                iMediaRequested;
-        TBool                                iPlaylistView;        
+        TMPXMediaRequestStatus               iMediaRequestStatus;
+        TBool                                iPlaylistView;
 };
 
 #endif  // __MPXVIDEOVIEWWRAPPER_H__
--- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  da1mmcf#10 %
+// Version : %version:  da1mmcf#11 %
 
 
 
@@ -44,6 +44,7 @@
     MPX_ENTER_EXIT(_L("HbVideoPlaybackView::HbVideoPlaybackView()"));
 
     initializeVideoPlaybackView();
+    mSyncClose = false;
 }
 
 // -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#30 %
+// Version : %version: da1mmcf#32 %
 
 
 
@@ -60,7 +60,7 @@
 CMPXVideoViewWrapper::CMPXVideoViewWrapper( HbVideoBasePlaybackView* aView )
     : iView( aView )
     , iControlsController( NULL )
-    , iMediaRequested( false )
+    , iMediaRequestStatus( MediaNotRequested )
     , iPlaylistView( false )
 {
 }
@@ -176,7 +176,7 @@
 //
 TBool CMPXVideoViewWrapper::IsLive()
 {
-    return (iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming);
+    return ( iFileDetails->mPlaybackMode == EMPXVideoLiveStreaming );
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -192,19 +192,20 @@
 //   CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL()
 // -------------------------------------------------------------------------------------------------
 //
-void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd )
+void CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync )
 {
-    MPX_DEBUG(_L("CMPXVideoViewWrapper::CreateGeneralPlaybackCommandL(%d)"), aCmd );
-
+    MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"),
+                   _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );    
+    
     CMPXCommand* cmd = CMPXCommand::NewL();
     CleanupStack::PushL( cmd );
 
-    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+    cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, aDoSync );
     cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
     cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, aCmd );
 
-    iPlaybackUtility->CommandL( *cmd );
+    iPlaybackUtility->CommandL( *cmd, this );
 
     CleanupStack::PopAndDestroy( cmd );
 }
@@ -223,7 +224,8 @@
     {
         case EMPXPbvCmdPlay:
         {
-            IssuePlayCommandL();
+            MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EPbCmdPlay"));
+            CreateGeneralPlaybackCommandL( EPbCmdPlay );
             break;
         }
         case EMPXPbvCmdPause:
@@ -236,7 +238,12 @@
         {
             MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdClose"));
             
-            CreateGeneralPlaybackCommandL( EPbCmdClose );
+            //
+            // closing playback view occurs:
+            //     - synchronously (mSyncClose=true) for PDL case (when PDL is supported)
+            //     - asynchronously (mSyncClose=false) for all other cases
+            //
+            CreateGeneralPlaybackCommandL( EPbCmdClose, iView->mSyncClose );
             break;
         }
         case EMPXPbvCmdSeekForward:
@@ -345,7 +352,7 @@
                 // the second cmd actually goes to the previous item in the list
 				//
                 iPlaybackUtility->CommandL( EPbCmdPrevious );
-                iPlaybackUtility->CommandL( EPbCmdPrevious );  
+                iPlaybackUtility->CommandL( EPbCmdPrevious );
             }
             break;
         }
@@ -364,6 +371,12 @@
             CreateVideoSpecificCmdL( EPbCmdCustomPlay );
             break;
         }
+        case EMPXPbvCmdRealOneBitmapTimeout:
+        {
+            IssuePlayCommandL();                
+
+            break;
+        }        
     }
 }
 
@@ -395,9 +408,10 @@
 {
     MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::RequestMediaL()"));
 
-    if ( ! iMediaRequested && iPlaybackUtility->StateL() == EPbStateInitialised )
+    if ( iMediaRequestStatus == MediaNotRequested &&
+         iPlaybackUtility->StateL() == EPbStateInitialised )
     {
-        iMediaRequested = ETrue;
+        iMediaRequestStatus = MediaRequested;
 
         //
         //  Request the volume for the controls
@@ -433,7 +447,7 @@
 
             specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue);
 
-            s->MediaL( attrs.Array(), *this, specs);
+            s->MediaL( attrs.Array(), *this, specs );
 
             CleanupStack::PopAndDestroy( specs );
             CleanupStack::PopAndDestroy( &attrs );
@@ -612,7 +626,7 @@
                     //
                     if ( iPlaybackState != EPbStateNotInitialised )
                     {
-                        iMediaRequested = EFalse;
+                        iMediaRequestStatus = MediaNotRequested;
                         HandleCommandL( EMPXPbvCmdResetControls );
 
                         if ( iFileDetails )
@@ -926,65 +940,30 @@
 
     if ( aError == KErrNone )
     {
-        if ( iFileDetails )
-        {
-            iFileDetails->clearFileDetails();
-        }
-        else
+        iMediaRequestStatus = MediaDelivered;
+
+        if ( ! iFileDetails )
         {
             iFileDetails = new QMPXVideoPlaybackViewFileDetails();
         }       
-        
+
         //
         //  Read in the media data
         //
         ParseMetaDataL( aMedia );
 
         //
-        //  Create controls since file details are available
+        // If RN logo is still visible, wait for timeout of rn logo timer
+        // If RN logo is not visible, issue play
         //
-        if ( iControlsController )
-        {
-            iControlsController->addFileDetails( iFileDetails );            
-        }
-
-        if ( iFileDetails->mVideoEnabled )
+        if ( ! iControlsController->isRNLogoBitmapInControlList() )
         {
-            //
-            // get window size
-            //
-            RWindow *window = iView->getWindow();            
-            TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) );
-            
-            //
-            // get window aspect ratio
-            //   if device is in landscape mode, width > height
-            //   if device is in portrait mode, width < height
-            //
-            TReal32 width = (TReal32) displayRect.Width();
-            TReal32 height = (TReal32) displayRect.Height();            
-            TReal32 displayAspectRatio = (width > height)? (width / height) : (height / width);
-
-            //
-            // get new aspect ratio
-            TInt newAspectRatio = 
-                iDisplayHandler->SetDefaultAspectRatioL( iFileDetails, displayAspectRatio );
-
-            //
-            //  Setup the display window and issue play command
-            //
-            iDisplayHandler->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(),
-                                                   *(CCoeEnv::Static()->ScreenDevice()),
-                                                   *window,
-                                                   displayRect );
-
-            if ( iControlsController )
-            {
-                iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio );
-            }
+            IssuePlayCommandL();
         }
-
-        CreateGeneralPlaybackCommandL( EPbCmdPlay );
+    }
+    else
+    {
+        iMediaRequestStatus = MediaNotRequested;
     }
 }
 
@@ -997,13 +976,14 @@
 void CMPXVideoViewWrapper::HandleMediaL( const CMPXMedia& aMedia, TInt aError)
 {
     MPX_ENTER_EXIT(_L( "CMPXVideoViewWrapper::HandleMediaL()" ));
+
     if ( aMedia.IsSupported( KMPXMediaVideoError ) )
     {
         TInt error = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoError );
         // Reset the controls
         HandleCommandL( EMPXPbvCmdResetControls );
         // Set the iMediaRequested flag to false
-        iMediaRequested = EFalse;
+        iMediaRequestStatus = MediaNotRequested;
         // Reset the playback state to stopped
         iPlaybackState = EPbStateStopped;
         // Handle the plugin error
@@ -1031,9 +1011,8 @@
 //   CMPXVideoViewWrapper::HandlePropertyL()
 // -------------------------------------------------------------------------------------------------
 //
-void CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty,
-                                                 TInt aValue,
-                                                 TInt aError )
+void 
+CMPXVideoViewWrapper::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError )
 {
     MPX_DEBUG(_L("CMPXVideoViewWrapper::HandlePropertyL - Error(%d)"), aError );
 
@@ -1152,16 +1131,6 @@
 }
 
 // -------------------------------------------------------------------------------------------------
-//   CMPXVideoViewWrapper::IssuePlayCommandL
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoViewWrapper::IssuePlayCommandL()
-{
-    MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssuePlayCommandL()"));
-    CreateGeneralPlaybackCommandL( EPbCmdPlay );
-}
-
-// -------------------------------------------------------------------------------------------------
 //   CMPXVideoViewWrapper::RetrievePdlInformationL
 // -------------------------------------------------------------------------------------------------
 //
@@ -1456,4 +1425,63 @@
     iControlsController->updateVideoRectDone();
 }
 
+// -------------------------------------------------------------------------------------------------
+//   CMPXVideoViewWrapper::IssuePlayCommandL()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::IssuePlayCommandL()
+{
+    MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssuePlayCommandL()"),
+                   _L("iMediaRequestStatus = %d"), iMediaRequestStatus );
+
+    if ( iMediaRequestStatus == MediaDelivered )
+    {
+        //
+        //  Create controls since file details are available
+        //
+        if ( iControlsController )
+        {
+            iControlsController->addFileDetails( iFileDetails );            
+        }
+
+        if ( iFileDetails->mVideoEnabled )
+        {
+            //
+            // get window size
+            //
+            RWindow *window = iView->getWindow();            
+            TRect displayRect = TRect( TPoint( window->Position() ), TSize( window->Size() ) );
+            
+            //
+            // get window aspect ratio
+            //   if device is in landscape mode, width > height
+            //   if device is in portrait mode, width < height
+            //
+            TReal32 width = (TReal32) displayRect.Width();
+            TReal32 height = (TReal32) displayRect.Height();            
+            TReal32 displayAspectRatio = (width > height)? (width / height) : (height / width);
+
+            //
+            // get new aspect ratio
+            TInt newAspectRatio = 
+                iDisplayHandler->SetDefaultAspectRatioL( iFileDetails, displayAspectRatio );
+
+            //
+            //  Setup the display window and issue play command
+            //
+            iDisplayHandler->CreateDisplayWindowL( CCoeEnv::Static()->WsSession(),
+                                                   *(CCoeEnv::Static()->ScreenDevice()),
+                                                   *window,
+                                                   displayRect );
+
+            if ( iControlsController )
+            {
+                iControlsController->handleEvent( EMPXControlCmdSetAspectRatio, newAspectRatio );
+            }
+        }
+
+        CreateGeneralPlaybackCommandL( EPbCmdPlay );
+    }
+}
+
 // EOF
--- a/videoplayback/inc/hbvideobaseplaybackview.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/inc/hbvideobaseplaybackview.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  da1mmcf#15 %
+// Version : %version:  da1mmcf#16 %
 
 
 
@@ -108,6 +108,7 @@
         QTimer                              *mTimerForClosingView;
 
         bool                                 mActivated;
+        bool                                 mSyncClose;
 
     public:
         friend class CMPXVideoViewWrapper;
--- a/videoplayback/videohelix/group/mpxvideohelixplayback.mmp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
  *
 */
 
-// Version : %version: 15 %
+// Version : %version: 17 %
 
 
 
@@ -39,7 +39,6 @@
 SOURCE          mpxvideoplaybackmode.cpp
 SOURCE          mpxvideofiledetails.cpp
 SOURCE          mpxvideoseeker.cpp
-SOURCE          mpxvideodlmgrif.cpp
 SOURCE          mpxvideoaccessoryobserver.cpp
 SOURCE          mpxvideoplayerutility.cpp
 SOURCE          mpxvideodrmhelper.cpp
@@ -67,7 +66,6 @@
 LIBRARY  estor.lib
 LIBRARY  flogger.lib
 LIBRARY  playbackhelper.lib
-LIBRARY  downloadmgr.lib
 LIBRARY  platformenv.lib
 LIBRARY  etel.lib
 LIBRARY  etelmm.lib
--- a/videoplayback/videohelix/inc/mpxvideodlmgrif.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideodlmgrif.h	Fri May 28 09:45:19 2010 +0300
@@ -15,13 +15,15 @@
 *
 */
 
-// Version : %version: 10 %
 
+// Version : %version: 12 %
+
+#ifdef USE_S60_DOWNLOAD_MANAGER 
 
 #ifndef __MPXVIDEODLMGRIF_H__
 #define __MPXVIDEODLMGRIF_H__
 
-#include <DownloadMgrClientApiExt.h>
+#include <downloadmgrclientapiext.h>
 #include <mpxplaybackcommanddefs.h>
 
 //
@@ -135,6 +137,15 @@
          */
         TBool IsDownloadPaused();
 
+        /*
+         *  UpdateDownloadSizeL
+         *
+         *  For DRM protected clips, the download size will be updated using the file handle
+         *
+         *  @since S60 9.2
+         */
+        void UpdateDownloadSizeL();
+
     private:
         /*
          *  CMPDownloadMgrInterface
@@ -220,8 +231,6 @@
 
         void ConvertDMgrStatetoMpxState( TInt32 dmgrState );
 
-        void UpdateDownloadSizeL();
-
         //
         //  Private Members
         //  Not Owned Data
@@ -251,4 +260,6 @@
 
 #endif __MPXVIDEODLMGRIF_H__
 
+#endif // USE_S60_DOWNLOAD_MANAGER 
+
 // End of file
--- a/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h	Fri May 28 09:45:19 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-// Version : %version: 28 %
+// Version : %version: 29 %
 
 
 #ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_
@@ -290,7 +290,9 @@
         friend class CMPXProgressiveDLPlaybackMode;
 
         friend class CMPXVideoSeeker;
+#ifdef USE_S60_DOWNLOAD_MANAGER 
         friend class CMPXVideoDlMgrIf;
+#endif // USE_S60_DOWNLOAD_MANAGER 
         friend class CMPXVideoAccessoryObserver;
         friend class CMpxVideoPlayerUtility;
         friend class CMPXVideoPosterFrameSetter;
--- a/videoplayback/videohelix/inc/mpxvideoplaybackmode.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackmode.h	Fri May 28 09:45:19 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-// Version : %version: 16 %
+// Version : %version: 19 %
 
 
 #ifndef _CMPXVIDEOPLAYBACKMODE_H_
@@ -29,7 +29,9 @@
 #include <e32base.h>
 
 #include "mpxhelixplaybackplugindefs.h"
+#ifdef USE_S60_DOWNLOAD_MANAGER 
 #include "mpxvideodlmgrif.h"
+#endif
 #include "mpxvideo_debug.h"
 
 //
@@ -79,7 +81,6 @@
         virtual void OpenFile64L( const RFile64& aMediaFile );
 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 
-
     protected:
         /*
          *  C++ default constructor
@@ -92,15 +93,12 @@
          */
         virtual void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
 
-
     protected:
         //
         //  Data
         //
         CMPXVideoPlaybackController*        iVideoPlaybackCtlr;   // not owned
-        
         CMPXVideoPosterFrameSetter*         iPosterFrameSetter;
-
 };
 
 /*******************************************************/
@@ -170,21 +168,49 @@
         static CMPXVideoPlaybackMode* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
         virtual ~CMPXProgressiveDLPlaybackMode();
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+
         inline virtual TInt GetMode();
         void ConnectToDownloadL( CMPXCommand& aCmd );
         void HandleOpenComplete();
         void GetPdlStatusL( CMPXCommand& aCmd );
         void UpdateSeekPosition( TInt64& aPosition );
         inline TBool IsDownloadPaused();
+        void OpenFileL( const RFile& aMediaFile );
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        void OpenFile64L( const RFile64& aMediaFile );
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#endif // USE_S60_DOWNLOAD_MANAGER 
 
     private:
-
         void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
     private:
-        CMPXVideoDlMgrIf*  iDlMgrIf;   // owned
+        CMPXVideoDlMgrIf*  iDlMgrIf;   // owned		
+#endif // USE_S60_DOWNLOAD_MANAGER 
+
 };
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+
+inline
+TInt CMPXProgressiveDLPlaybackMode::GetMode()
+{
+    MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()"));
+    return EMPXVideoProgressiveDownload;
+}
+
+inline
+TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused()
+{
+    return iDlMgrIf->IsDownloadPaused();
+}
+
+#endif // USE_S60_DOWNLOAD_MANAGER 
+
 // INLINE METHODS
 
 inline
@@ -217,22 +243,10 @@
 }
 
 inline
-TInt CMPXProgressiveDLPlaybackMode::GetMode()
-{
-    MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()"));
-    return EMPXVideoProgressiveDownload;
-}
-
-inline
 TBool CMPXVideoPlaybackMode::IsDownloadPaused()
 {
     return EFalse;
 }
 
-inline
-TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused()
-{
-    return iDlMgrIf->IsDownloadPaused();
-}
 
 #endif  //_CMPXVIDEOPLAYBACKMODE_H_
--- a/videoplayback/videohelix/src/mpxvideodlmgrif.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideodlmgrif.cpp	Fri May 28 09:45:19 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-// Version : %version: 23 %
+// Version : %version: 25 %
 
 
 #include <MMFROPCustomCommandConstants.h>
@@ -95,7 +95,6 @@
     }
 }
 
-
 void CMPXVideoDlMgrIf::ConnectToDownloadL( CMPXCommand& aCmd )
 {
     MPX_ENTER_EXIT(_L("CMPXVideoDlMgrIf::ConnectToDownloadL()"));
@@ -120,13 +119,14 @@
     //
     //  A new download id has been sent.  Reset member variables
     //
-    iMoveNeeded    = EFalse;
-    iCurrentDl     = NULL;
-    iDlId          = downloadId;
-    iPlayerOpened  = EFalse;
-    iDlTotalSize   = 0;
+    iMoveNeeded       = EFalse;
+    iCurrentDl        = NULL;
+    iDownloadState    = EPbDlStateDownloadCompleted;
+    iDlId             = downloadId;
+    iPlayerOpened     = EFalse;
+    iDlTotalSize      = 0;
     iDownloadProgress = 0;
-    iCodDownload   = EFalse;
+    iCodDownload      = EFalse;
 
     if ( iDlMgrConnected )
     {
@@ -414,11 +414,6 @@
                 //
                 error = HandleCustomCommand( EMMFROPControllerSetDownloadSize, iDownloadProgress );
             }
-
-            //
-            //  Update download size for DRM protected clips
-            //
-            MPX_TRAPD( updateError, UpdateDownloadSizeL() );
         }
     }
 }
@@ -658,9 +653,19 @@
 //
 TReal CMPXVideoDlMgrIf::GetDownloadRatio()
 {
-    TReal downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize;
+    TReal downloadRatio = 0.0;
+    
+    if ( iDownloadState == EPbDlStateDownloadCompleted )
+    {
+        downloadRatio = 100.0;
+    }
+    else
+    {
+        downloadRatio = (TReal)iDownloadProgress / (TReal)iDlTotalSize;
+    }
+    
     MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%f)"), downloadRatio);
-
+    
     return downloadRatio;
 }
 
@@ -671,9 +676,7 @@
 TBool CMPXVideoDlMgrIf::IsDownloadPaused()
 {
     TBool paused = ( iDownloadState == EPbDlStateDownloadPaused );
-
-    MPX_DEBUG(_L("CMPXVideoDlMgrIf::GetDownloadRatio(%d)"), paused);
-
+    MPX_DEBUG(_L("CMPXVideoDlMgrIf::IsDownloadPaused(%d)"), paused);
     return paused;
 }
 
--- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp	Fri May 28 09:45:19 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-// Version : %version: 29 %
+// Version : %version: 32 %
 
 
 //
@@ -70,7 +70,7 @@
 CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()
 {
     MPX_DEBUG(_L("CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()"));
-    
+
     if ( iPosterFrameSetter )
     {
         delete iPosterFrameSetter;
@@ -223,6 +223,12 @@
             MPX_TRAPD( err,
                 iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) );
         }
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() && 
+                  iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+        {
+            // playback not allowed for the clip having video if keylock is true
+            // Let playAllowed remain false
+        }
         else
         {
             playAllowed = ETrue;
@@ -287,7 +293,7 @@
 //  ------------------------------------------------------------------------------------------------
 void CMPXVideoPlaybackMode::HandleFrameReady(TInt /*aError*/)
 {
-    MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()"));        
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()"));
 }
 //************************************************************************************************//
 //          CMPXLocalPlaybackMode
@@ -311,7 +317,7 @@
 void CMPXLocalPlaybackMode::HandleSetPosterFrame()
 {
     MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleSetPosterFrame()"));
-         
+
     // create poster frame setter if it does not already exist
     if ( ! iPosterFrameSetter )
     {
@@ -321,13 +327,13 @@
     if ( iPosterFrameSetter )
     {
         iPosterFrameSetter->RequestPosterFrame();
-    }    
+    }
 }
 
 void CMPXLocalPlaybackMode::HandleFrameReady(TInt aError)
 {
-    MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()"));      
-    
+    MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()"));
+
     iPosterFrameSetter->HandlePosterFrameReady(aError);
 }
 
@@ -423,6 +429,12 @@
             MPX_TRAPD(err,
                       iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ));
         }
+        else if ( iVideoPlaybackCtlr->IsKeyLocked() && 
+                  iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+        {
+            // playback not allowed for the clip having video if keylock is true
+            // Let playAllowed remain false
+        }
         else
         {
             MPX_TRAPD( err,
@@ -557,23 +569,31 @@
 {
     iVideoPlaybackCtlr = aVideoPlaybackCtlr;
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
     //
     //  Create the Download Mgr Interface
     //
     iDlMgrIf = CMPXVideoDlMgrIf::NewL( iVideoPlaybackCtlr );
+#endif // USE_S60_DOWNLOAD_MANAGER 
+
 }
 
 CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()
 {
     MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::~CMPXProgressiveDLPlaybackMode()"));
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
     if ( iDlMgrIf )
     {
         delete iDlMgrIf;
         iDlMgrIf = NULL;
     }
+#endif // USE_S60_DOWNLOAD_MANAGER 
+
 }
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+
 //  ------------------------------------------------------------------------------------------------
 //    CMPXProgressiveDLPlaybackMode::ConnectToDownloadL()
 //  ------------------------------------------------------------------------------------------------
@@ -637,4 +657,30 @@
         KErrNone );
 }
 
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::OpenFileL()
+//  ------------------------------------------------------------------------------------------------
+void CMPXProgressiveDLPlaybackMode::OpenFileL( const RFile& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFileL()"));
+
+    iDlMgrIf->UpdateDownloadSizeL();
+    CMPXVideoPlaybackMode::OpenFileL( aMediaFile );
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+//  ------------------------------------------------------------------------------------------------
+//    CMPXProgressiveDLPlaybackMode::OpenFile64L()
+//  ------------------------------------------------------------------------------------------------
+void CMPXProgressiveDLPlaybackMode::OpenFile64L( const RFile64& aMediaFile )
+{
+    MPX_ENTER_EXIT(_L("CMPXProgressiveDLPlaybackMode::OpenFile64L( RFile64 )"));
+
+    iDlMgrIf->UpdateDownloadSizeL();
+    CMPXVideoPlaybackMode::OpenFile64L( aMediaFile );
+}
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+#endif // USE_S60_DOWNLOAD_MANAGER
+
 // End of file
--- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp	Fri May 28 09:45:19 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-// Version : %version: 43 %
+// Version : %version: 44 %
 
 
 //
@@ -1795,7 +1795,7 @@
 
     if ( aError == KErrNone )
     {
-        if ( iVideoPlaybackCtlr->iAppInForeground )
+        if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
         {
             iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying );
 
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg	Fri May 28 09:45:19 2010 +0300
@@ -54,6 +54,7 @@
 
 ERFile 1
 ERFile64 0
+EMPXVideoLocal 0
 
 [Enddefine]
 
@@ -883,3 +884,32 @@
 delete test
 pause 1000
 [Endtest]
+
+[Test]
+title 61.  InitialiseL link via 32-bit file handle
+create videohelixtest test
+test InitializeStreamingWithSdpFileHandleL ERFile 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest] 
+
+[Test]
+title 62.  InitialiseL link via 64-bit file handle
+create videohelixtest test
+test InitializeStreamingWithSdpFileHandleL ERFile64 60000 10 sdp_test.sdp KErrNone KErrNone KErrNone
+waittestclass test
+delete test
+pause 1000
+[Endtest]
+
+[Test]
+title 63. Retrieve FileName and playback mode -- Custom Commands EPbCmdInitView
+create videohelixtest test
+test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
+waittestclass test
+test RetrieveFileNameAndModeL vhpp_test.3gp EMPXVideoLocal
+pause 1000
+delete test
+pause 1000
+[Endtest] 
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 9 %
+// Version : %version: 11 %
 
 
 
@@ -45,7 +45,6 @@
 SOURCE          videohelixtestbody.cpp
 SOURCE          timeoutcontroller.cpp
 SOURCE          mpxvideoplayerutility_stub.cpp
-SOURCE          dlmgr_stub.cpp
 SOURCE          mpxvideoregion.cpp
 SOURCE          stifutilities.cpp
 SOURCE          mediarecognizer_stub.cpp
@@ -54,7 +53,6 @@
 SOURCE          tnmgr_stub.cpp
 
 SOURCEPATH      ../../../src
-SOURCE          mpxvideodlmgrif.cpp
 SOURCE          mpxvideofiledetails.cpp
 SOURCE          mpxvideohelixplayback.cpp
 SOURCE          mpxvideoplaybackcontroller.cpp
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/dlmgr_stub.h	Fri May 28 09:45:19 2010 +0300
@@ -15,8 +15,9 @@
  *
 */
 
-// Version : %version: 4 %
+// Version : %version: 5 %
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
 
 #ifndef __RHTTPDOWNLOADMGRAPIEXT_H__
 #define __RHTTPDOWNLOADMGRAPIEXT_H__
@@ -188,3 +189,4 @@
 
 #endif // __RHTTPDOWNLOADMGRAPIEXT_H__
 
+#endif // USE_S60_DOWNLOAD_MANAGER 
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
  *
 */
 
-// Version : %version: 14 %
+// Version : %version: e003sa33#15 %
 
 
 #ifndef __VHPPTESTCASE_H__
@@ -172,6 +172,8 @@
         virtual TInt InitializeWithPositionL( CStifItemParser& aItem );
         virtual TInt InitializeLinkWithPositionL( CStifItemParser& aItem );
         virtual TInt InitializeHandleWithPositionL( CStifItemParser& aItem );
+        virtual TInt InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem  );
+        virtual TInt RetrieveFileNameAndModeL( CStifItemParser& aItem );
 
         // ---------------------------------------------------------------------
         //  Helper Functions
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  1 %
+// Version : %version:  2 %
 
 #include <fbs.h>
 #include "tnmgr_stub.h"
@@ -42,7 +42,7 @@
     MPX_ENTER_EXIT(_L("CThumbnailManager::CThumbnailManager() - stub impl"));
 }
 
-TThumbnailRequestId CThumbnailManager::SetThumbnailL( CThumbnailObjectSource& aObjectSource )
+TThumbnailRequestId CThumbnailManager::SetThumbnailL( CThumbnailObjectSource& /* aObjectSource */ )
 {   
     MPX_ENTER_EXIT(_L("CThumbnailManager::SetThumbnailL() - stub impl"));
     return 0;
@@ -63,7 +63,7 @@
     return self;
 }
 
-CThumbnailObjectSource::CThumbnailObjectSource( CFbsBitmap*  aBitmap, const TDesC& aUri )
+CThumbnailObjectSource::CThumbnailObjectSource( CFbsBitmap*  /* aBitmap */ , const TDesC& /* aUri */ )
 {
 }
 
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 23 %
+// Version : %version: e003sa33#24.1.1 %
 
 
 // [INCLUDE FILES] - do not remove
@@ -42,6 +42,7 @@
 #include "mpxmediavideodefs.h"
 #include "mpxvideo_debug.h"
 #include "mpxvideoplayerutility_stub.h"
+#include "mpxhelixplaybackplugindefs.h"
 
 #ifdef __WINSCW__
     _LIT( KVideoTestPath, "c:\\data\\Videos\\" );
@@ -118,7 +119,10 @@
 
         ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
         ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
-        ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL)
+        ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL),
+        ENTRY ( "InitializeStreamingWithSdpFileHandleL", 
+        		CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ),
+        ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL )        
 
         //
         //  ADD NEW ENTRIES HERE
@@ -1142,6 +1146,10 @@
     MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectToDownloadL()"));
     iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()"));
 
+    TInt err = KErrNone;
+    
+#ifdef USE_S60_DOWNLOAD_MANAGER       
+    
     iDlMgrTester = CDlMgrTestClass::NewL();
     iDlMgrTester->AddStifObserver( this );
 
@@ -1152,7 +1160,7 @@
     //
     //   Read in the download id and filename
     //
-    TInt err = aItem.GetNextInt( dlId );
+    err = aItem.GetNextInt( dlId );
 
     if ( err == KErrNone )
     {
@@ -1188,7 +1196,17 @@
             CleanupStack::PopAndDestroy( cmd );
         }
     }
-
+    
+#else // USE_S60_DOWNLOAD_MANAGER    
+     
+	// suppress build warning
+    MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); 
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER
+    
     return err;
 }
 
@@ -1202,6 +1220,8 @@
     MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"),
                    _L("aCustomCmd = %d"), aCustomCmd );
 
+#ifdef USE_S60_DOWNLOAD_MANAGER     
+
     CMPXCommand* cmd = CMPXCommand::NewL();
     CleanupStack::PushL( cmd );
 
@@ -1212,6 +1232,14 @@
     iPlaybackPlugin->CommandL( *cmd );
 
     CleanupStack::PopAndDestroy( cmd );
+	
+#else // USE_S60_DOWNLOAD_MANAGER     
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER
+
 }
 
 // -----------------------------------------------------------------------------
@@ -1224,6 +1252,8 @@
     MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()"));
     iLog->Log(_L("CVHPPTestClass::PauseDownloadL()"));
 
+#ifdef USE_S60_DOWNLOAD_MANAGER   
+    
     TCallbackEvent* event = new TCallbackEvent;
 
     event->iEvent = EPDownloadStateChanged;
@@ -1233,7 +1263,14 @@
     AddExpectedEvent( event );
 
     iDlMgrTester->PauseDownload();
-
+    
+#else // USE_S60_DOWNLOAD_MANAGER    
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
     return KErrNone;
 }
 
@@ -1247,9 +1284,13 @@
     MPX_ENTER_EXIT(_L("CVHPPTestClass::ResumeDownloadL()"));
     iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()"));
 
+    TInt err = KErrNone;
+    
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+    
     TInt dlSize;
 
-    TInt err = aItem.GetNextInt( dlSize );
+    err = aItem.GetNextInt( dlSize );
 
     if ( err == KErrNone )
     {
@@ -1273,7 +1314,17 @@
 
         iDlMgrTester->ResumeDownload();
     }
-
+    
+#else // USE_S60_DOWNLOAD_MANAGER    
+     
+	// suppress build warning
+    MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); 
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
     return err;
 }
 
@@ -1287,6 +1338,8 @@
     MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()"));
     iLog->Log(_L("CVHPPTestClass::CancelDownloadL()"));
 
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+    
     TCallbackEvent* event = new TCallbackEvent;
 
     event->iEvent = EPDownloadStateChanged;
@@ -1297,6 +1350,13 @@
 
     iDlMgrTester->CancelDownload();
 
+#else // USE_S60_DOWNLOAD_MANAGER    
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
     return KErrNone;
 }
 
@@ -1310,6 +1370,10 @@
     MPX_ENTER_EXIT(_L("CVHPPTestClass::RetrievePdlStatusL()"));
     iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()"));
 
+    TInt err = KErrNone;
+    
+#ifdef USE_S60_DOWNLOAD_MANAGER 
+    
     TInt pdlState;
     TInt expectedPdlState;
     TInt downloadedBytes;
@@ -1320,7 +1384,7 @@
     //
     //   Read in the expected download data
     //
-    TInt err = aItem.GetNextInt( expectedPdlState );
+    err = aItem.GetNextInt( expectedPdlState );
 
     if ( err == KErrNone )
     {
@@ -1368,6 +1432,16 @@
         CleanupStack::PopAndDestroy( cmd );
     }
 
+#else // USE_S60_DOWNLOAD_MANAGER 
+     
+	// suppress build warning
+    MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); 
+	
+	// Signal TestScripter to continue from waittestclass
+    Signal();
+	
+#endif // USE_S60_DOWNLOAD_MANAGER 
+    
     return err;
 }
 
@@ -1548,6 +1622,8 @@
 void
 CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback )
 {
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent"));
+    
     if ( iExpectedCallbackArray->Count() > 0 )
     {
         TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0];
@@ -2352,4 +2428,164 @@
     return err;
 }
 
+TInt
+CVHPPTestClass::InitializeStreamingWithSdpFileHandleL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
+    iLog->Log(_L("CVHPPTestClass::InitializeStreamingWithSdpFileHandleL()"));
+
+    TInt duration;
+    TInt volumeSteps;
+    TInt fileHandle32;
+    
+    TInt err = aItem.GetNextInt( fileHandle32 );
+    
+    if ( err == KErrNone )
+    {        
+    
+#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        //
+        // set RFile as default if the 64-bit flag is not defined
+        //
+        fileHandle32 = ETrue;
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+        
+        err = aItem.GetNextInt( duration );
+    
+        if ( err == KErrNone )
+        {
+            //
+            //  We will always get an Init Complete message out
+            //
+            TCallbackEvent* event = new TCallbackEvent;
+    
+            event->iEvent = EPInitialised;
+            event->iData  = duration;
+            event->iError = KErrNone;
+    
+            AddExpectedEvent( event );
+    
+            // 
+            // read number of volume steps
+            //
+            err = aItem.GetNextInt( volumeSteps );
+            
+            if ( err == KErrNone )
+            {        
+                //
+                // set volume steps
+                //
+                SetVolumeSteps( volumeSteps );
+               
+                TBuf<120> fullPath;
+                err = ReadFileInitializationParameters( aItem, fullPath );
+
+                if ( err == KErrNone )
+                {
+					PreparePluginL();
+					
+					MPX_DEBUG( _L("Initialize the Plugin:  link = %S"), &fullPath );
+					iLog->Log( _L("Initialize the Plugin:  link = %S"), &fullPath );
+					
+					//
+					//  Extract the streaming link from the ram file and
+					//  Initalize the Plugin with the file handle and an access point
+					//
+					RFs fs;
+					TInt error = fs.Connect();
+					
+					if ( fileHandle32 )
+					{
+						RFile file;
+						error = file.Open( fs, fullPath, EFileRead | EFileShareAny );
+						
+						MPX_DEBUG( _L("Initialize the Plugin:  file open error = %d"),
+								error );   
+						
+						User::LeaveIfError( error );
+				  
+						iPlaybackPlugin->InitStreamingL( file, 11 );
+						file.Close();
+					}
+    #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+					else
+					{
+						RFile64 file64;
+						error = file64.Open( fs, fullPath, EFileRead | EFileShareAny  );
+						
+						MPX_DEBUG( _L("Initialize the Plugin:  file open error = %d"),
+								error );
+						
+						User::LeaveIfError( error );
+						
+						iPlaybackPlugin->InitStreaming64L( file64, 11 );
+						file64.Close();
+					}
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+					
+					fs.Close();
+                }
+            } 
+        } 
+    } 
+    return err;
+}
+
+TInt
+CVHPPTestClass::RetrieveFileNameAndModeL( CStifItemParser& aItem )
+{
+    MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
+    iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") );
+
+    TBuf<120>	fullPath;
+    TPtrC		fileName;
+    TInt		err;
+    
+    err = aItem.GetNextString( fileName );
+
+    if ( err == KErrNone )
+    {
+        //
+        //  Build the full path to the file
+        //
+        fullPath.Append( KVideoTestPath );
+        fullPath.Append( fileName );
+        
+        TInt mode;
+        err = aItem.GetNextInt( mode);
+        
+        if ( err == KErrNone )
+        {
+ 			CMPXCommand* cmd = CMPXCommand::NewL();
+			CleanupStack::PushL( cmd );
+	
+			cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
+			cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId,
+										 KMPXMediaIdVideoPlayback );
+			cmd->SetTObjectValueL<TInt>( KMPXMediaVideoPlaybackCommand, EPbCmdInitView );
+			
+			iPlaybackPlugin->CommandL( *cmd );
+			
+			TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) );
+			TMPXVideoMode  playbackMode = (TMPXVideoMode) cmd->ValueTObjectL<TInt>( KMPXMediaVideoMode );
+	
+			MPX_DEBUG( _L("    Expected Data:  filename = %S, playbackmode= %d" ),
+				 &fullPath, mode );
+			
+			MPX_DEBUG( _L("    Retrieved Data: filename = %S, playbackmode= %d"),
+				 &clipName, playbackMode );
+			
+			if ( fullPath.Compare( clipName) != 0 || mode != playbackMode )
+			{
+			    err = KErrGeneral;
+				MPX_DEBUG( _L("    err = %d"), err );
+			}
+			
+			CleanupStack::PopAndDestroy( cmd );
+        }
+    }
+
+    return err;
+}
+
 //  EOF
--- a/videoplayerapp/bwins/videoplayerengineu.def	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/bwins/videoplayerengineu.def	Fri May 28 09:45:19 2010 +0300
@@ -51,4 +51,6 @@
 	?setCurrentView@QVideoPlayerEngine@@AAEXXZ @ 50 NONAME ; void QVideoPlayerEngine::setCurrentView(void)
 	?sortRole@VideoServices@@QBEHXZ @ 51 NONAME ; int VideoServices::sortRole(void) const
 	?isPlayServiceInvoked@QVideoPlayerEngine@@AAE_NXZ @ 52 NONAME ; bool QVideoPlayerEngine::isPlayServiceInvoked(void)
+	?shouldActivateCollectionView@QVideoPlayerEngine@@AAE_NXZ @ 53 NONAME ; bool QVideoPlayerEngine::shouldActivateCollectionView(void)
+	?shouldExit@QVideoPlayerEngine@@AAE_NXZ @ 54 NONAME ; bool QVideoPlayerEngine::shouldExit(void)
 
--- a/videoplayerapp/eabi/videoplayerengineu.def	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/eabi/videoplayerengineu.def	Fri May 28 09:45:19 2010 +0300
@@ -51,4 +51,6 @@
 	_ZN18QVideoPlayerEngine14setCurrentViewEv @ 50 NONAME
 	_ZNK13VideoServices8sortRoleEv @ 51 NONAME
 	_ZN18QVideoPlayerEngine20isPlayServiceInvokedEv @ 52 NONAME
+	_ZN18QVideoPlayerEngine10shouldExitEv @ 53 NONAME
+	_ZN18QVideoPlayerEngine28shouldActivateCollectionViewEv @ 54 NONAME
 
--- a/videoplayerapp/inc/videoplayerengine.h	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/inc/videoplayerengine.h	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 13 %
+// Version : %version: 14 %
 
 #ifndef VIDEOPLAYERENGINE_H
 #define VIDEOPLAYERENGINE_H
@@ -81,7 +81,11 @@
         
         void setCurrentView();
         
-        bool isPlayServiceInvoked();        
+        bool isPlayServiceInvoked();  
+        
+        bool shouldExit();
+        
+        bool shouldActivateCollectionView();
 
     private:
         bool                      mIsService;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/resources/service_conf.xml	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+  <name>videoplayer</name>
+  <filepath>No path</filepath>
+  <description>Video services</description>
+  <interface>
+     <name>IVideoFetch</name>
+     <version>1.0</version>
+     <description>Interface to fetch video URI</description>
+     <customproperty key="deprecatedsn">Video Fetcher</customproperty>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.IVideoFetch</name>
+     <version>1.0</version>
+     <description>Interface to fetch video URI</description>
+   </interface>
+  <interface>
+     <name>IVideoBrowse</name>
+     <version>1.0</version>
+     <description>Interface to browse categorized video content</description>
+     <customproperty key="deprecatedsn">Video Browse</customproperty>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.IVideoBrowse</name>
+     <version>1.0</version>
+     <description>Interface to browse categorized video content</description>
+   </interface>
+  <interface>
+     <name>IVideoView</name>
+     <version>1.0</version>
+     <description>Interface to play a video</description>
+     <customproperty key="deprecatedsn">Video View</customproperty>
+  </interface>
+  <interface>
+     <name>com.nokia.symbian.IVideoView</name>
+     <version>1.0</version>
+     <description>Interface to play a video</description>
+  </interface>  
+  <interface>
+     <name>com.nokia.symbian.IFileView</name>
+     <version>1.0</version>
+     <description>Interface for playing video given a QFile</description>
+  </interface>   
+</service>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/rom/videoplayer.iby	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: videoplayer.iby
+*
+*/
+
+
+#ifndef __VIDEOPLAYER_IBY__
+#define __VIDEOPLAYER_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_EXE(videoplayer)
+data=DATAZ_/PRIVATE/10003A3F/import/APPS/videoplayer_reg.rsc    private/10003a3f/import/apps/videoplayer_reg.rsc
+data=DATAZ_\install\videoplayer_stub.sis                        system\install\videoplayer_stub.sis 
+
+#endif  // __VIDEOPLAYER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/rom/videoplayerresources.iby	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: videoplayerresources.iby
+*
+*/
+
+
+#ifndef __VIDEOPLAYERRESOURCES_IBY__
+#define __VIDEOPLAYERRESOURCES_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_RESOURCE(videoplayer)
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\videos.qm                       QT_TRANSLATIONS_DIR\videos.qm 
+
+#endif  // __VIDEOPLAYERRESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/create_videoplayer_udeb_sisx.bat	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,21 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+REM Make qt videoplayer udeb sisx file (contains hb -libraries)
+
+call makesis videoplayer_udeb.pkg videoplayer_udeb.sis
+call signsis videoplayer_udeb.sis videoplayer_udeb.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoplayer_udeb.sis
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/create_videoplayer_urel_sisx.bat	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,21 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+REM Make qt videoplayer urel sisx file (contains hb -libraries)
+
+call makesis videoplayer_urel.pkg videoplayer_urel.sis
+call signsis videoplayer_urel.sis videoplayer_urel.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoplayer_urel.sis
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,66 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+# {"videoplayer"}, (0x200211FE), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+;
+; Collection Plugin
+;
+"" - "z:\sys\bin\vcxmyvideoscollectionplugin.dll" 
+"" - "z:\resource\plugins\vcxmyvideoscollectionplugin.r*" 
+
+;
+; Playback Plugin
+;
+"" - "z:\sys\bin\mpxvideohelixplayback.dll" 
+"" - "z:\resource\plugins\mpxvideohelixplayback.r*" 
+
+;
+; Video playback view
+;
+"" - "z:\sys\bin\hbvideoplaybackview.dll" 
+"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll" 
+"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*" 
+
+;
+; Collection view and wrapper
+;
+"" - "z:\sys\bin\videocollectionview.dll" 
+"" - "z:\resource\plugins\videocollectionview.r*" 
+"" - "z:\sys\bin\videocollectionwrapper.dll" 
+"" - "z:\sys\bin\videofiledetailsview.dll" 
+"" - "z:\resource\plugins\videofiledetailsview.r*" 
+
+;
+; Executable and default resource files
+;
+"" - "z:\sys\bin\videoplayerengine.dll" 
+"" - "z:\sys\bin\videoplayer.exe" 
+"" - "z:\resource\apps\videoplayer.r*" 
+"" - "z:\private\10003a3f\import\apps\videoplayer_reg.r*" 
+"" - "z:\resource\qt\translations\videos.qm"
+
+
Binary file videoplayerapp/videoplayer/sis/videoplayer_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,64 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+(0x2001E61C),4,6,0,{"QtLibs pre-release"}
+
+;
+; Collection Plugin
+;
+"/epoc32/release/armv5/udeb/vcxmyvideoscollectionplugin.dll"      - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
+"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
+
+;
+; Playback Plugin
+;
+"/epoc32/release/armv5/udeb/mpxvideohelixplayback.dll"            - "!:/sys/bin/mpxvideohelixplayback.dll"
+"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc"       - "!:/resource/plugins/mpxvideohelixplayback.rsc"
+
+; Collection view and wrapper
+"/epoc32/release/armv5/udeb/videocollectionview.dll"              - "!:/sys/bin/videocollectionview.dll"
+"/epoc32/data/z/resource/plugins/videocollectionview.rsc"         - "!:/resource/plugins/videocollectionview.rsc"
+"/epoc32/release/armv5/udeb/videocollectionwrapper.dll"           - "!:/sys/bin/videocollectionwrapper.dll"
+"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc"        - "!:/resource/plugins/videofiledetailsview.rsc"
+"/epoc32/release/armv5/udeb/videofiledetailsview.dll"             - "!:/sys/bin/videofiledetailsview.dll"
+
+; Executable and default resource files
+"/epoc32/release/armv5/udeb/videoplayerengine.dll"                - "!:/sys/bin/videoplayerengine.dll"
+"/epoc32/release/armv5/udeb/videoplayer.exe"                      - "!:/sys/bin/videoplayer.exe"
+"/epoc32/data/z/resource/apps/videoplayer.rsc"                    - "!:/resource/apps/videoplayer.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
+"/epoc32/data/z/resource/qt/translations/videos_en.qm"            - "!:/resource/qt/translations/videos.qm"
+
+"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc"   - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll"              - "!:/sys/bin/hbvideoplaybackview.dll"
+"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll"        - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,64 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"videoplayer"},(0x200211FE),1,0,0,TYPE=SA, RU
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+(0x2001E61C),4,6,0,{"QtLibs pre-release"}
+
+;
+; Collection Plugin
+;
+"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll"      - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
+"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
+
+;
+; Playback Plugin
+;
+"/epoc32/release/armv5/urel/mpxvideohelixplayback.dll"            - "!:/sys/bin/mpxvideohelixplayback.dll"
+"/epoc32/data/z/resource/plugins/mpxvideohelixplayback.rsc"       - "!:/resource/plugins/mpxvideohelixplayback.rsc"
+
+; Collection view and wrapper
+"/epoc32/release/armv5/urel/videocollectionview.dll"              - "!:/sys/bin/videocollectionview.dll"
+"/epoc32/data/z/resource/plugins/videocollectionview.rsc"         - "!:/resource/plugins/videocollectionview.rsc"
+"/epoc32/release/armv5/urel/videocollectionwrapper.dll"           - "!:/sys/bin/videocollectionwrapper.dll"
+"/epoc32/data/z/resource/plugins/videofiledetailsview.rsc"        - "!:/resource/plugins/videofiledetailsview.rsc"
+"/epoc32/release/armv5/urel/videofiledetailsview.dll"             - "!:/sys/bin/videofiledetailsview.dll"
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/videoplayerengine.dll"                - "!:/sys/bin/videoplayerengine.dll"
+"/epoc32/release/armv5/urel/videoplayer.exe"                      - "!:/sys/bin/videoplayer.exe"
+"/epoc32/data/z/resource/apps/videoplayer.rsc"                    - "!:/resource/apps/videoplayer.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
+"/epoc32/data/z/resource/qt/translations/videos_en.qm"            - "!:/resource/qt/translations/videos.qm"
+
+"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc"   - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/urel/hbvideoplaybackview.dll"              - "!:/sys/bin/hbvideoplaybackview.dll"
+"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll"        - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/src/main.cpp	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of main.cpp
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include <QObject>
+#include <QTranslator>
+#include <QLocale>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <xqserviceutil.h>
+
+#include "videoplayerengine.h"
+
+int main(int argc, char *argv[])
+{
+    HbApplication app(argc, argv);
+
+    // Load the translation file.
+    QString lang = QLocale::system().name();
+
+    QTranslator translator;
+
+    bool loaded(false);
+
+    loaded = translator.load( "videos_" + lang, QString("c:/resource/qt/translations") );
+
+    if (!loaded)
+    {
+        translator.load("videos_" + lang, QString("z:/resource/qt/translations") );
+    }
+
+    // Install the translator
+    app.installTranslator(&translator);
+
+    QTranslator translatorCommon;
+
+    loaded = false;
+
+    loaded = translatorCommon.load( "common_" + lang, QString("c:/resource/qt/translations") );
+
+    if (!loaded)
+    {
+        translatorCommon.load("common_" + lang, QString("z:/resource/qt/translations") );
+    }
+
+    // Install the common translator
+    app.installTranslator(&translatorCommon);
+
+    // has the application been launched via XQ Service Framework
+    bool isService = XQServiceUtil::isService();
+
+     if (!isService)
+     {
+        app.setApplicationName(hbTrId("txt_videos_title_videos"));
+     }
+
+    HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
+    mainWindow.setAttribute( Qt::WA_OpaquePaintEvent );
+
+    QVideoPlayerEngine *engine = new QVideoPlayerEngine(isService);
+    engine->initialize();
+    mainWindow.show();
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayer/videoplayer.pro	Fri May 28 09:45:19 2010 +0300
@@ -0,0 +1,78 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: Project file for building Videoplayer components
+#
+#
+# Version : %version: 1 %
+
+
+TARGET = videoplayer
+CONFIG += hb service
+TEMPLATE = app
+TRANSLATIONS += videos.ts
+
+symbian: 
+{ 
+    TARGET.CAPABILITY = ALL -DRM -TCB
+    TARGET.EPOCHEAPSIZE = 0x20000 0x1600000
+    TARGET.UID3 = 0x200211FE
+	SKINICON = qtg_large_video_tv.svg 
+
+    BLD_INF_RULES.prj_exports += "rom/videoplayer.iby          CORE_APP_LAYER_IBY_EXPORT_PATH(videoplayer.iby)" \
+                                 "rom/videoplayerresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(videoplayerresources.iby)" \
+                                 "sis/videoplayer_stub.sis     /epoc32/data/z/system/install/videoplayer_stub.sis"
+}
+
+# Service provider specific configuration.
+SERVICE.FILE = resources/service_conf.xml
+SERVICE.OPTIONS = embeddable
+# Service provider specific configuration ends
+
+INCLUDEPATH += .
+INCLUDEPATH += ../inc \
+               ../../inc \
+               /epoc32/include/mw/hb/hbtools
+
+LIBS += -lvideoplayerengine.dll \
+        -lxqservice.dll \
+        -lxqserviceutil.dll
+
+VPATH += src
+
+SOURCES += main.cpp
+
+RSS_RULES += \
+"    datatype_list =                                                                              " \
+"        {                                                                                        " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, 											" \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"video/msvideo\"; },                  " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-msvideo\"; },          " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-pn-realvideo\"; },           " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio\"; },           " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"video/vnd.rn-realvideo\"; },         " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"application/vnd.rn-realmedia\"; },   " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; },     " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; },    " \
+"        DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; },               " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-wmv\"; },                   " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-asf\"; },                   " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gp\"; },                        " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp2\"; },                      " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp\"; },                       " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mp4\"; },                        " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-m4v\"; },                      " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mpeg4\"; },                      " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"application/ram\"; },                  " \
+"        DATATYPE { priority=EDataTypePriorityHigh; type=\"application/sdp\"; }                   " \
+"        };                                                                                       " \          
--- a/videoplayerapp/videoplayerapp.pro	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/videoplayerapp.pro	Fri May 28 09:45:19 2010 +0300
@@ -14,10 +14,10 @@
 # Description: Project file for building Videoplayer components
 #
 #
-# Version : %version: 4 %
+# Version : %version: 5 %
 
 
 TEMPLATE   = subdirs
 CONFIG    += ordered
 SUBDIRS   += videoplayerengine \
-             hbvideoplayer
+             videoplayer
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  4 %
+// Version : %version:  ou1cpsw#5 %
 
 
 #include "mpxvideo_debug.h"
@@ -59,6 +59,7 @@
 
     TRAPD( err, mUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this ) );
     MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::initializePlugins err = %d"), err);
+    Q_UNUSED(err);
 }
 
 // -------------------------------------------------------------------------------------------------
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#30 %
+// Version : %version: da1mmcf#31 %
 
 
 #include <QApplication>
@@ -249,57 +249,52 @@
         mCurrentViewPlugin = NULL;
     }
 
-    if ( viewType == MpxHbVideoCommon::CollectionView && mCollectionViewPlugin  ) 
+    switch ( viewType )
     {
-        if ( mIsService &&  
-             ( mVideoServices->currentService() == VideoServices::EPlayback ||
-               mVideoServices->currentService() == VideoServices::EView || 
-               mVideoServices->currentService() == VideoServices::EUriFetcher ) )
+        case MpxHbVideoCommon::CollectionView:
         {
-            if ( mVideoServices->currentService() == VideoServices::EUriFetcher )
-            {
-                if ( ! mVideoServices->mFetchSelected )    
-                {
-                    // 
-                    // view is in 'fetch' service but 'attach' operation has not been selected,
-                    // therefore, go back to collection view
-                    //
-                    mCurrentViewPlugin = mCollectionViewPlugin;
-                    setCurrentView();                    
-                }
-            }
-            else
+            if ( shouldExit() )
             {
                 qApp->quit();
-                XQServiceUtil::toBackground( false );
+                XQServiceUtil::toBackground( false );             
             }
-        }
-        else
-        {
-            mCurrentViewPlugin = mCollectionViewPlugin;
-            setCurrentView();
-        }
-    }
-    else if ( viewType == MpxHbVideoCommon::PlaybackView ) 
-    {
-        if ( ! mPlaybackViewPlugin )
-    	{
-            loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+            else if ( shouldActivateCollectionView()  )
+            {
+                if ( ! mCollectionViewPlugin )
+                {
+                    loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
+                }            
+                mCurrentViewPlugin = mCollectionViewPlugin;
+                setCurrentView();                    
+            }
+            
+            break;    
         }
-		
-        mCurrentViewPlugin = mPlaybackViewPlugin;
-        setCurrentView();
-    }
-    else if ( viewType == MpxHbVideoCommon::VideoDetailsView ) 
-    {
-        if ( ! mFileDetailsViewPlugin )
-    	{
-            loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );	
-    	}
-		
-        mCurrentViewPlugin = mFileDetailsViewPlugin;
-        setCurrentView();
-    }
+        case MpxHbVideoCommon::PlaybackView:
+        {
+            if ( ! mPlaybackViewPlugin )
+            {
+                loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+            }
+            
+            mCurrentViewPlugin = mPlaybackViewPlugin;
+            setCurrentView();     
+            
+            break;    
+        }
+        case MpxHbVideoCommon::VideoDetailsView:
+        {
+            if ( ! mFileDetailsViewPlugin )
+            {
+                loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );  
+            }
+            
+            mCurrentViewPlugin = mFileDetailsViewPlugin;
+            setCurrentView();       
+            
+            break;    
+        }        
+    }    
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -517,4 +512,47 @@
     return result;
 }
 
+// -------------------------------------------------------------------------------------------------
+// shouldExit()
+// -------------------------------------------------------------------------------------------------
+//
+bool QVideoPlayerEngine::shouldExit()
+{            
+    bool result = false;
+    
+    if ( mIsPlayService )  // play or view service
+    {
+        result = true;               
+    }
+    
+    MPX_DEBUG(_L("QVideoPlayerEngine::shouldExit() return %d"), result);     
+    
+    return result;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// shouldActivateCollectionView()
+// -------------------------------------------------------------------------------------------------
+//
+bool QVideoPlayerEngine::shouldActivateCollectionView()
+{            
+    bool result = true;  
+    
+    // the only case where collection view should NOT be activated is ...
+    // if we are in service and that service is fetch and if fetch is selected 
+    // in all other cases collection view should be activated
+    
+    if ( mIsService &&
+         mVideoServices->currentService() == VideoServices::EUriFetcher &&
+         mVideoServices->mFetchSelected  )
+    {
+        result = false;                    
+    }  
+        
+    MPX_DEBUG(_L("QVideoPlayerEngine::shouldActivateCollectionView() return %d"), result);     
+    
+    return result;
+}
+
 // End of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp	Fri May 14 15:14:51 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp	Fri May 28 09:45:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: da1mmcf#12 %
+// Version : %version: da1mmcf#13 %
 
 // INCLUDES
 #include <QtTest/QtTest>
@@ -221,9 +221,9 @@
 
     mTestObject->initialize();
 
-    QVERIFY(mTestObject->mCurrentViewPlugin != 0);
-    QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
-    QVERIFY(mTestObject->mCollectionViewPlugin != 0);
+    QVERIFY(mTestObject->mCurrentViewPlugin == 0);
+    QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
+    QVERIFY(mTestObject->mCollectionViewPlugin == 0);
     QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
     QVERIFY(mTestObject->mPlaybackWrapper != 0);
     QVERIFY(mTestObject->mVideoServices != 0);
@@ -231,7 +231,6 @@
     QVERIFY(VideoServices::mReferenceCount == 1);
 
     QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mPlaybackViewPlugin);
-    QVERIFY(mTestObject->mCollectionViewPlugin != mTestObject->mFileDetailsViewPlugin);
 
     cleanup();
 
@@ -298,9 +297,9 @@
 
     mTestObject->initialize();
 
-    QVERIFY(mTestObject->mCurrentViewPlugin != 0);
-    QVERIFY(mTestObject->mPlaybackViewPlugin == 0);
-    QVERIFY(mTestObject->mCollectionViewPlugin != 0);
+    QVERIFY(mTestObject->mCurrentViewPlugin == 0);
+    QVERIFY(mTestObject->mPlaybackViewPlugin != 0);
+    QVERIFY(mTestObject->mCollectionViewPlugin == 0);
     QVERIFY(mTestObject->mFileDetailsViewPlugin == 0);
     QVERIFY(mTestObject->mVideoServices != 0);
     QVERIFY(mTestObject->mIsService == true);