Exemple #1
0
        void m_player_PlayAudio(object sender, PlayerHandler.PlayAudioEventArgs e)
        {
            string functionName = null;

            if (e.Filename.EndsWith(".wav", StringComparison.InvariantCultureIgnoreCase))
            {
                functionName = "playWav";
            }
            if (e.Filename.EndsWith(".mp3", StringComparison.InvariantCultureIgnoreCase))
            {
                functionName = "playMp3";
            }

            if (functionName == null)
            {
                return;
            }

            string url = m_player.GetURL(e.Filename);

            m_buffer.AddJavaScriptToBuffer(
                functionName,
                new StringParameter(url),
                new BooleanParameter(e.Synchronous),
                new BooleanParameter(e.Looped));
        }