DLNA plugin doesn't currently give a signal that it failed to connect. So a interval... 53/10253/2 submit/tizen/20130925.235244
authorbrianjjones <brian.j.jones@intel.com>
Wed, 25 Sep 2013 23:38:43 +0000 (16:38 -0700)
committerbrianjjones <brian.j.jones@intel.com>
Wed, 25 Sep 2013 23:40:36 +0000 (16:40 -0700)
Change-Id: I5c84f3a2910c3cb10c0eeb24c5c6a9d3a3f040a3

js/dlna.js
js/main.js
packaging/MediaPlayer.changes

index ebebe2e..4d9242b 100644 (file)
@@ -84,29 +84,26 @@ function findAllCallback(medias)
                switch(current.type)
                {
                        case "AUDIO":
-                               console.log("MediaPlayer: Remote server found audio " + current);
                                audioContent.push(current);
-                               console.log("MediaPlayer: Remote added audiocontent now = " + audioContent);
                                itemsAdded += 1;
                                break;
                        case "VIDEO":
-                               console.log("MediaPlayer: Remote server found video " + current);
                                videoContent.push(current);
-                               console.log("MediaPlayer: Remote added videocontent now = " + videoContent);
                                itemsAdded += 1;
                                break;
                        case "IMAGE":
-                               console.log("MediaPlayer: Remote server found image " + current);
                                imageContent.push(current);
-                               console.log("MediaPlayer: Remote added imagecontent now = " + imageContent);
                                itemsAdded += 1;
                                break;
                        default:
-                               console.log("MediaPlayer: Remote media failed to push content, not == AUDIO/VIDEO/IMAGE");
                }
                }
        }
 
+       //Force MediaPlayer to reload the lists so the new items show
+       audioMediaListLoaded = false;
+       videoMediaListLoaded = false;
+       imageMediaListLoaded = false;
 }
 
 function foundMediaServer(srv)
@@ -115,6 +112,8 @@ function foundMediaServer(srv)
        console.log("MediaServer id: " + srv.id);
        console.log("MediaServer friendlyName: " + srv.friendlyName);
 
+       clearInterval(stopServerSearch);
+
        if (srv.root)
        {
                console.log("MediaPlayer: MediaServer root folder: " + srv.root.id);
index 5124c12..7cc1b8d 100644 (file)
@@ -47,6 +47,7 @@ var mediaNameCTX;
 var speechObj;
 var nightMode = false;
 var waitingToResumeVideo = false;              //Media has been paused by exterior forces.  If set to true, resume previous media when given the signal.
+var stopServerSearch;
 
 var mainMenuTitleTemplateLandscape = {"font" : "oblique bolder 30pt arial", "lineWidth" : 9.5, "fillStyle" : "black", "strokeStyle" : "white", "textAlign" : "left",
                "largeShadow" : 8, "shadowOffsetX" : 0, "shadowOffsetY" : 0, "shadowBlur" : 45, "shadowColor" : "rgba(255, 187, 0, 0.4)"};
@@ -869,7 +870,10 @@ function init()
        //Check if DLNA plugin is installed.  If so, scan for media.
        if (tizen.mediaserver)
        {
-               tizen.mediaserver.scanNetwork(foundMediaServer);
+               //Currently no success signal, so continue trying until a server is found.  Once that
+               //happens, clear the stopServerSearch interval
+
+               stopServerSearch = setInterval(function(){console.log("MediaPlayer searching for remote media..."); tizen.mediaserver.scanNetwork(foundMediaServer);}, 5000);
        }
        else
                console.log("MediaPlayer: No DLNA server running, using local media only...");
index 2340ce2..cfd915b 100644 (file)
@@ -1,5 +1,11 @@
+* Wed Sep 25 2013 brianjjones <brian.j.jones@intel.com> submit/tizen/20130925.145436@899c31e
+- DLNA plugin doesn't currently give a signal that it failed to connect.  So a interval call
+  has been added to continue trying until successfull.
+
 * Tue Sep 24 2013 brianjjones <brian.j.jones@intel.com> submit/tizen/20130920.001725@98ab50d
-- Update to the fillMediaList method.  This breaks it into pieces so the rest of the app can continue to be used. This helps speed up the app and gives it a snappier feel. Signed-off-by: brianjjones <brian.j.jones@intel.com>
+- Update to the fillMediaList method.  This breaks it into pieces so the rest of the app can
+  continue to be used. This helps speed up the app and gives it a snappier feel.
+  Signed-off-by: brianjjones <brian.j.jones@intel.com>
 
 * Thu Sep 19 2013 brianjjones <brian.j.jones@intel.com> accepted/tizen/20130918.185209@7d7f65c
 - Removing the wait for album art, instead a default image will be used until it's ready.