Closed Bug 481551 Opened 16 years ago Closed 16 years ago

Bizarre behaviour pressing left-arrow in controls

Categories

(Toolkit :: Video/Audio Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Unassigned)

References

Details

1) Download http://www.double.co.nz/video_test/BillysBrowser480.ogg to a local file 2) Open it 3) Click on the controls bar 4) Once playback has advanced a few seconds, press left-arrow once Video and audio playback are screwed up from then on. Audio fragments repeat, video intermediate frames keep being displayed on top of the wrong background frames, etc. In the debugger it looks like the video controls keep setting currentTime over and over. Stack trace: 0 [native frame] 1 anonymous() ["chrome://global/content/bindings/videocontrols.xml":331] newPosition = 28.061 this = [object Object] 2 valueChanged(userChanged = false, newValue = 28061, which = "curpos") ["chrome://global/content/bindings/videocontrols.xml":29] this = [object XULElement @ 0xa5112c0 (native @ 0xa510510)] 3 _setIntegerAttribute(aValue = 28061, aAttr = "curpos") ["chrome://global/content/bindings/scale.xml":107] intvalue = 28061 this = [object XULElement @ 0xa5112c0 (native @ 0xa510510)] 4 set_value(val = 28061) ["chrome://global/content/bindings/scale.xml":0] this = [object XULElement @ 0xa5112c0 (native @ 0xa510510)] 5 anonymous(duration = 29996, 29996) ["chrome://global/content/bindings/videocontrols.xml":346] adjPercent = undefined rightEdge = undefined leftEdge = undefined percent = undefined this = [object Object] 6 anonymous(aEvent = [object Event @ 0xa55eb90 (native @ 0x8417600)]) ["chrome://global/content/bindings/videocontrols.xml":275] currentTime = 28061 total = undefined loaded = undefined duration = 29996 this = [object Object]
Flags: blocking1.9.1?
Ah, I see what's happening. The key handlers in scale.xul all look like this: 184 <handler event="keypress" keycode="VK_LEFT" preventdefault="true"> 185 <![CDATA[ 186 this._userChanged = true; 187 (this.orient != "vertical" && this.dir == "reverse") ? this.increase() : this.decrease(); 188 this._userChanged = false; 189 ]]> 190 </handler> _userChanged is a flag added as part bug 472090; the videocontrols extend the <scale> binding, and uses _userChanged to ignore position changes during normal playback (ie, we only want to seek the video when the user fiddles with the scrubber). The first keyboard press is now causing an exception to be thrown: JavaScript error: chrome://global/content/bindings/scale.xml, line 187: Permission denied for <http://dolske.net> to get property XULElement.orient from <http://dolske.net>. So the key handler croaks halfway though, leaving _userChanged set to true. Then when we update the scrubber position during a timeupdate event, the controls are tricked into thinking the position was changed by the user. *sigh* This was working before, so something changed recently. :-( Bug 470852 should probably address .orient too, and it would probably be good to belt-and-suspenders this fix by having the scale.xml keyhandler wrap the middle line in a try-catch block. And/or have it set ._userChanged to false at the end of increment/decrement/etc so that it doesn't stay stuck.
Flags: blocking1.9.1? → wanted1.9.1+
Blocks: TrackAVUI
Yeah, bug 475864 fixed the problem.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Component: Video/Audio → Video/Audio Controls
Product: Core → Toolkit
QA Contact: video.audio → video.audio
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.