From 8d75c0d5aef92cf7736803adac3c62c8e018bf59 Mon Sep 17 00:00:00 2001 From: Tim Latz Date: Wed, 27 Feb 2013 21:58:05 +0100 Subject: [PATCH 1/3] traditional chinese locale strings for i18n module --- build/mediaelement-and-player.js | 40 +++++++++++++++++++++++++--- build/mediaelement-and-player.min.js | 12 ++++----- build/mediaelement.js | 26 ++++++++++++++++++ build/mediaelement.min.js | 2 +- build/mediaelementplayer.js | 14 +++++++--- build/mediaelementplayer.min.js | 10 +++---- src/Builder.py | 1 + src/js/me-i18n-locale-zh.js | 26 ++++++++++++++++++ 8 files changed, 111 insertions(+), 20 deletions(-) create mode 100644 src/js/me-i18n-locale-zh.js diff --git a/build/mediaelement-and-player.js b/build/mediaelement-and-player.js index 611110aed..dce5852d4 100644 --- a/build/mediaelement-and-player.js +++ b/build/mediaelement-and-player.js @@ -1803,6 +1803,32 @@ window.MediaElement = mejs.MediaElement; "Close" : "Schließen" }; +}(mejs.i18n.locale.strings)); +/*! + * This is a i18n.locale language object. + * + * German translation by Tim Latz, latz.tim@gmail.com + * + * @author + * Tim Latz (latz.tim@gmail.com) + * + * @see + * me-i18n.js + * + * @params + * - exports - CommonJS, window .. + */ +;(function(exports, undefined) { + + "use strict"; + + exports.zh = { + "Fullscreen" : "全螢幕", + "Go Fullscreen" : "全屏模式", + "Turn off Fullscreen" : "退出全屏模式", + "Close" : "關閉" + }; + }(mejs.i18n.locale.strings)); /*! @@ -2630,7 +2656,8 @@ if (typeof jQuery != 'undefined') { // find the size of all the other controls besides the rail others.each(function() { - if ($(this).css('position') != 'absolute') { + var $this = $(this); + if ($this.css('position') != 'absolute' && $this.is(':visible')) { usedWidth += $(this).outerWidth(true); } }); @@ -3156,8 +3183,8 @@ if (typeof jQuery != 'undefined') { // update bar and handle if (t.total && t.handle) { var - newWidth = t.total.width() * t.media.currentTime / t.media.duration, - handlePos = newWidth - (t.handle.outerWidth(true) / 2); + newWidth = Math.round(t.total.width() * t.media.currentTime / t.media.duration), + handlePos = newWidth - Math.round(t.handle.outerWidth(true) / 2); t.current.width(newWidth); t.handle.css('left', handlePos); @@ -3463,7 +3490,12 @@ if (typeof jQuery != 'undefined') { if (t.container.is(':visible')) { // set initial volume positionVolumeHandle(player.options.startVolume); - + + // mutes the media and sets the volume icon muted if the initial volume is set to 0 + if (player.options.startVolume === 0) { + media.setMuted(true); + } + // shim gets the startvolume as a parameter, but we have to set it on the native