(hoofbeats) Migrates to Tizen 2.0 'content' webapi.
authorSalvatore Iovene <salvatore@iovene.com>
Thu, 31 Jan 2013 11:11:22 +0000 (13:11 +0200)
committerSalvatore Iovene <salvatore@iovene.com>
Thu, 31 Jan 2013 11:11:22 +0000 (13:11 +0200)
examples/hoofbeats/javascripts/library.js
examples/hoofbeats/tests/config.xml

index 29b887c..494a0b5 100644 (file)
@@ -24,7 +24,6 @@ $(function() {
                 "UNION", [this.audioTypeFilter, this.videoTypeFilter]);
 
             this.sortMode = new tizen.SortMode("trackNumber", "ASC");
-            this.mediaSource = tizen.mediacontent.getLocalMediaSource();
         };
 
         this.scan = function() {
@@ -33,8 +32,8 @@ $(function() {
             this.mediaItems = [];
             this.fetchOffset = 0;
 
-            this.mediaSource.findItems(
-                this.findItemsCB.bind(this),
+            tizen.content.find(
+                this.findCB.bind(this),
                 this.errorCB.bind(this),
                 null,
                 this.typeFilter,
@@ -48,7 +47,7 @@ $(function() {
             throw new Error(error.name);
         };
 
-        this.findItemsCB = function(items) {
+        this.findCB = function(items) {
             var self = this;
 
             items.forEach(function(item, index, items) {
@@ -61,8 +60,8 @@ $(function() {
             if (items.length == this.fetchCount) {
                 // There *might* be more items.
                 this.fetchOffset += this.fetchCount;
-                this.mediaSource.findItems(
-                    this.findItemsCB.bind(this),
+                tizen.content.find(
+                    this.findCB.bind(this),
                     this.errorCB.bind(this),
                     null,
                     this.typeFilter,
index 3303221..e640120 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://otc.intel.com/hoofbeats-unittests" version="1.0.0" viewmodes="fullscreen">\r
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://otc.intel.com/hoofbeats-unittests" version="1.0.0">\r
     <name>Hoofbeats Unit Tests</name>\r
     <icon src="icon.png"/>\r
     <tizen:application id="1234567891" required_version="1.0"/>\r
@@ -7,7 +7,7 @@
     <access origin="*" subdomains="true"/>\r
 \r
     <feature name="http://tizen.org/privilege/application" required="false"/>\r
-    <feature name="http://tizen.org/privilege/content" required="false"/>\r
+    <feature name="http://tizen.org/privilege/content.read" required="true"/>\r
     <feature name="http://tizen.org/privilege/filesystem" required="false"/>\r
     <feature name="http://tizen.org/privilege/time" required="true"/>\r
     <feature name="http://tizen.org/privilege/tizen" required="true"/>\r