I want to make video posts redirect to the next video post in it's category after it's over. I use both youtube videos and directly uploaded videos both of which I already know how to pull the duration in seconds. How can I use them to accomplish my goal?
What you're asking for is a highly complex thing:
The problem is not the redirect 1), but more how you want to know how & when to load the next post.
1) Which in fact(/imho) should be an ajax load & replace of the current post.
Available Return values:
As an easy start: You need to a) have a listener that catches the player state when it changes and b) fires of the ajax call.
The ajax call would be a simple wordpress default call to reload the content of (for example) the parent div of the player. Just search through the ajax archives here on the page if you don't know how WP handles ajax requests.
Internal (your personally hosted) videos
Here's the real problem. You need a player that offers the same as the YouTube player: A possibility to retrieve a status change when the video playback was finished. This highly depends on the player and I've no recommendation at this point.
A last note from YouTube.