question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Videos that are over an hour

See original GitHub issue

I noticed that the examples on the site don’t work if the video is over an hour.

I’m trying to get current time and the time left to display properly, but an somewhat unsure how. Adding an hour to the angular date filter does not seem to work {{API.timeLeft | date:'h:mm:ss'}}

Attempting to getSeconds / getMilliseconds / getHours from timeleft also does not work.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bpkennedycommented, Feb 28, 2017

Sorry, but can someone provide a quick code sample for how this problem is solved? I am running into the same issue right now. The ‘hh:mm:ss’: ‘UTC’ will only work for the timeLeft. I need the currentTime to start at 00:00:00 and count up (just like a Youtube video)

EDIT: Fyi for anyone else looking, I ended up using a combination of this. Custom filter with moment.js for the currentTime (I convert it to UTC in the event that we pass an hour):

angular.module('clientApp')
.filter('playerDate', function ($filter) {
    var angularDateFilter = $filter('date');
    return function(theDate) {
        var now = new Date(theDate);
        var oneHour = 60 * 60 * 1000;
        if (now - oneHour < 0) {
            return angularDateFilter(theDate, 'mm:ss');
        } else {
            return moment(theDate).utc().format('hh:mm:ss');
        }
    };
});

And the html (where I also cast the totalTime to UTC using angular’s native Date filter) looks like:

<vg-time-display class="time-holder">{{ currentTime | playerDate }} / {{ totalTime | date:'hh:mm:ss': 'UTC' }}</vg-time-display>
0reactions
2fdevscommented, Nov 9, 2014

UTC problem is solved, I don’t know what could happen if you use UTC filter in Angular 1.3, but with this fix is not necessary at all.

If you want to have API.totalTime without seeking or pressing play just be sure to have vg-preload to metadata or auto. This would not work on mobile since metadata is never loaded until user clicks on media.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Top 10 Best 10-Hour Long Videos on YouTube - Lifewire
The Top 10 Best 10-Hour Long Videos on YouTube · Got an entire day to waste? Then watch one of these videos ·...
Read more >
Over 1 Hour of TikToks! - YouTube
1 Hour and 26 Minutes of Tik Tok VideosFor You and Meme TikTok Compilation#memes #tiktokdance ... Your browser can't play this video.
Read more >
OVER 1 HOUR Of Slime Mixing!! - YouTube
Hi Guys!! Today I have over 1 hour for you of my best slime mixing vids. I picked out these videos for special...
Read more >
Lucky Daye - Over // 1 hour // 60 minute sounds - YouTube
Lucky Daye - Over // 1 hour // 60 minute soundsLucky Daye - Over // 1 hourIf you enjoy it, ... Your browser...
Read more >
Got one hour too much time in your life? Waste it on this.
I suggest watching this while playing a game or doing whatever you do when listening to a video with no engaging visuals.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found