Unfortunately this is not possible, because "duration" is read-only. So, an attempt to use "this.duration" leads to the following error:

"Error: Property "duration" is read only"