オーディオ プレーヤー アプリに Videogular を実装しようとしています。このページのサンプル コードの設定は次のとおりです。
<vg-time-display>{{ currentTime | date:'mm:ss' }}</vg-time-display>
<vg-scrub-bar>
<vg-scrub-bar-current-time></vg-scrub-bar-current-time>
</vg-scrub-bar>
<vg-time-display>{{ timeLeft | date:'mm:ss' }}</vg-time-display>
ただし、ロードしようとしているオーディオの長さは 1 時間以上であるため、「hh:mm:ss」を実装する必要があります。形式を変更するhh:mm:ss
と、期間に約 5:00 時間が追加され、00:01:30 が 05:01:30 として表示されます
いくつかのアドホックな実験により、「videogular.js」の次の変更により問題が修正されます。
this.onUpdateTime = function (event) {
$scope.API.currentTime = 1000 * event.target.currentTime - (1000 * 60 * 300 * 5 * 5);
if (event.target.duration != Infinity) {
$scope.API.totalTime = 1000 * event.target.duration - (1000 * 60 * 300 * 5 * 5);
$scope.API.timeLeft = 1000 * (event.target.duration - event.target.currentTime) - (1000 * 60 * 300 * 5 * 5);
$scope.API.isLive = false;
}
}
しかし、それは私が修正できなかった次のコードにも影響します:
percentTime = 100 * (newCurrentTime / API.totalTime);
elem.css("width", percentTime + "%");