区块链技术博客
www.b2bchain.cn

Other coins trying to take DeFi and smart contract market share from Ethereum (v.redd.it). 16 . . . ToxicBTCMaximalist23 commentssharesavehidereport(function() { var thing = {“obfuscatedPosterUrl”: null, “context”: “comments”, “isGif”: true}; var autoplay = true; if (thing.obfuscatedPosterUrl){ autoplay = false; } if (r.config && !r.config.pref_video_autoplay && thing.context === “comments”) { autoplay = false; } var play_pause_click_action = autoplay ? “pause” : “play”; var play_pause_click_toggle_action = autoplay ? “play” : “pause”; var play_pause_vector_from = autoplay ? “m5,5l15,7.5l0,15l-15,7.5l0,-30m15,7.5l15,7.5l0,0l-15,7.5l0,-15” : “m5,5l12,0l0,30l-12,0l0,-30m18,0l12,0l0,30l-12,0l0,-30”; var play_pause_vector_to = autoplay ? “m5,5l12,0l0,30l-12,0l0,-30m18,0l12,0l0,30l-12,0l0,-30” : “m5,5l15,7.5l0,15l-15,7.5l0,-30m15,7.5l15,7.5l0,0l-15,7.5l0,-15”; var videoPlayerElement = $(“#video-hxy0zs”); var isMobile = r.utils.isMobile(); var canPlayDash = (typeof (window.MediaSource || window.WebKitMediaSource) === “function”); var videoOptions = { id: videoPlayerElement.data(“id36”), linkUrl: videoPlayerElement.data(“linkUrl”), src: canPlayDash ? videoPlayerElement.data(“mpdUrl”) : videoPlayerElement.data(“hlsUrl”), type: canPlayDash ? RedditVideoPlayer.Types.MPD : RedditVideoPlayer.Types.HLS, autoplay: autoplay, poster: null, loop: true, orientation: videoPlayerElement.data(“orientation”), }; if (isMobile) { videoOptions.enableStorage = false; videoOptions.uiControls = false; if (thing.isGif) { videoOptions.clickAction = RedditVideoPlayer.ClickActions.NONE; } else { videoOptions.controls = true; } } var redditVideoPlayer = new RedditVideoPlayer(videoPlayerElement, videoOptions); videoPlayerElement.data(“video-player-object”, redditVideoPlayer); redditVideoPlayer.setAspectRatio(videoPlayerElement.data(“videoHeight”) / videoPlayerElement.data(“videoWidth”)); if (!isMobile) { var bufferingControlsTree = $.parseHTML( ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” ); 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_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_hxy0zs” == event.expando.id) { redditVideoPlayer.play(); } }); var parent = $(“#media-preview-hxy0zs”).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); } }); var postElement = videoPlayerElement.closest(‘.thing.link’)[0]; r.analytics.observeAdVideoPlayer(postElement, videoPlayerElement[0]); redditVideoPlayer.addActionCompletedCallback(function(action, value) { var actions = [ RedditVideoPlayer.Actions.BUFFERING, RedditVideoPlayer.Actions.PAUSE, RedditVideoPlayer.Actions.PLAY, RedditVideoPlayer.Actions.SEEK_JUMP, RedditVideoPlayer.Actions.SET_CURRENT_TIME, RedditVideoPlayer.Actions.FULLSCREEN_REQUEST, RedditVideoPlayer.Actions.UNMUTE, RedditVideoPlayer.Actions.MUTE, RedditVideoPlayer.Actions.SET_VOLUME, ]; if (actions.indexOf(action) >-1) { var targetElement = $(this.root).closest(‘.thing.link’); var playerData = { muted: redditVideoPlayer.muted, volume: redditVideoPlayer.volume, duration: redditVideoPlayer.duration, }; r.analytics.handleVideoAdEvent(action, value, playerData, targetElement); } }); var lastTime = 0; redditVideoPlayer.addTimeUpdateHandler(function(time, duration) { var targetElement = $(this.root).closest(‘.thing.link’); var INTERVAL = 0.5; var timeDiff = time – lastTime; lastTime = time; if (timeDiff >0 && timeDiff< INTERVAL) { r.analytics.handleVideoTimeUpdate(time, timeDiff, duration, targetElement); } }); 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); })();Dismiss this pinned windowvar pinnablePlaceholder = $('#pinnable-placeholder-hxy0zs')[0]; var pinnableContent = $('#pinnable-content-hxy0zs'); var targetElement = pinnableContent.find('.thing.link'); var videoPlayer = pinnableContent.find('#video-hxy0zs').data('video-player-object'); var isPinned = false; var isDisabled = false; var isAnimating = false; function getVisiblePercentageOfElement(element) { var viewportHeight = window.innerHeight; var rect = element.getBoundingClientRect(); var top = rect.top; var bottom = rect.bottom; var height = bottom - top; var hiddenTopPx = Math.min(top, 0); var hiddenBottomPx = Math.min(viewportHeight - bottom, 0); var visibleHeight = Math.max(height + hiddenTopPx + hiddenBottomPx, 0); return visibleHeight / height * 100; } function getVideoState() { var maxTimestamp = videoPlayer.maxPlayed * 1000; var durationMs = videoPlayer.duration * 1000; var timeMs = videoPlayer.currentTime * 1000; return { maxTimestampServed: parseInt(maxTimestamp), percentServed: maxTimestamp / durationMs, duration: parseInt(durationMs), time: parseInt(timeMs), isNsfw: targetElement.hasClass('over18'), isSpoiler: targetElement.hasClass('spoiler'), isPinned: isPinned, isVertical: this.orientation === RedditVideoPlayer.Orientations.PORTRAIT, firstFrameTime: videoPlayer.firstFrameTime, loadStartTime: videoPlayer.loadStartTime, }; } function dismissPinnable() { isDisabled = true; pinnableContent.removeClass('pinned'); var event = $.Event('pinnable:unpinned'); $(document.body).trigger(event); var targetData = targetElement.data(); var videoState = getVideoState(); r.analytics.videoPlayerEvent("pinnedvideoplayer", "click", "close", targetData, videoState); } $(window).scroll(function(e) { var pinConditionElements = pinnableContent.find('[data-pin-condition]').addBack('[data-pin-condition]'); var conditionsSatisfied = true; pinConditionElements.each(function() { var conditionFunction = $(this).data('pin-condition'); if (conditionFunction != undefined) { eval("conditionFunction = " + conditionFunction, conditionFunction); } if (typeof conditionFunction === "function") { conditionsSatisfied &= conditionFunction.call($(this)[0]); } }); if (!isPinned && !isDisabled && !isAnimating && conditionsSatisfied && getVisiblePercentageOfElement(pinnablePlaceholder)< 50) { var pinConditionElements = pinnableContent.find('[data-pin-condition]'); isAnimating = true; pinnablePlaceholder.style.height = pinnablePlaceholder.getBoundingClientRect().height + "px"; setTimeout(function() { isAnimating = false; isPinned = true; }, 200); pinnableContent.addClass('pinned'); var event = $.Event('pinnable:pinned'); $(document.body).trigger(event); var targetData = targetElement.data(); var videoState = getVideoState(); r.analytics.videoPlayerEvent("pinnedvideoplayer", "scroll", "activated", targetData, videoState); } else if (isPinned && !isAnimating && getVisiblePercentageOfElement(pinnablePlaceholder) >= 60) { isAnimating = true; setTimeout(function() { isAnimating = false; pinnablePlaceholder.style.height = “auto”; isPinned = false; }, 200); pinnableContent.removeClass(‘pinned’); var event = $.Event(‘pinnable:unpinned’); $(document.body).trigger(event); } });all 23 commentssorted .: top .bestnewcontroversialoldrandomq&alive (beta)Want to add to the .?Post a comment!Create an account[–]PristineCount0 16 .17 .18 . 11 . . (3 children)


.



Best analogy I've seen all day. 👏 ETHforTheWin 🚀

[deleted]

And…….I bet its all gone when I put any in your betscam

Ban.

Hmm, which coin is trying to take DEFI from ETH. I haven't seen any. Smart contracts, yes, a plenty.

Switcheo has been shilled a lot to me which is a neo contract I believe.

Defi was created organically on ethereum. Other coins are trying to pay developers to launch Defi Dapps on their platforms. They are struggling because they can't really provide more funding than what a developer would get from laughing a DAO token to govern their Dapp on ethereum.

It's just funny watching all the smart contract platform founders suddenly talk about how they are pushing Defi. Meanwhile Vitalik and others don't really give a crap about it, they're already pushing for the next big thing, which looks like it'll be data storage.

Meanwhile Vitalik and others don't really give a crap about it, they're already pushing for the next big thing, which looks like it'll be data storage.

If data storage is the next big thing, Ethereum is not well positioned at all. Look at the state of Swarm.

I'm not really concerned, if ethereum already has enough going on. It makes sense that people would want to interact with it on the same network they use for everything else.

Besides Hack FS is going on right now and people are seeing what they can make with ethereum and filecoin.

Whatever gets made outside of eth will be copied and turned into a Dapp on ethereum with a token that can be released to uniswap. Because the first person to copy it onto Ethereum will become a billionaire or close to one.

Look at yearn.finance, it's literally a user interface on top of curve and they have a $100,000,000 market cap now. Nobody can match that funding potential.

Check out the graph protocol.

All the "ETH-KILLERS" 😂

Is this why ETH is going up right now?

For lots of reasons.

  • BTC is being put on ETH
  • It broke a major resistance at 290
  • ETH2
  • DeFi
  • Crypto interest accounts encouraging holding
  • Banks can now mange customers crypto legally
  • Easier access to buying
  • Developer market share
  • Srablecoin popularity

I like the sounds of all these! Thanks

A good boi would never take anything away from someone! DeFi, the next buzzword after Yield Farming…

Other coins are not that cute 😏

This would be accurate if the adult wolf stayed larger than the pups permanently, by virtue of having exclusive access to the Network Effect bowl.

I think in the future these chains will be integrated through 3rd party apps, anyway.

When I build my DeFi network I will most likely use tezos as I see the cost of using EtH will start to be an issue.

Isn’t this problem to be solved in the future?

Waiting on Polkadot. Though, they specifically said that they’d compliment etherium. Not compete with it.

赞(0) 打赏
部分文章转自网络,侵权联系删除b2bchain区块链学习技术社区 » Other coins trying to take DeFi and smart contract market share from Ethereum (v.redd.it). 16 . . . ToxicBTCMaximalist23 commentssharesavehidereport(function() { var thing = {“obfuscatedPosterUrl”: null, “context”: “comments”, “isGif”: true}; var autoplay = true; if (thing.obfuscatedPosterUrl){ autoplay = false; } if (r.config && !r.config.pref_video_autoplay && thing.context === “comments”) { autoplay = false; } var play_pause_click_action = autoplay ? “pause” : “play”; var play_pause_click_toggle_action = autoplay ? “play” : “pause”; var play_pause_vector_from = autoplay ? “m5,5l15,7.5l0,15l-15,7.5l0,-30m15,7.5l15,7.5l0,0l-15,7.5l0,-15” : “m5,5l12,0l0,30l-12,0l0,-30m18,0l12,0l0,30l-12,0l0,-30”; var play_pause_vector_to = autoplay ? “m5,5l12,0l0,30l-12,0l0,-30m18,0l12,0l0,30l-12,0l0,-30” : “m5,5l15,7.5l0,15l-15,7.5l0,-30m15,7.5l15,7.5l0,0l-15,7.5l0,-15”; var videoPlayerElement = $(“#video-hxy0zs”); var isMobile = r.utils.isMobile(); var canPlayDash = (typeof (window.MediaSource || window.WebKitMediaSource) === “function”); var videoOptions = { id: videoPlayerElement.data(“id36”), linkUrl: videoPlayerElement.data(“linkUrl”), src: canPlayDash ? videoPlayerElement.data(“mpdUrl”) : videoPlayerElement.data(“hlsUrl”), type: canPlayDash ? RedditVideoPlayer.Types.MPD : RedditVideoPlayer.Types.HLS, autoplay: autoplay, poster: null, loop: true, orientation: videoPlayerElement.data(“orientation”), }; if (isMobile) { videoOptions.enableStorage = false; videoOptions.uiControls = false; if (thing.isGif) { videoOptions.clickAction = RedditVideoPlayer.ClickActions.NONE; } else { videoOptions.controls = true; } } var redditVideoPlayer = new RedditVideoPlayer(videoPlayerElement, videoOptions); videoPlayerElement.data(“video-player-object”, redditVideoPlayer); redditVideoPlayer.setAspectRatio(videoPlayerElement.data(“videoHeight”) / videoPlayerElement.data(“videoWidth”)); if (!isMobile) { var bufferingControlsTree = $.parseHTML( ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” + ” ); 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_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_hxy0zs” == event.expando.id) { redditVideoPlayer.play(); } }); var parent = $(“#media-preview-hxy0zs”).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); } }); var postElement = videoPlayerElement.closest(‘.thing.link’)[0]; r.analytics.observeAdVideoPlayer(postElement, videoPlayerElement[0]); redditVideoPlayer.addActionCompletedCallback(function(action, value) { var actions = [ RedditVideoPlayer.Actions.BUFFERING, RedditVideoPlayer.Actions.PAUSE, RedditVideoPlayer.Actions.PLAY, RedditVideoPlayer.Actions.SEEK_JUMP, RedditVideoPlayer.Actions.SET_CURRENT_TIME, RedditVideoPlayer.Actions.FULLSCREEN_REQUEST, RedditVideoPlayer.Actions.UNMUTE, RedditVideoPlayer.Actions.MUTE, RedditVideoPlayer.Actions.SET_VOLUME, ]; if (actions.indexOf(action) >-1) { var targetElement = $(this.root).closest(‘.thing.link’); var playerData = { muted: redditVideoPlayer.muted, volume: redditVideoPlayer.volume, duration: redditVideoPlayer.duration, }; r.analytics.handleVideoAdEvent(action, value, playerData, targetElement); } }); var lastTime = 0; redditVideoPlayer.addTimeUpdateHandler(function(time, duration) { var targetElement = $(this.root).closest(‘.thing.link’); var INTERVAL = 0.5; var timeDiff = time – lastTime; lastTime = time; if (timeDiff >0 && timeDiff< INTERVAL) { r.analytics.handleVideoTimeUpdate(time, timeDiff, duration, targetElement); } }); 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); })();Dismiss this pinned windowvar pinnablePlaceholder = $('#pinnable-placeholder-hxy0zs')[0]; var pinnableContent = $('#pinnable-content-hxy0zs'); var targetElement = pinnableContent.find('.thing.link'); var videoPlayer = pinnableContent.find('#video-hxy0zs').data('video-player-object'); var isPinned = false; var isDisabled = false; var isAnimating = false; function getVisiblePercentageOfElement(element) { var viewportHeight = window.innerHeight; var rect = element.getBoundingClientRect(); var top = rect.top; var bottom = rect.bottom; var height = bottom - top; var hiddenTopPx = Math.min(top, 0); var hiddenBottomPx = Math.min(viewportHeight - bottom, 0); var visibleHeight = Math.max(height + hiddenTopPx + hiddenBottomPx, 0); return visibleHeight / height * 100; } function getVideoState() { var maxTimestamp = videoPlayer.maxPlayed * 1000; var durationMs = videoPlayer.duration * 1000; var timeMs = videoPlayer.currentTime * 1000; return { maxTimestampServed: parseInt(maxTimestamp), percentServed: maxTimestamp / durationMs, duration: parseInt(durationMs), time: parseInt(timeMs), isNsfw: targetElement.hasClass('over18'), isSpoiler: targetElement.hasClass('spoiler'), isPinned: isPinned, isVertical: this.orientation === RedditVideoPlayer.Orientations.PORTRAIT, firstFrameTime: videoPlayer.firstFrameTime, loadStartTime: videoPlayer.loadStartTime, }; } function dismissPinnable() { isDisabled = true; pinnableContent.removeClass('pinned'); var event = $.Event('pinnable:unpinned'); $(document.body).trigger(event); var targetData = targetElement.data(); var videoState = getVideoState(); r.analytics.videoPlayerEvent("pinnedvideoplayer", "click", "close", targetData, videoState); } $(window).scroll(function(e) { var pinConditionElements = pinnableContent.find('[data-pin-condition]').addBack('[data-pin-condition]'); var conditionsSatisfied = true; pinConditionElements.each(function() { var conditionFunction = $(this).data('pin-condition'); if (conditionFunction != undefined) { eval("conditionFunction = " + conditionFunction, conditionFunction); } if (typeof conditionFunction === "function") { conditionsSatisfied &= conditionFunction.call($(this)[0]); } }); if (!isPinned && !isDisabled && !isAnimating && conditionsSatisfied && getVisiblePercentageOfElement(pinnablePlaceholder)< 50) { var pinConditionElements = pinnableContent.find('[data-pin-condition]'); isAnimating = true; pinnablePlaceholder.style.height = pinnablePlaceholder.getBoundingClientRect().height + "px"; setTimeout(function() { isAnimating = false; isPinned = true; }, 200); pinnableContent.addClass('pinned'); var event = $.Event('pinnable:pinned'); $(document.body).trigger(event); var targetData = targetElement.data(); var videoState = getVideoState(); r.analytics.videoPlayerEvent("pinnedvideoplayer", "scroll", "activated", targetData, videoState); } else if (isPinned && !isAnimating && getVisiblePercentageOfElement(pinnablePlaceholder) >= 60) { isAnimating = true; setTimeout(function() { isAnimating = false; pinnablePlaceholder.style.height = “auto”; isPinned = false; }, 200); pinnableContent.removeClass(‘pinned’); var event = $.Event(‘pinnable:unpinned’); $(document.body).trigger(event); } });all 23 commentssorted .: top .bestnewcontroversialoldrandomq&alive (beta)Want to add to the .?Post a comment!Create an account[–]PristineCount0 16 .17 .18 . 11 . . (3 children)
分享到: 更多 (0)

相关推荐

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

b2b链

联系我们联系我们