videoplayerapp/videoplayerengine/src/videoplayerengine.cpp
changeset 24 7d93ee07fb27
parent 20 b9e04db066d4
child 28 c48470be1ba7
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp	Fri May 14 15:53:50 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp	Thu May 27 12:53:14 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 27 %
+// Version : %version: da1mmcf#30 %
 
 
 #include <QApplication>
@@ -39,6 +39,7 @@
     : mIsService( isService )
     , mEmbedded( false )
     , mDelayedLoadDone( false )
+    , mIsPlayService( false )
     , mCurrentViewPlugin( 0 )
     , mPlaybackViewPlugin( 0 )
     , mCollectionViewPlugin( 0 )
@@ -120,25 +121,22 @@
 
     QList<XQPluginInfo> impls;
     XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls);
-
-    //
-    // Pre-load collection plugin and create collection view
-    //
-    loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
-    
-    //
-    // if app is opened via serviceFW create remaining views
-    // otherwise activate default view i.e. the collection view.    
-    //
-    if ( mIsService )
+        
+    if ( isPlayServiceInvoked() )
     {
         createPlayAndDetailsViews(); 
     }
     else
-    {        
-        activateView( MpxHbVideoCommon::CollectionView );
+    {
+        loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );   
+
+        if((mIsService && !(XQServiceUtil::interfaceName().contains("IVideoBrowse"))) || !mIsService)
+        {
+        	//Browse service will activate view once the category to be opened is informed from highway
+        	activateView( MpxHbVideoCommon::CollectionView );
+        }
     }
-        
+            
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -224,7 +222,9 @@
         loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
     }
 
-    if ( ! mFileDetailsViewPlugin )
+    // details view need not be created for playback via serviceFW
+    if ( ! mIsPlayService && 
+         ! mFileDetailsViewPlugin )
     {
         loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
     }
@@ -492,5 +492,29 @@
     }
 }
 
+// -------------------------------------------------------------------------------------------------
+// isPlayServiceInvoked()
+// -------------------------------------------------------------------------------------------------
+//
+bool QVideoPlayerEngine::isPlayServiceInvoked()
+{
+    MPX_ENTER_EXIT(_L("QVideoPlayerEngine::isPlayServiceInvoked()"));       
+    
+    bool result = false;   
+    
+    if ( mIsService )
+    {
+        QString intface = XQServiceUtil::interfaceName();
+                        
+        if ( intface.contains("IVideoView") ||
+             intface.contains("IFileView") )
+        {
+            result = true;
+            mIsPlayService = true;
+        }
+    }
+    
+    return result;
+}
 
 // End of file