add media state check

This commit is contained in:
Yanzhen Yu
2020-01-12 18:01:37 +08:00
parent 388ec6c30c
commit a7a3a76af1
4 changed files with 50 additions and 0 deletions

View File

@@ -152,6 +152,16 @@ function buildNode(
if (name === 'rr_height') {
(node as HTMLElement).style.height = value;
}
if (name === 'rr_mediaState') {
switch (value) {
case 'played':
(node as HTMLMediaElement).play();
case 'paused':
(node as HTMLMediaElement).pause();
break;
default:
}
}
}
}
return node;