Function ondurationchange

    Occurs when the duration attribute is updated.