|
|
@@ -27,7 +27,7 @@ function describeMediaFragment({ start, end }) { |
|
|
|
return selector; |
|
|
|
} |
|
|
|
|
|
|
|
async function init() { |
|
|
|
export default async function init(playlist) { |
|
|
|
let menuEl; |
|
|
|
|
|
|
|
function hideMenu() { |
|
|
@@ -41,10 +41,6 @@ async function init() { |
|
|
|
const left = event.pageX; |
|
|
|
const top = event.pageY; |
|
|
|
|
|
|
|
const playlist = self.playlist; |
|
|
|
if (!playlist) { |
|
|
|
throw new Error('Player has not been initialised.'); |
|
|
|
} |
|
|
|
const trackDuration = playlist.duration; |
|
|
|
let { start, end } = playlist.getTimeSelection(); |
|
|
|
if (start === undefined) return; |
|
|
@@ -84,5 +80,3 @@ async function init() { |
|
|
|
|
|
|
|
document.addEventListener('click', event => { hideMenu(); }); |
|
|
|
} |
|
|
|
|
|
|
|
init(); |