You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Jesse MacFadyen (JIRA)" <ji...@apache.org> on 2012/07/13 23:12:33 UTC

[jira] [Updated] (CB-988) AudioPlayer Bug when settings another media

     [ https://issues.apache.org/jira/browse/CB-988?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse MacFadyen updated CB-988:
-------------------------------

    Fix Version/s:     (was: 2.0.0)
                   2.1.0

Revisit this when we evaluate the Audio apis.
The attached code would mean that only one sound could play at a time, although the comment is correct that they should be removed.
                
> AudioPlayer Bug when settings another media
> -------------------------------------------
>
>                 Key: CB-988
>                 URL: https://issues.apache.org/jira/browse/CB-988
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.9.0
>         Environment: Emulator
>            Reporter: Dan Ardelean
>            Assignee: Jesse MacFadyen
>             Fix For: 2.1.0
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Inside the AudioPlayer.cs     public void startPlaying(string filePath) before adding a MediaElement again to the LayoutRoot you should take the ole one out. Tried to reuse also but if it's the same audio file stream it will not work
> I have added 
>   for(int i=0;i<grid.Children.Count;i++)
>                                     if ((grid.Children[i].GetType() == typeof(MediaElement)) && (((MediaElement)grid.Children[i]).Name.CompareTo("playerMediaElement") == 0))
>                                     {
>                                         grid.Children.RemoveAt(i);
>                                         i = grid.Children.Count;
>                                     }
> After:
>  Grid grid = page.FindName("LayoutRoot") as Grid;
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira