(function(g){var h={showArrows:!0,hideFocus:!0},c;SF.Player.autoplay=!1;SF.Player.embedded=!0;$(function(){var b=SF.Utils.currentUri(),f=b.queryKey.share_button_url,d=SF.Player.videoIdFromHistory(),e="/channels/"+SF.Player.channel.id+"/channel_videos/embed",i=b.queryKey.width||400,j="true"==b.queryKey.white||"white"==b.queryKey.white,k=b.queryKey.color||"1188c1";"sharethrough"==b.queryKey.partner&&($("#get-this-widget").hide(),$(".distributed-by").show());SF.Layout.updateCalled||SF.Layout.updateEmbed({width:i,
white:j,color:k});d&&""!==d&&(e+="/starting_with/"+d);"all"===SF.Player.channel.visibility||SF.Player.channel.user_id==SF.currentUser.id?$("#videos").find(".videos_container").load(e,function(){var a=$("#videos");a.jScrollPane(h);c=a.data("jsp");SF.Player.registerVideosScrollApi(c);SF.Player.refreshCarousel();SF.Player.registerFetchVideoFunctions({needEarlierVideos:function(){return 50>=c.getContentPositionX()},earlierVideosUrl:function(a,b){return"/channels/"+a+"/channel_videos/embed/before/"+b},
needLaterVideos:function(){return 50>=c.getContentWidth()-c.getContentPositionX()-$("#videos").width()},laterVideosUrl:function(a,b){return"/channels/"+a+"/channel_videos/embed/after/"+b}});SF.Player.setPlayerReady()}):(SF.Player.Alert.privateChannel(),$("#videos").find(".progress").remove());SF.Player.registerVideoCallbacks({onLoadStart:function(a){$("#player").find(".subtitle").text(a.title);SF.Player.moveVideoToTopOfScrollPane(a,!0)}});$("#videos").find(".video:not(.selected)").live("click",function(){var a=
$(this).closest(".video").attr("data-video-id");SF.Player.playChannelVideo(SF.Player.findChannelVideoByVideoId(a));return!1});$("input, textarea, select").live("blur",SF.Player.bindHotKeys);$("input, textarea, select").live("focus",SF.Player.unbindHotKeys);SF.Player.bindHotKeys();$(".title_bar").click(function(){SF.Tracker.trackEmbed("title","click_through");var a;a=SF.Player.VideoPlayer.current();a=SF.Helpers.Channel.watchUrl(SF.Player.channel,a,{domain:"www.shortform.com"});SF.Player.VideoPlayer.pause();
g.open(a,"_blank");return!1});$("#control_prev").click(SF.Player.playPrevious);$("#control_skip").click(SF.Player.playNext);$("#thumbs_up").click(function(){SF.Mixi&&SF.Mixi.opts.consumer_key?SF.Mixi.opts.auth_code?SF.Utils.shareOnMixi(SF.Mixi.opts.consumer_key,SF.Mixi.opts.auth_code):(mixi.init({appId:SF.Mixi.opts.consumer_key}),mixi.auth({scope:"w_share",state:"touch"})):f?FB.ui({method:"feed",display:"popup",name:"Check this out!",link:f},function(){}):SF.Utils.shareOnFacebook(SF.Player.channel,
SF.Player.VideoPlayer.current())});$("#videos").find(".video:not(.selected)").live("click",function(){var a=$(this).attr("data-video-id");SF.Player.playChannelVideo(SF.Player.findChannelVideoByVideoId(a));return!1});SF.Mixi.opts.consumer_key&&SF.Mixi.opts.auth_code&&SF.Utils.shareOnMixi(SF.Mixi.opts.consumer_key,SF.Mixi.opts.auth_code)})})(this);
