New York Times columnist David Brooks calls on Americans to transcend their differences

New York Times columnist David Brook is calling on Americans to focus on their relationships instead of individual happiness. “We are all infected by a culture, a culture of hyper-individualism,” Brooks told a crowd Wednesday during a keynote address at the Knight Media Forum in Miami. Brooks, who is a PBS NewsHour regular, said there are signs that more people are experiencing loneliness and that leads to divisions and “tribalism.” But Brooks said if people will focus on joy—created by relationships—we will be “pointing in the right direction.

How to Control YouTube’s Video Player with JavaScript

Progress Bar

This is done using the player.seekTo(sec) function, which jumps the video to the seconds provided in the parameter.

To demonstrate this we’ve made our own version of YouTube’s progress bar, using an input field of type range. When we click anywhere on it, we take the inputs value, witch gives us a percentage. We then use this percentage to calculate what progress we want made to the video and skip to the according seconds.

$('#progress-bar').on('mouseup touchend', function (e) {

    // Calculate the new time for the video.
    // new time in seconds = total duration in seconds * ( value of range input / 100 )
    var newTime = player.getDuration() * (e.target.value / 100);

    // Skip video to new time.
    player.seekTo(newTime);

});