Commit 832bc3fd authored by Xiaowu Zhang's avatar Xiaowu Zhang

add mozMediaSource & audio/mpeg for firefox

parent b36a9816
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/*jslint nomen: true, maxlen:180 */ /*jslint nomen: true, maxlen:180 */
(function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) { (function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict"; "use strict";
var gk = rJS(window), AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudiocontext || window.msAudioContext, audioCtx = new AudioContext(), MediaSource = window.MediaSource || window.WebKitMediaSource, myLoopEventListener = function(target, type, callback, allowDefault) { var gk = rJS(window), AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudiocontext || window.msAudioContext, audioCtx = new AudioContext(), MediaSource = window.MediaSource || window.WebKitMediaSource || window.mozMediaSource, myLoopEventListener = function(target, type, callback, allowDefault) {
////////////////////////// //////////////////////////
// Infinite event listener (promise is never resolved) // Infinite event listener (promise is never resolved)
// eventListener is removed when promise is cancelled/rejected // eventListener is removed when promise is cancelled/rejected
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<script id="rows-template" type="text/x-handlebars-template"> <script id="rows-template" type="text/x-handlebars-template">
{{#each rows}} {{#each rows}}
<li> <li>
{{#compare this.doc.type "audio/mp3"}} {{#compare this.doc.type}}
<a href=#page=control&id={{this.id}}&action=offline> <a href=#page=control&id={{this.id}}&action=offline>
{{this.doc.title}} {{this.doc.title}}
</a> </a>
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
}); });
}).push(function(e) { }).push(function(e) {
var tmp = e.data.rows, i, j, exp; var tmp = e.data.rows, i, j, exp;
Handlebars.registerHelper("compare", function(v1, v2, options) { Handlebars.registerHelper("compare", function(v1, options) {
if (v1 === v2) { if (v1 === "audio/mp3" || v1 === "audio/mpeg") {
return options.fn(this); return options.fn(this);
} }
return options.inverse(this); return options.inverse(this);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
*/ */
(function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) { (function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict"; "use strict";
var gk = rJS(window), MediaSource = window.MediaSource || window.WebKitMediaSource; var gk = rJS(window), MediaSource = window.MediaSource || window.WebKitMediaSource || window.mozMediaSource;
gk.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment").declareAcquiredMethod("jio_get", "jio_get").declareAcquiredMethod("jio_remove", "jio_remove").declareAcquiredMethod("plSave", "plSave").declareAcquiredMethod("plGive", "plGive").declareAcquiredMethod("displayThisPage", "displayThisPage").declareAcquiredMethod("displayThisTitle", "displayThisTitle").declareAcquiredMethod("allDocs", "allDocs").declareAcquiredMethod("plEnablePage", "plEnablePage").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareMethod("render", function(options) { gk.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment").declareAcquiredMethod("jio_get", "jio_get").declareAcquiredMethod("jio_remove", "jio_remove").declareAcquiredMethod("plSave", "plSave").declareAcquiredMethod("plGive", "plGive").declareAcquiredMethod("displayThisPage", "displayThisPage").declareAcquiredMethod("displayThisTitle", "displayThisTitle").declareAcquiredMethod("allDocs", "allDocs").declareAcquiredMethod("plEnablePage", "plEnablePage").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareMethod("render", function(options) {
var g = this; var g = this;
if (options.id) { if (options.id) {
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
AudioContext = window.AudioContext || window.webkitAudioContext AudioContext = window.AudioContext || window.webkitAudioContext
|| window.mozAudiocontext || window.msAudioContext, || window.mozAudiocontext || window.msAudioContext,
audioCtx = new AudioContext(), audioCtx = new AudioContext(),
MediaSource = window.MediaSource || window.WebKitMediaSource, MediaSource = window.MediaSource || window.WebKitMediaSource
|| window.mozMediaSource,
myLoopEventListener = function (target, type, callback, myLoopEventListener = function (target, type, callback,
allowDefault) { allowDefault) {
////////////////////////// //////////////////////////
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<script id="rows-template" type="text/x-handlebars-template"> <script id="rows-template" type="text/x-handlebars-template">
{{#each rows}} {{#each rows}}
<li> <li>
{{#compare this.doc.type "audio/mp3"}} {{#compare this.doc.type}}
<a href=#page=control&id={{this.id}}&action=offline> <a href=#page=control&id={{this.id}}&action=offline>
{{this.doc.title}} {{this.doc.title}}
</a> </a>
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
i, i,
j, j,
exp; exp;
Handlebars.registerHelper("compare", function (v1, v2, options) { Handlebars.registerHelper("compare", function (v1, options) {
if (v1 === v2) { if (v1 === "audio/mp3" || v1 === "audio/mpeg") {
return options.fn(this); return options.fn(this);
} }
return options.inverse(this); return options.inverse(this);
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
(function (window, rJS, RSVP, loopEventListener, $, promiseEventListener) { (function (window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict"; "use strict";
var gk = rJS(window), var gk = rJS(window),
MediaSource = window.MediaSource || window.WebKitMediaSource; MediaSource = window.MediaSource || window.WebKitMediaSource
|| window.mozMediaSource;
gk.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") gk.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_remove", "jio_remove") .declareAcquiredMethod("jio_remove", "jio_remove")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment