Mumbai tests its first driverless vehicle (humor) : SelfDrivingCars

0
69


‘ ); var bufferingControlsOptions = { behavior: RedditVideoController.Behaviors.BUFFERING, startVisible: false, fadeInDuration: 0, fadeOutDuration: 0, }; var bufferingControls = new RedditVideoController(bufferingControlsTree, bufferingControlsOptions); redditVideoPlayer.addUiController(bufferingControls); var pinnedHeight = videoPlayerElement.data(“pinnedHeight”); var pinnedWidth = videoPlayerElement.data(“pinnedWidth”); var maxPinnedWidth = videoPlayerElement.data(“maxPinnedWidth”); $(document.body).on(‘pinnable:pinned’, function(event) { videoPlayerElement.css(‘height’, pinnedHeight); videoPlayerElement.css(‘width’, pinnedWidth); videoPlayerElement.closest(‘.thing’).find(‘.top-matter’).css(‘left’, pinnedWidth + 95); }.bind(this)); $(document.body).on(‘pinnable:unpinned’, function(event) { videoPlayerElement.css(‘height’, ”); videoPlayerElement.css(‘width’, ”); }.bind(this)); var pinnedControlMargin = 12 * Math.pow(pinnedWidth / maxPinnedWidth, 2); var pinnedControlsTree = $.parseHTML( ‘

‘ + ‘

‘ + ‘‘ + ‘‘ + ‘

‘ + ‘

‘ ); var pinnedControls = new RedditVideoController(pinnedControlsTree); redditVideoPlayer.addUiController(pinnedControls); var playbackControlsTree = $.parseHTML( ‘

‘ + ‘‘ + ‘‘ + ‘0:00’ + ‘‘ + ‘

‘ + ‘

‘ + ‘‘ + ‘0:00’ + ‘‘ + ” + ‘‘ + ‘

‘ ); var playbackControlsOptions = { behavior: RedditVideoController.Behaviors.MOUSE_MOVE, }; var playbackControls = new RedditVideoController(playbackControlsTree, playbackControlsOptions); redditVideoPlayer.addUiController(playbackControls); if (r.config && r.config.pref_no_video_autoplay && thing.context === “comments”) { var interstitialControlsTree = $.parseHTML( ‘

‘ + ‘

‘ + ‘‘ + ‘

‘ + ‘

‘ ); var interstitialControlsOptions = { behavior: RedditVideoController.Behaviors.INTERSTITIAL, startVisible: true, fadeInDuration: 0, fadeOutDuration: 400, }; var interstitialControls = new RedditVideoController(interstitialControlsTree, interstitialControlsOptions); redditVideoPlayer.addUiController(interstitialControls); } $(playbackControlsTree).find(‘input.settings’).change(function() { if ($(this).is(‘:checked’)) { firePlayerEvent.call(redditVideoPlayer, null, null, {verb: ‘click’, noun: ‘settings’}); redditVideoPlayer.setClickAction(RedditVideoPlayer.ClickActions.NONE); } else { redditVideoPlayer.setClickAction(RedditVideoPlayer.ClickActions.PLAY_PAUSE); } }); } if (isMobile && thing.isGif) { $(videoPlayerElement).find(“video”).bind(“webkitendfullscreen”, function() { this.play(); }); redditVideoPlayer.mute(); } $(document.body).on(“interstitial:destroy”, function(event) { if (“t3_8qpyje” == event.expando.id) { redditVideoPlayer.play(); } }); var parent = $(“#media-preview-8qpyje”).parent(); var hadInterstitial = parent.hasClass(“expando”) && !(parent.hasClass(“expando–with-interstitial”)) && !(parent.hasClass(“expando-uninitialized”)) && “” != “”; if (hadInterstitial && !isMobile) { $(videoPlayerElement).find(“video”)[0].addEventListener(“canplay”, function() { redditVideoPlayer.play(); }) } var playPauseButtons = $(videoPlayerElement).find(“button.play-pause”); var isPlaying = autoplay; redditVideoPlayer.addActionCompletedCallback(function(action, value) { if ((action == RedditVideoPlayer.Actions.PLAY && !isPlaying) || (action == RedditVideoPlayer.Actions.PAUSE && isPlaying)) { playPauseButtons.each(function() { var animation = $(this).find(‘animate’).first(); var to = animation.attr(‘to’); var from = animation.attr(‘from’); animation.attr({ “from”: to, “to”: from }); if (‘beginElement’ in animation[0]) { animation.get(0) .beginElement(); } else { var path = $(this).find(‘path’); path.attr({“d”: from}); } }); isPlaying = !isPlaying; } else if (action == RedditVideoPlayer.Actions.NONE && thing.isGif && isMobile) { redditVideoPlayer.toggleFullScreen(); return; } var settings = $(playbackControlsTree).find(“input.settings”); if (settings.prop(“checked”)) { settings.prop(“checked”, false); redditVideoPlayer.setClickAction(RedditVideoPlayer.ClickActions.PLAY_PAUSE); } }); function firePlayerEvent(action, value, extras) { extras = (typeof extras === ‘object’) ? extras : {}; var verb = extras.verb || ”; var noun = extras.noun || ”; var source = extras.source || ‘videoplayer’; var maxTimestamp = this.maxPlayed * 1000; var durationMs = this.duration * 1000; var timeMs = this.currentTime * 1000; var pinnableElement = $(this.root).closest(‘.pinnable-content’); var targetElement = $(this.root).closest(‘.thing.link’); var targetData = targetElement.data(); var videoState = { maxTimestampServed: parseInt(maxTimestamp), percentServed: maxTimestamp / durationMs, duration: parseInt(durationMs), time: parseInt(timeMs), isNsfw: targetElement.hasClass(‘over18’), isSpoiler: targetElement.hasClass(‘spoiler’), isPinned: pinnableElement.hasClass(‘pinned’), isVertical: this.orientation === RedditVideoPlayer.Orientations.PORTRAIT, firstFrameTime: this.firstFrameTime, loadStartTime: this.loadStartTime, }; r.analytics.videoPlayerEvent(source, verb, noun, targetData, videoState); } redditVideoPlayer.addActionCompletedCallback(firePlayerEvent); })();



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here