My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 45074: HTML MediaElement "ended" event, doesn't fire
13 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  sergeyu@chromium.org
Closed:  Jul 2010
M-6

Restricted
  • Only users with EditIssue permission may comment.


Sign in to add a comment
 
Reported by johnpaul...@gmail.com, May 26, 2010
Chrome Version       : 6.0.414.0 (48010) Ubuntu
URLs (if applicable) : http://jsfiddle.net/x5VRq/1/
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: OK
  Firefox 3.x: OK
IE 7:
IE 8:

What steps will reproduce the problem?
1. goto http://jsfiddle.net/x5VRq/1/
2. click "click to run test"
3. hear no female audio

What is the expected result?

a female voice follows the initial male voice, the female voice begins when 
an "ended" event is fired from the initial male voice element.

What happens instead?

no female voice


Please provide any additional information below. Attach a screenshot if
possible.

https://code.google.com/p/chromium/issues/detail?id=30452

I've raised this ticket again, as the above link isn't getting any 
attention. I don't think it's because I'm impatient, as normally at least 
one of the Chrome devs responds before now. I'm wondering if the ticket 
above is filtered, as it's FIXED.

Please note, I get an ended event on Chrome Dev Channel w32. I will 
investigate OSX, although friends have told me that the playlist feature of 
YouTube ceases to work when using HTML5 video. So perhaps the issue is 
there also.

Also to note, I can get an event to fire off, if I load a page on another 
tab. Can be any page, a google search, slashdot, etc.

If this ticket is to be canned as a dupe, because of the above ticket, 
that's fine. But can somoneone reopen ticket 30452.

thanks.

jp

May 26, 2010
#1 suna...@chromium.org
I don't see the issue on Windows and Linux(ubuntu 8.04 with 415.1). Can you try with 
official Chrome build instead of Chromium?
Labels: FeedbackRequested
May 26, 2010
#2 johnpaul...@gmail.com
I don't see it in Windows either, I did say that in the initial ticket. Also, please 
note, this issue hasn't been fixed for me, since that previous, fixed, ticket 
(https://code.google.com/p/chromium/issues/detail?id=30452). I've been using some 
version of Chomium Linux, dev, beta, nightly, and on Ubuntu 9.10 and the issue was 
never fixed as the ticket got cleared. I was away from email and the ability to test 
while the issue was getting resolved.

As for retesting on an official build of Chrome Linux, I'll do this later. I'm kind 
of confused why I need to test on such an old version of Chrome? The latest stable is 
5.0.375.55 (http://googlechromereleases.blogspot.com/2010/05/stable-channel-
update.html). The latest Ubutnu LTS is 10.04, I think. "ended" *used* to work fine, 
then it broke, and it's never worked since then; about the time of that initial 
ticket.
May 26, 2010
#3 suna...@chromium.org
As you said that it worked before and not anymore, we can get an idea of when it worked 
and when it stopped. If you do know that, let us know or you can try with the existing 
builds as we can't repro this issue.
Labels: -Area-Undefined Area-Internals Internals-Video HTML5
May 27, 2010
#4 johnpaul...@gmail.com
right, firstly, an apology from me. The ended event *is* fired, so my bad with the ticket 
heading. However, while it's firing, the code I've got that binds the ended event to another 
function isn't handled correctly. So,

play an <audio>

in console, a = document.getElementsByTagName("audio")[0]

<audio> plays to end

a.ended returns true

in the code I've got inside my own project, I've got the following,

  audioElem.bind("ended", function() {
    if (shuffle) {
      skipForward();
      alert("skipped forward on shuffle");
    } else { 
      if (autoPlay) {
        if (loopTrack) {
          playPause();
        } else {
          skipForward();
          alert("skipped forward");
        }
      }
    }
  });

where audioElem is a var for the audio Object. The above is jQuery derived, but works fine on 
Firefox and Safari. The basic problem is that under Chrome Linux, these alerts are not fired. 
They're also not handled under Epiphany WebKit either. The above does work on: Win32 Chrome, 
OSX Chrome, Firefox *nix, Firefox Win32.

I appreciate the above isn't exactly what one would call a test case, but it does provide some 
additional insight into what might be happening. I will try and write a non jQuery test case 
later on.
May 27, 2010
#5 scherkus@chromium.org
Thanks for the source code snippet!  Stuff like this can be really handy.

Which version of Ubuntu and which audio subsystem (ALSA, PulseAudio, etc...) are you 
running?

Could you try running your audio file in my test page:
http://iheartvideo.appspot.com/

Hopefully the log output will show an ended event is indeed firing.
May 27, 2010
#6 johnpaul...@gmail.com
hello scherkus

"Which version of Ubuntu and which audio subsystem (ALSA, PulseAudio, etc...) are you 
running?"

Ubuntu 10.04 (lucid), x86_64, and I believe the audio is PulseAudio, although the 
sound mixer reports "alsa plugin"

running an ogg file through your test, the out put is this

timeupdate     (currentTime=30.386667251586914)
timeupdate     (currentTime=30.271909713745117)
timeupdate     (currentTime=30.020933151245117)
timeupdate     (currentTime=29.770198822021484)
timeupdate     (currentTime=29.519723892211914)
timeupdate     (currentTime=29.269145965576172)
timeupdate     (currentTime=29.018455505371094)
timeupdate     (currentTime=28.768178939819336)
timeupdate     (currentTime=28.519887924194336)
timeupdate     (currentTime=28.267959594726562)
timeupdate     (currentTime=28.017864227294922)
timeupdate     (currentTime=27.76740837097168)
timeupdate     (currentTime=27.51712989807129)
timeupdate     (currentTime=27.266735076904297)
timeupdate     (currentTime=27.015865325927734)
timeupdate     (currentTime=26.76559066772461)
timeupdate     (currentTime=26.51513671875)
timeupdate     (currentTime=26.264589309692383)
timeupdate     (currentTime=26.01390266418457)
timeupdate     (currentTime=25.763469696044922)
timeupdate     (currentTime=25.51332664489746)
timeupdate     (currentTime=25.26289939880371)
timeupdate     (currentTime=25.012102127075195)
timeupdate     (currentTime=24.761850357055664)
timeupdate     (currentTime=24.51154327392578)
timeupdate     (currentTime=24.261198043823242)
timeupdate     (currentTime=24.010499954223633)
timeupdate     (currentTime=23.76020622253418)
timeupdate     (currentTime=23.509702682495117)
timeupdate     (currentTime=23.25948715209961)
timeupdate     (currentTime=23.008832931518555)
timeupdate     (currentTime=22.758472442626953)
timeupdate     (currentTime=22.508224487304688)
timeupdate     (currentTime=22.257848739624023)
timeupdate     (currentTime=22.00708770751953)
timeupdate     (currentTime=21.756797790527344)
timeupdate     (currentTime=21.506439208984375)
timeupdate     (currentTime=21.255882263183594)
timeupdate     (currentTime=21.00521469116211)
timeupdate     (currentTime=20.754901885986328)
timeupdate     (currentTime=20.50447654724121)
timeupdate     (currentTime=20.254297256469727)
timeupdate     (currentTime=20.003538131713867)
timeupdate     (currentTime=19.753196716308594)
timeupdate     (currentTime=19.50279426574707)
timeupdate     (currentTime=19.25259780883789)
timeupdate     (currentTime=19.001733779907227)
timeupdate     (currentTime=18.751619338989258)
timeupdate     (currentTime=18.501230239868164)
timeupdate     (currentTime=18.250852584838867)
timeupdate     (currentTime=18.00008201599121)
timeupdate     (currentTime=17.749645233154297)
timeupdate     (currentTime=17.49930191040039)
timeupdate     (currentTime=17.248878479003906)
timeupdate     (currentTime=16.998037338256836)
timeupdate     (currentTime=16.747713088989258)
timeupdate     (currentTime=16.497312545776367)
timeupdate     (currentTime=16.246721267700195)
timeupdate     (currentTime=15.99573040008545)
timeupdate     (currentTime=15.745447158813477)
timeupdate     (currentTime=15.495192527770996)
timeupdate     (currentTime=15.244414329528809)
timeupdate     (currentTime=14.993769645690918)
timeupdate     (currentTime=14.743398666381836)
timeupdate     (currentTime=14.493311882019043)
timeupdate     (currentTime=14.243014335632324)
timeupdate     (currentTime=13.992094039916992)
timeupdate     (currentTime=13.741901397705078)
timeupdate     (currentTime=13.491602897644043)
timeupdate     (currentTime=13.241297721862793)
timeupdate     (currentTime=12.990579605102539)
timeupdate     (currentTime=12.74033260345459)
timeupdate     (currentTime=12.490242958068848)
timeupdate     (currentTime=12.23990535736084)
timeupdate     (currentTime=11.989215850830078)
timeupdate     (currentTime=11.739019393920898)
timeupdate     (currentTime=11.488784790039062)
timeupdate     (currentTime=11.238560676574707)
timeupdate     (currentTime=10.987932205200195)
timeupdate     (currentTime=10.73774242401123)
timeupdate     (currentTime=10.487467765808105)
timeupdate     (currentTime=10.237303733825684)
timeupdate     (currentTime=9.986613273620605)
timeupdate     (currentTime=9.736413955688477)
timeupdate     (currentTime=9.486003875732422)
timeupdate     (currentTime=9.235788345336914)
timeupdate     (currentTime=8.98511028289795)
timeupdate     (currentTime=8.734953880310059)
timeupdate     (currentTime=8.484625816345215)
timeupdate     (currentTime=8.234472274780273)
timeupdate     (currentTime=7.9839091300964355)
timeupdate     (currentTime=7.733544826507568)
timeupdate     (currentTime=7.483434200286865)
timeupdate     (currentTime=7.2332000732421875)
timeupdate     (currentTime=6.982492923736572)
timeupdate     (currentTime=6.732309818267822)
timeupdate     (currentTime=6.481633186340332)
timeupdate     (currentTime=6.230068206787109)
timeupdate     (currentTime=5.976068019866943)
timeupdate     (currentTime=5.725333213806152)
timeupdate     (currentTime=5.4757161140441895)
timeupdate     (currentTime=5.2270331382751465)
timeupdate     (currentTime=4.976369857788086)
timeupdate     (currentTime=4.724521160125732)
timeupdate     (currentTime=4.47054386138916)
timeupdate     (currentTime=4.2195892333984375)
timeupdate     (currentTime=3.970402956008911)
timeupdate     (currentTime=3.7227261066436768)
timeupdate     (currentTime=3.4725890159606934)
timeupdate     (currentTime=3.2194290161132812)
timeupdate     (currentTime=2.961024045944214)
timeupdate     (currentTime=2.7094509601593018)
timeupdate     (currentTime=2.46105694770813)
timeupdate     (currentTime=2.2151730060577393)
timeupdate     (currentTime=1.959285020828247)
timeupdate     (currentTime=1.7082159519195557)
timeupdate     (currentTime=1.4415030479431152)
timeupdate     (currentTime=1.1818890571594238)
timeupdate     (currentTime=0.9170939922332764)
timeupdate     (currentTime=0.6553750038146973)
timeupdate     (currentTime=0.4221569895744324)
timeupdate     (currentTime=0.23469200730323792)
playing        (currentTime=0.4017750024795532)
play           (currentTime=0.4013440012931824)
canplaythrough (currentTime=0)
canplay        (currentTime=0)
loadeddata     (currentTime=0)
loadedmetadata (currentTime=0)
durationchange (currentTime=0)
suspend        (currentTime=0)
loadstart      (currentTime=0)
emptied        (currentTime=0)
timeupdate     (currentTime=0)
May 28, 2010
#7 johnpaul...@gmail.com
one other point, that might be of interest. I get the same error on Midori and
Epiphany Webkit based browsers. The issue may lie in whatever webkit code you're
pulling in upstream. However, browser code is a bit beyond me, so please don't assume
I've made much more sophisticated an analysis than the above observation. 
Jun 2, 2010
#8 johnpaul...@gmail.com
hello all. 

Attached is a simple test, I appropriated from Chris Double's Mozilla MediaElem 
testing a long long time ago. What's interesting about it, is that it shows the ended 
event not firing - for me on Ubuntu 10.04 at least. However, you can go to the 
console and type 

document.getElementById('audioTestElem').ended 

and be returned "true." Weird. The test isn't cleaned up, or made pretty, it's only 
ever been of use to myself. As before, I seem able to get a tick against the ended 
event results if I start opening other tabs and loading webpages. That's been the 
only semi-reliable way I've managed to force an ended event to fire fully.
audio.html
3.5 KB   Download
Jun 11, 2010
#9 sgorn...@gmail.com
Here's an example showing the problem with Video as well:
  http://html5demos.com/video

The ended event should change the value of the button from "pause" to "play", but that doesn't happen on the Chromium that installs for Ubuntu 10.04 LTS x86_64 -- 5.0.375.38 (but which works fine on Firefox 3.6.3):

addEvent(video, 'ended', function () {
  togglePlay.value = "play";
}); 

Jun 15, 2010
#10 scherkus@chromium.org
That's very strange... I'm seeing it work fine on 6.0.422.0 dev channel on Ubuntu 8.04.4 LTS.

Will have to check whether its only present in 5.0.375.xx
Status: Assigned
Owner: scher...@chromium.org
Labels: -HTML5 -FeedbackRequested Mstone-6
Jun 23, 2010
#11 johnpaul...@gmail.com
comment9's examples also doesn't work for me

just another, perhaps related point. I've been watching a few playlist videos on YouTube. I've noticed that the autoplay feature works with Flash videos, but not HTML5 or WebM ones. I assume YT is looking out for an ended event there, although I admit, I haven't gone through and analysed all of the JS involved with YouTube.

This happens for me with Chromes OSX, Linux and Win7
Jul 7, 2010
#12 lafo...@chromium.org
Cleaning up mstone:6 bugs, default assumption is that bugs w/ no os are os-all
Labels: OS-All
Jul 12, 2010
#13 pran...@google.com
This bug and 21739 may have the same root cause.
Jul 12, 2010
#14 scherkus@chromium.org
(No comment was entered for this change.)
Owner: serg...@chromium.org
Jul 13, 2010
#15 fbarch...@chromium.org
On Mac, 
Firefox works
Safari 5 fails - no sound at all.
Chrome 5.0.375.99 works

Jul 13, 2010
#16 sergeyu@chromium.org
This is a Linux-only bug. The problem is that AudioRendererBase::FillBuffer() ends playback only when playback_delay == 0, but playback_delay is never set to 0 with ALSA output.
Jul 14, 2010
#17 bugdroid1@gmail.com
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=52407 

------------------------------------------------------------------------
r52407 | sergeyu@chromium.org | 2010-07-14 14:40:57 -0700 (Wed, 14 Jul 2010) | 8 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_output.cc?r1=52407&r2=52406
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_output.h?r1=52407&r2=52406
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_output_unittest.cc?r1=52407&r2=52406

Fixed ended event when playing audio on linux.

AudioRendererBase::FillBuffers() sends ended event only when playback_delay == 0, but with ALSA output the delay was never set to 0 because it includes hardware delay. Changed ALSA output to include only internal buffers in the delay value: this matches windows and mac versions.

BUG=45074
TEST=<audio> fires ended event when necessary

Review URL: http://codereview.chromium.org/2978005
------------------------------------------------------------------------

Jul 14, 2010
#18 sergeyu@chromium.org
"ended" event should work properly on all three platforms now.
Status: Fixed
Jul 15, 2010
#19 johnpaul...@gmail.com
working here, Ubuntu X86-64, Lucid, as of Chromium 6.0.467.0 (52418)

many thanks for fixing this.
Jul 16, 2010
#20 sgorn...@gmail.com
Will this fix be made to Chromium Stable (5.0) as well?
Jul 17, 2010
#21 sergeyu@chromium.org
No, this will not be back-ported to Chromium/Chrome 5.0.
Jul 19, 2010
#22 scherkus@chromium.org
(No comment was entered for this change.)
Labels: -Internals-Video -Area-Internals Feature-Media Area-WebKit
Aug 27, 2010
#23 sergeyu@chromium.org
 Issue 47928  has been merged into this issue.
Oct 17, 2010
#24 johnpaul...@gmail.com
hello all

this issue has appeared again for me, 

Chrome version {8.0.556.0 (62835) Ubuntu 10.10}

I point out, this works fine in Chrome Dev/w32. Will test OSX later.

same as above, using the test attachment in comment#8, I can play an audio, get no ended event reported in the test, yet going to console and querying for an ended event will return true.

I can also get a complete borked tab in Chrome, at least, i do with my audio app. No screen redraws and loading another tab will load the display of that tab into the now borked audio app tab. Not fun.

If this needs a new ticket, please say.
Oct 18, 2010
#25 sergeyu@chromium.org
This is specific to Ubuntu 10.10, works fine on 10.04. Opened new http://crbug.com/59585.
Jan 15, 2011
#26 aku...@gmail.com
I'm experiencing a similar problem on latest Chrome Mac OSX build (10.0.634.0 dev) -- the Ended event is not firing for various streaming sources.

In particular, I'm loading an Ogg streaming radio station.  After a song is complete, the station goes silent and no event is fired (In Firefox, an Ended event is fired, allowing the stream to be reinitiated for continuous playback).  Reloading the page restarts the player and continues to stream until the next song ends, but ideally the user wouldn't need to reload every time a song changes...  

Here's the stream to reproduce the issue:
http://stream.gameowls.com:8000/ocremix.ogg

and about half of the Ogg Vorbis streams here do the same thing:
http://dir.xiph.org/by_format/Ogg_Vorbis


Oct 12, 2012
#27 bugdroid1@chromium.org
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Labels: Restrict-AddIssueComment-Commit
Mar 10, 2013
#28 bugdroid1@chromium.org
(No comment was entered for this change.)
Labels: -Mstone-6 -Feature-Media -Area-WebKit Cr-Content Cr-Internals-Media M-6
Mar 13, 2013
#29 bugdroid1@chromium.org
(No comment was entered for this change.)
Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue
Apr 5, 2013
#30 bugdroid1@chromium.org
(No comment was entered for this change.)
Labels: -Cr-Content Cr-Blink
Sign in to add a comment

Powered by Google Project Hosting