diff --git a/src/App.html b/src/App.html
index c54fde62..f19586f4 100644
--- a/src/App.html
+++ b/src/App.html
@@ -1,6 +1,3 @@
-
- rrweb player playground
-
\ No newline at end of file
diff --git a/src/Player.html b/src/Player.html
index 1d5a5617..b47fe52a 100644
--- a/src/Player.html
+++ b/src/Player.html
@@ -1,10 +1,65 @@
+ {#if replayer}
+
+ {/if}
+
+
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/util.js b/src/util.js
deleted file mode 100644
index da07ec19..00000000
--- a/src/util.js
+++ /dev/null
@@ -1,7 +0,0 @@
-export function inlineCss(cssObj) {
- let style = '';
- Object.keys(cssObj).forEach(key => {
- style += `${key}: ${cssObj[key]};`;
- });
- return style;
-}
diff --git a/src/utils.js b/src/utils.js
new file mode 100644
index 00000000..b19c4603
--- /dev/null
+++ b/src/utils.js
@@ -0,0 +1,33 @@
+export function inlineCss(cssObj) {
+ let style = '';
+ Object.keys(cssObj).forEach(key => {
+ style += `${key}: ${cssObj[key]};`;
+ });
+ return style;
+}
+
+function padZero(num, len = 2) {
+ const threshold = Math.pow(10, len - 1);
+ if (num < threshold) {
+ num = String(num);
+ while (String(threshold).length > num.length) {
+ num = '0' + num;
+ }
+ }
+ return num;
+}
+
+const SECOND = 1000;
+const MINUTE = 60 * SECOND;
+const HOUR = 60 * MINUTE;
+export function formatTime(ms) {
+ const hour = Math.floor(ms / HOUR);
+ ms = ms % HOUR;
+ const minute = Math.floor(ms / MINUTE);
+ ms = ms % MINUTE;
+ const second = Math.floor(ms / SECOND);
+ if (hour) {
+ return `${padZero(hour)}:${padZero(minute)}:${padZero(minute)}`;
+ }
+ return `${padZero(hour)}:${padZero(second)}`;
+}