cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benn Mapes (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-1593) WP7 : Media callback called multiple times
Date Mon, 21 Jan 2013 22:38:13 GMT

    [ https://issues.apache.org/jira/browse/CB-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559177#comment-13559177
] 

Benn Mapes commented on CB-1593:
--------------------------------

Update:

We have two bugs going on here, the first is that occasionally (maybe 1 out of 5 times) the
first call to play the media will get a 'System.ArgumentException' when trying to add the
AudioPlayer to the Media.players Dictionary in the Media plugin. I'm not sure how this exception
gets fired because everything looks ok when it's getting added but then the exception fires
anyway.

The second bug, as mentioned, is that there are multiple callbacks to the javascript and more
get added each time the media is played. It starts with about 2 callbacks and each time the
media gets played another 1-2 get added so we end up with a ton of callbacks each time the
media gets played.
I believe this bug is happening somewhere in the bridge because on the native side it only
fires the callbacks once when it needs to, and then we get a bunch of callbacks out the other
end (javascript).

If anyone has any insight as to whats going on here feel free to chime in. I'll keep working
on them...

                
> WP7 : Media callback called multiple times
> ------------------------------------------
>
>                 Key: CB-1593
>                 URL: https://issues.apache.org/jira/browse/CB-1593
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 2.1.0
>         Environment: Nokia Lumia 800 with WP 7.5 (7.10.8773.98).
>            Reporter: Christophe A. Guilmart
>            Assignee: Benn Mapes
>            Priority: Critical
>
> When using this code
>           function play(){
>             cordovaMedia = new Media("app/www/test.mp3", onSuccess, onError, onStatus);
>             cordovaMedia.play();
> 		  }
> 		  
> I encounter the following problems:
> * 1st call to play() does not work (ie: I don't hear the sound). nor are the callback
called.
> * following play work, but callback are called multiple times.
> * onError is called even when play sound is successful (ie: when I can hear the sound).
> * if onStatus callback is not provided, an error show up in the log.
> Expected behavior:
> * onError & onSuccess should be exclusive. One OR the other should be called. Not
both.
> * onError & onSuccess should be called only once per call to .play()
> h3. VS Output:
> Log:"Received Event: deviceready"
> Log:"----------------------------------"
> Log:"# media play 0"
> 'UI Task' (Managed): Loaded 'Microsoft.Xna.Framework.dll'
> 'UI Task' (Managed): Loaded 'System.SR.dll'
> Log:"----------------------------------"
> Log:"# media play 1"
> Log:"####### media On Error. error: Value does not fall within the expected range. code:
undefined message: undefined"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"----------------------------------"
> INFO: startPlayingAudio FOUND mediaPlayer for b43e2cd0-bafb-f6d3-add6-79428f19e324
> Log:"# media play 2"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"----------------------------------"
> Log:"# media play 3"
> Log:"####### media On Error. error: Value does not fall within the expected range. code:
undefined message: undefined"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 1"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media OnStatus: 2"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> Log:"# media OnStatus: 4"
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media On success. "
> Log:"# media OnStatus: 4"
> h3. index.html
> [...]
>         <script type="text/javascript">
>           app.initialize();
>           function onError (error){
>           var s = "####### media On Error. ";
>           if ((typeof error === "undefined") || (error==null)){
>           s = s + " no error info."
>           } else {
>           s = s +  "error: " + error +
>           ' code: '    + error.code    +
>           ' message: ' + error.message;
>           }
>           console.log(s);
>           }
>           function onSuccess (){
>           var s = "# media On success. ";
>           console.log(s);
>           }
>           function onStatus (status){
>           var s = "# media OnStatus: " + status;
>           console.log(s);
>           }
>           var playcounter = 0;
>           function play(){
>           console.log("----------------------------------");
>           var s = "# media play " + playcounter;
>           console.log(s);
>           cordovaMedia = new Media("app/www/test.mp3", onSuccess, onError, onStatus);
>           cordovaMedia.play();
>           playcounter++;
>           }
>         </script>
>       <p onclick="play();">Click to Play MP3</p>
>       
>     </body>
> </html>
> h3. My Config:
> * cordova : 2.1.0-0-g26d211b
> * template "full"
> * Nokia Lumia 800
> * Version OS : 7.10.8773.98 (commercial : 7.5)
> * Microsoft Visual Studio 2010
> Version WPDTRTMRel - 40219.209
> Microsoft .NET Framework
> Version 4.0.30319 SP1Rel
> Installed Version: PD Express

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message