videoplayerapp/videoplayerengine/src/videoplayerengine.cpp
changeset 38 ff53afa8ad05
parent 37 4eb2df7f7cbe
child 39 f6d44a0cd476
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp	Fri Apr 30 09:52:11 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp	Fri May 14 15:14:51 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