diff --git a/src/i18n.js b/src/i18n.js
index ae1befb..8b9e24f 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -10,7 +10,7 @@ Use this as shown below..... */
module.exports = function (lang) {
this.lang = lang;
this.tran = (text) => {
- if (tranTxt[this.lang]) {
+ if (tranTxt[this.lang] && tranTxt[this.lang][text]) {
return tranTxt[this.lang][text];
}
else {
@@ -42,6 +42,8 @@ const tranTxt = {
'Switching to': '正在切换至',
'Switched to': '已经切换至',
'quality': '画质',
+ 'FF to': '快进至',
+ 'REW to': '快退至'
},
"zh-tw" : {
'Danmaku is loading': '彈幕加載中',
@@ -64,5 +66,7 @@ const tranTxt = {
'Switching to': '正在切換至',
'Switched to': '已經切換至',
'quality': '畫質',
+ 'FF to': '快進至',
+ 'REW to': '快退至'
}
};
\ No newline at end of file
diff --git a/src/thumbnails.js b/src/thumbnails.js
new file mode 100644
index 0000000..7bd91d1
--- /dev/null
+++ b/src/thumbnails.js
@@ -0,0 +1,25 @@
+class Thumbnails {
+ constructor (container, width, url) {
+ this.container = container;
+ this.width = width;
+ this.container.style.backgroundImage = `url('${url}')`;
+ }
+
+ resize (width, height) {
+ this.container.style.width = `${width}px`;
+ this.container.style.height = `${height}px`;
+ this.container.style.top = `${-height + 2}px`;
+ }
+
+ show (position) {
+ this.container.style.display = 'block';
+ this.container.style.backgroundPosition = `-${(Math.ceil(position / this.width * 100) - 1) * 160}px 0`;
+ this.container.style.left = `${(position - this.container.offsetWidth / 2)}px`;
+ }
+
+ hide () {
+ this.container.style.display = 'none';
+ }
+}
+
+module.exports = Thumbnails;
\ No newline at end of file