Update Modello web samples from upstream; version up 96/23796/1
authorDongxing Liu <dongxing.x.liu@intel.com>
Thu, 3 Jul 2014 06:29:30 +0000 (14:29 +0800)
committerDongxing Liu <dongxing.x.liu@intel.com>
Thu, 3 Jul 2014 06:48:21 +0000 (14:48 +0800)
Change-Id: I1c67c17b5d0abfe2d9e6502e3ef3b2d9daa041e5
Signed-off-by: Dongxing Liu <dongxing.x.liu@intel.com>
package/changelog
package/pkginfo.manifest
samples/web/Sample/Tizen/Web App/Modello_Homescreen/project/config.xml
samples/web/Sample/Tizen/Web App/Modello_Multimediaplayer/project/js/mediacontent.js
samples/web/Sample/Tizen/Web App/Modello_Multimediaplayer/project/js/remotecontent.js
samples/web/Sample/Tizen/Web App/Modello_Multimediaplayer/project/packaging/modello-multimediaplayer.changes

index 1f8046c..b443cce 100644 (file)
@@ -1,3 +1,7 @@
+* 3.0.15
+* Update Modello web samples from upstream
+== Dongxing Liu <dongxing.x.liu@intel.com> 2014-07-03
+
 * 3.0.14
 * Add Modello web sample snapshots
 == Dongxing Liu <dongxing.x.liu@intel.com> 2014-06-30
index 3b9f50e..5e7560c 100644 (file)
@@ -1,4 +1,4 @@
-Version:3.0.14
+Version:3.0.15
 Maintainer: Ziv Chang<ziv.chang@intel.com>
 
 Package:ivi-3.0-web-sample
index 028a8f6..31b3f9b 100644 (file)
@@ -6,7 +6,7 @@
                package="Modello005" required_version="2.1" />
        <content src="index.html" />
        <icon src="icon.png" />
-       <name>Modello Home Screen</name>
+       <name>Modello Homescreen</name>
        <tizen:privilege name="http://tizen.org/privilege/application.launch" />
        <tizen:privilege name="http://tizen.org/privilege/filesystem.read" />
        <tizen:privilege name="http://tizen.org/privilege/filesystem.write" />
index c76a35c..2c12a9f 100644 (file)
@@ -66,6 +66,10 @@ mediacontent.MediaContainer = function(proxy) {
        this.type = "CONTAINER";
        this.directoryURI = "";
        this.storageType = "EXTERNAL";
+       this.title = proxy.title;
+       if (this.id === undefined)
+               this.id = proxy.id;
+
        return this;
 };
 
@@ -83,16 +87,17 @@ mediacontent.MediaItem = function(proxy) {
        "use strict";
        mediacontent.MediaObject.call(this, proxy);
        if (proxy) {
-               this.mimeType = proxy.MIMEType;
+               this.mimeType = proxy.mimeType;
                if (proxy.URLs) {
                        this.contentURI = proxy.URLs[0];
                } else {
-                       this.contentURI = "";
+                       this.contentURI = proxy.sourceUri;
                }
-               this.size = proxy.Size;
-               this.releaseDate = proxy.Date;
+               this.size = proxy.fileSize;
+               this.releaseDate = proxy.createDate;
                this.modifiedDate = null;
-               this.name = this.title;
+               this.name = proxy.title;
+               this.title = proxy.title;
                this.editableAttributes = [];
                this.thumbnailURIs = [];
                if (!!proxy.AlbumArtURL && proxy.AlbumArtURL !== "") {
@@ -119,17 +124,26 @@ mediacontent.MediaVideo = function(proxy) {
        "use strict";
        mediacontent.MediaItem.call(this, proxy);
        if (proxy) {
-               this.duration = proxy.Duration * 1000; //Tizen's ContentVideo is in ms
-               this.width = proxy.Width;
-               this.height = proxy.Height;
+               this.duration = proxy.duration * 1000; //Tizen's ContentVideo is in ms
+               this.width = proxy.width;
+               this.height = proxy.height;
                if (proxy.Album) {
                        this.album = proxy.Album;
-               } else {
+               }
+               else if (proxy.collection) {
+                       this.album = proxy.collection;
+               }
+               else {
                        this.album = "Unknown";
                }
+
                if (proxy.Artist) {
                        this.artists = [ proxy.Artist ];
-               } else {
+               }
+               else if (proxy.author) {
+                        this.artists = [ proxy.author ];
+                }
+               else {
                        this.artists = [ "Unknown" ];
                }
                this.geolocation = null;
@@ -152,16 +166,18 @@ mediacontent.MediaAudio = function(proxy) {
        "use strict";
        mediacontent.MediaItem.call(this, proxy);
        if (proxy) {
-               this.bitrate = proxy.SampleRate;
-               this.duration = proxy.Duration * 1000; //Tizen's ContentAudio is in ms
+               this.bitrate = proxy.audioSampleRate;
+               this.duration = proxy.duration * 1000; //Tizen's ContentAudio is in ms
                if (proxy.Album) {
                        this.album = proxy.Album;
                } else {
                        this.album = "Unknown";
                }
-               //this;
                if (proxy.Artist) {
                        this.artists = [ proxy.Artist ];
+               }
+               else if (proxy.author) {
+                        this.artists = [ proxy.author ];
                } else {
                        this.artists = [ "Unknown" ];
                }
@@ -169,7 +185,10 @@ mediacontent.MediaAudio = function(proxy) {
                this.composers = [ "Unknown" ];
                this.lyrics = null;
                this.copyright = "Unknown";
-               this.trackNumber = 0;
+               if (proxy.trackNumber)
+                       this.trackNumber = proxy.trackNumber;
+               else
+                       this.trackNumber = 0;
        }
        this.type = "AUDIO";
        return this;
@@ -189,8 +208,8 @@ mediacontent.MediaImage = function(proxy) {
        "use strict";
        mediacontent.MediaItem.call(this, proxy);
        if (proxy) {
-               this.width = proxy.Width;
-               this.height = proxy.Height;
+               this.width = proxy.width;
+               this.height = proxy.height;
                this.orientation = "NORMAL";
        }
        this.type = "IMAGE";
@@ -209,17 +228,19 @@ mediacontent.MediaImage.prototype.constructor = mediacontent.MediaImage;
  */
 mediacontent.mediaObjectForProps = function(props) {
        "use strict";
-       if (props.Type.indexOf("container") === 0 || props.Type.indexOf("album") === 0 || props.Type.indexOf("person") === 0 || props.Type.indexOf("genre") === 0){
+
+       if (props.type.indexOf("container") === 0 || props.type.indexOf("album") === 0 || props.type.indexOf("person") === 0 || props.type.indexOf("genre") === 0){
                return new mediacontent.MediaContainer(props);
        }
-       if (props.Type.indexOf("video") === 0){
+       if (props.type.indexOf("video") === 0){
                return new mediacontent.MediaVideo(props);
        }
-       if (props.Type.indexOf("audio") === 0 || props.Type.indexOf("music") === 0){
+       if (props.type.indexOf("audio") === 0 || props.type.indexOf("music") === 0){
                return new mediacontent.MediaAudio(props);
        }
-       if (props.Type.indexOf("image") === 0){
+       if (props.type.indexOf("image") === 0 || props.type.indexOf("picture") === 0) {
                return new mediacontent.MediaImage(props);
        }
+
        return new mediacontent.MediaItem(props);
 };
index 86bbb84..c8b0563 100644 (file)
@@ -13,7 +13,7 @@
 var RemoteContent = function() {
        "use strict";
        var self = this;
-       this.mediaServer = tizen.mediaserver;
+       this.mediaServer = navigator.mediaServer; //tizen.mediaserver;
        this.mediaSources = ko.observableArray([]);
        this.selectedMediaSource = ko.observable(null);
 
@@ -63,12 +63,11 @@ RemoteContent.prototype.scanMediaServerNetwork = function() {
        var self = this;
        if (!!self.mediaServer) {
                self.clearDisappearedMediaSources();
-               self.mediaServer.scanNetwork(function(source) {
-                       self.addMediaSource(source);
-               }, function(err) {
-                       console.log("An error has occured while scanning network: " + err.message);
-                       console.log(err);
-               });
+
+               self.mediaServer.addEventListener('serverfound', function(source) {
+                        self.addMediaSource(source.server);
+                });
+               self.mediaServer.scanNetwork();
        }
 };
 
@@ -84,7 +83,10 @@ RemoteContent.prototype.addMediaSource = function(source) {
        console.log(source);
        if (!!source) {
                if (!source.friendlyName) {
-                       return;
+                       for(var key in source) {
+                           var value = source[key];
+                           if (source.hasOwnProperty(key))
+                       }
                }
                source.timestamp = new Date().getTime();
                var sourceExists = false;
@@ -321,7 +323,7 @@ RemoteContent.prototype.browseMediaSourceContainer = function(source, container)
 
                if (jsonArray.length === browseCount) {
                        browseOffset += browseCount;
-                       source.browse(container.id, "+DisplayName", browseCount, browseOffset, browseContainerCB, browseErrorCB);
+                       source.browse(container.id, "+DisplayName", browseCount, browseOffset).then(browseContainerCB);
                } else {
                        self.currentBrowseOperation = "";
                }
@@ -333,7 +335,7 @@ RemoteContent.prototype.browseMediaSourceContainer = function(source, container)
 
        self.currentBrowseOperation = localOp;
 
-       source.browse(container.id, "+DisplayName", browseCount, browseOffset, browseContainerCB, browseErrorCB);
+       source.browse(container.id, "+DisplayName", browseCount, browseOffset).then(browseContainerCB)
 };
 
 /**
@@ -366,4 +368,4 @@ RemoteContent.prototype.getVideoFromSelectedContainer = function() {
                });
        }
        return [];
-};
\ No newline at end of file
+};
index a1be983..a8117c5 100644 (file)
@@ -1,3 +1,6 @@
+* Thu Jun 26 2014 brianjjones <brian.j.jones@intel.com> accepted/tizen/ivi/20140526.130731-1-g635ff71
+- Updates to use the slightly altered mediaserver API
+
 * Thu May 22 2014 brianjjones <brian.j.jones@intel.com> submit/tizen_ivi/20140508.232656@1f1125d
 - Fixes for IVI-3190 - To get things to render normally