llaske / sugarizer

Sugarizer is a web implementation of the Sugar platform to run on any device or browser
https://sugarizer.org
Apache License 2.0
197 stars 412 forks source link

Abecedarium Activity not working on mobile resolutions in file:/// #684

Open ksraj123 opened 4 years ago

ksraj123 commented 4 years ago

On launching the Abecedarium Activity on mobile resolutions it gives a reference error in the console. The play mode does not work giving similar error again making the check button non functional. The error pops up only where sound was supposed to be played. This error is there only on mobile resolutions and the activity works normally on desktop resolution.

abcd not working

Here is the error message -

audio.js:124 Uncaught ReferenceError: Media is not defined
    at playMedia (audio.js:124)
    at e.HTML5.Audio.play() [as play] (audio.js:152)
    at enyo.instance.Abcd.Audio.play() [as play] (audio.js:240)
    at enyo.instance.Abcd.App.playTheme() [as playTheme] (app.js:60)
    at enyo.instance.Abcd.App.rendered() [as rendered] (app.js:38)
    at enyo.instance.t.rendered (enyo.js:12)
    at enyo.instance.enyo.Control.renderInto() [as renderInto] (enyo.js:171)
    at activity.js:38
    at e.<anonymous> (database.js:59)
    at Object.enyo.call (enyo.js:24)
llaske commented 4 years ago

Hmmm. Strange, the error appears only when launched locally.

llaske commented 4 years ago

I've explored the problem. The issue is related to the fact than when Chrome simulate the Mobile mode, he tells to the navigator that it runs on Android (or iOS). Running on Android and using file:/// prefix means for the Abecedarium activity (should be the case for other activities too) that it runs into Cordova (see here). So, Abecedarium try to use Cordova audio plugin that obviously doesn't exist in this context. Because this error can't happen in real life (it's not possible to run Sugarizer directly from the Android file system), it concern only developers so I'm changing the issue label from bug to enhancement.