Also, neither "autostart" nor "repeat" are valid HTML attributes of the ``img`` element. So the generates HTML source won't be valid. A solution in this case, when the parameters are flags (boolean) is to use the "class" attribute:

    class = "jwplayer autostart repeat"

This also removes the need to encode the value given by the user (to prevent XSS).