src/js/model.js
branchplayers-as-widgets
changeset 959 ee11ed1b739e
parent 957 4da0a5740b6c
child 964 d7d56ea2d0a6
--- a/src/js/model.js	Mon Sep 17 22:44:59 2012 +0900
+++ b/src/js/model.js	Tue Sep 18 15:39:28 2012 +0900
@@ -452,7 +452,7 @@
 
 /* Default functions to be overriden by players */
 
-IriSP.Model.Media.prototype.getCurrentTime = function() { return 0; }
+IriSP.Model.Media.prototype.getCurrentTime = function() {  return new IriSP.Model.Time(0); }
 
 IriSP.Model.Media.prototype.getVolume = function() { return .5; }
 
@@ -664,6 +664,23 @@
     }
 }
 
+/* Default functions to be overriden by players */
+
+IriSP.Model.Mashup.prototype.getCurrentTime = function() { return new IriSP.Model.Time(0); }
+
+IriSP.Model.Mashup.prototype.getVolume = function() { return .5; }
+
+IriSP.Model.Mashup.prototype.getPaused = function() { return true; }
+
+IriSP.Model.Mashup.prototype.getMuted = function() { return false; }
+
+IriSP.Model.Mashup.prototype.setCurrentTime
+    = IriSP.Model.Mashup.prototype.setVolume
+    = IriSP.Model.Mashup.prototype.setMuted
+    = IriSP.Model.Mashup.prototype.play
+    = IriSP.Model.Mashup.prototype.pause
+    = function() {}
+
 /* */
 
 IriSP.Model.Source = function(_config) {
@@ -786,11 +803,8 @@
 }
 
 IriSP.Model.Source.prototype.getCurrentMedia = function(_opts) {
-    if (typeof _opts === "undefined") {
-        var _opts = {};
-    }
-    if (typeof this.currentMedia === "undefined" || _opts.override) {
-        if (_opts.mashup) {
+    if (typeof this.currentMedia === "undefined") {
+        if (_opts.is_mashup) {
             var _mashups = this.getMashups();
             if (_mashups.length) {
                 this.currentMedia = _mashups[0];