System.Html.AudioElement.AddEventListener C# (CSharp) Method

AddEventListener() public method

public AddEventListener ( AudioElementEvents type, System.Action listener ) : void
type AudioElementEvents
listener System.Action
return void
        public void AddEventListener(AudioElementEvents type, Action listener)
        {
        }

Same methods

AudioElement::AddEventListener ( AudioElementEvents type, System.Action listener, bool capture ) : void
AudioElement::AddEventListener ( AudioElementEvents type, HtmlEventHandler listener ) : void
AudioElement::AddEventListener ( AudioElementEvents type, HtmlEventHandler listener, bool capture ) : void
AudioElement::AddEventListener ( AudioElementEvents type, HtmlEventHandlerWithTarget listener ) : void
AudioElement::AddEventListener ( AudioElementEvents type, HtmlEventHandlerWithTarget listener, bool capture ) : void
AudioElement::AddEventListener ( AudioElementEvents type, IEventListener listener ) : void
AudioElement::AddEventListener ( AudioElementEvents type, IEventListener listener, bool capture ) : void
AudioElement::AddEventListener ( string type, HtmlEventHandlerWithTarget listener ) : void
AudioElement::AddEventListener ( string type, HtmlEventHandlerWithTarget listener, bool capture ) : void

Usage Example

Example #1
0
        //public AudioOverlay(RenderContext renderContext, TourStop owner, string filename)
        //{
        //    isDesignTimeOnly = true;
        //    X = 0;
        //    Y = 0;
        //    this.filename = Guid.NewGuid().ToString() + filename.Substr(filename.LastIndexOf("."));
        //    this.Owner = owner;
        //    this.Name = owner.GetNextDefaultName("Audio");
        //    // File.Copy(filename, Owner.Owner.WorkingDirectory + this.filename);
        //}
        public override void InitializeTexture()
        {
            if (audio == null)
            {
                audio = (AudioElement)Document.CreateElement("audio");
                //audio.AutoPlay = true;
                //audio.MediaFailed += new EventHandler<ExceptionRoutedEventArgs>(audio_MediaFailed);
                //audio.MediaOpened += new RoutedEventHandler(audio_MediaOpened);
                //Viewer.MasterView.audio.Children.Add(audio);
                audio.Src = Owner.Owner.GetFileStream(this.filename);
                audio.AddEventListener("canplaythrough", delegate
                {
                    audioReady = true;
                    audio_MediaOpened();
                    audio.Play();
                }, false);

            }
        }