1

Fixed

Player breaks when inside <form> tag

description

comments

jay_burling wrote Apr 20, 2012 at 6:48 PM

We were using a downloaded version of the playerframework.min.js script. We pulled the version from the examples page and it resolved this issue.

jay_burling wrote Apr 20, 2012 at 7:10 PM

Well we ended up re-creating it even with the downloaded script. After stepping through the JS I believe that something is causing the page to repost (maybe the silverlight player?) whenever the play button is pressed.

jay_burling wrote Apr 23, 2012 at 3:21 PM

The issue seems to be that the player controls are rendered as elements and nothing is preventing their default behavior of form submission when inside a form.

jay_burling wrote Apr 23, 2012 at 4:36 PM

We fixed the issue by adding the line:

"type": "button",

to every instance where a "button" element is created by the javascript. Not sure if this will destroy anything important, but we can play and pause without submiting a form and posting back.

billyzkid wrote Apr 23, 2012 at 6:20 PM

Nice find! Your proposed fix is the correct one. The W3C says the button type should always be defined, so it is defaulting to a submit button. Our next release (out today) includes this fix.