Saving of the localStorage now occurs after the file has successfully loaded 70/10970/1 accepted/tizen/ivi/stable accepted/tizen/20131015.185352 accepted/tizen/20131112.015545 accepted/tizen_ivi_stable/20131116.005238 submit/tizen/20131015.175409 submit/tizen_ivi_stable/20131116.001906 submit/tizen_ivi_stable/20131116.005403
authorbrianjjones <brian.j.jones@intel.com>
Tue, 15 Oct 2013 17:31:51 +0000 (10:31 -0700)
committerbrianjjones <brian.j.jones@intel.com>
Tue, 15 Oct 2013 17:32:27 +0000 (10:32 -0700)
Change-Id: I1742301187a0ce6cd05cfb22823cc1673cbd730c

js/audioPlayer.js
js/imagePlayer.js
js/videoPlayer.js
packaging/MediaPlayer.changes

index c4b2089..3081f78 100644 (file)
@@ -87,18 +87,6 @@ AudioPlayer.prototype.load = function(index, play)
        this.playerControls.pause();
        this.updateMediaName(this.content[this.listIndex].artists[0], this.content[this.listIndex].title, this.content[this.listIndex].coverArt);
        $("#audioSrc").attr("src", this.content[this.listIndex].contentURI);
-
-       //Only store track to localStorage if it's a local file, and current menu is the Audio menu
-       if (!this.content[this.listIndex].remoteFile && localStorage.prevMenu === "mainMusicButton")
-       {
-               localStorage.prevAudioTrack = this.content[this.listIndex].contentURI;
-       }
-       else
-       {
-               localStorage.prevAudioTime = undefined;
-               localStorage.prevAudioTrack = undefined;
-       }
-
        this.playerControls.load();
 }
 
@@ -162,6 +150,17 @@ AudioPlayer.prototype.playLoadedMedia = function()
        console.log("MediaPlayer in playLoadedMedia");
        this.currentFileLoaded = true;
 
+       //Only store track to localStorage if it's a local file, and current menu is the Audio menu
+       if (!this.content[this.listIndex].remoteFile && localStorage.prevMenu === "mainMusicButton")
+       {
+               localStorage.prevAudioTrack = this.content[this.listIndex].contentURI;
+       }
+       else
+       {
+               localStorage.prevAudioTime = undefined;
+               localStorage.prevAudioTrack = undefined;
+       }
+
        this.currentAudioContent = this.content[this.listIndex];
 
        if (this.loadPrevAudio)
index e5d4f59..97da62c 100644 (file)
@@ -93,6 +93,9 @@ ImagePlayer.prototype.load = function(index)
 {
        this.listIndex = index;
 
+       $("#imagePlayer").css("background", "url(" + this.content[this.listIndex].contentURI + ") no-repeat center");
+       $("#imagePlayer").css("background-size", "contain");
+
        if (!this.content[this.listIndex].remoteFile)
        {
                localStorage.prevImage = this.content[this.listIndex].contentURI;
@@ -101,9 +104,6 @@ ImagePlayer.prototype.load = function(index)
        {
                localStorage.prevImage = undefined;
        }
-
-       $("#imagePlayer").css("background", "url(" + this.content[this.listIndex].contentURI + ") no-repeat center");
-       $("#imagePlayer").css("background-size", "contain");
 }
 
 ImagePlayer.prototype.makeListItem = function(j, k)
index 559f2a2..fef2111 100644 (file)
@@ -79,9 +79,14 @@ VideoPlayer.prototype.load = function(index, play)
 {
        this.listIndex = index;
        this.loadAndPlay = play;
-       this.currentVideoContent = this.content[this.listIndex];
        this.playerControls.pause();
        $("#videoSrc").attr("src", this.content[this.listIndex].contentURI);
+       this.playerControls.load();
+}
+
+VideoPlayer.prototype.videoLoaded = function()
+{
+       this.currentVideoContent = this.content[this.listIndex];
 
        //Only store track to localStorage if it's a local file, and current menu is the Video menu
        if (!this.content[this.listIndex].remoteFile && localStorage.prevMenu === "mainVideoButton")
@@ -94,11 +99,6 @@ VideoPlayer.prototype.load = function(index, play)
                localStorage.prevVideoTime = undefined;
        }
 
-       this.playerControls.load();
-}
-
-VideoPlayer.prototype.videoLoaded = function()
-{
        if (this.loadPrevVideo)
        {
                this.playerControls.currentTime = localStorage.prevVideoTime;
index f092b0f..02ad2b0 100644 (file)
@@ -1,3 +1,6 @@
+* Tue Oct 15 2013 brianjjones <brian.j.jones@intel.com> submit/tizen/20131015.010041@0cdd066
+- Saving of the localStorage now occurs after the file has successfully loaded
+
 * Mon Oct 14 2013 brianjjones <brian.j.jones@intel.com> submit/tizen/20131010.205318@a65dc75
 - Image player will now remember what image it was last on