+ const url = baseUrl
+ ? baseUrl
+ : window.location.origin + window.location.pathname.replace('/embed/', '/watch/')
+
+ const params = new URLSearchParams(window.location.search)
+ // Remove these unused parameters when we are on a playlist page
+ params.delete('videoId')
+ params.delete('resume')
+
+ if (options.startTime) {
+ const startTimeInt = Math.floor(options.startTime)
+ params.set('start', secondsToTime(startTimeInt))
+ }
+
+ if (options.stopTime) {
+ const stopTimeInt = Math.floor(options.stopTime)
+ params.set('stop', secondsToTime(stopTimeInt))