(function(){var a="sproutcore/standard_theme";if(!SC.BUNDLE_INFO){throw"SC.BUNDLE_INFO is not defined!"
}if(SC.BUNDLE_INFO[a]){return}SC.BUNDLE_INFO[a]={requires:["sproutcore/empty_theme"],styles:["/static/sproutcore/standard_theme/en/52920dfdad7f0329367ed5692a2fc96881122edb/stylesheet-packed.css","/static/sproutcore/standard_theme/en/52920dfdad7f0329367ed5692a2fc96881122edb/stylesheet.css"],scripts:["/static/sproutcore/standard_theme/en/52920dfdad7f0329367ed5692a2fc96881122edb/javascript-packed.js"]}
})();SC.stringsFor("English",{});VideoApp=SC.Object.create({NAMESPACE:"VideoApp",VERSION:"0.1.0"});
VideoApp.appController=SC.Object.create({playPause:function(){var a=VideoApp.mainPage.mainPane.videoPlayer.canvasView;
a.playPause()},play:function(){var a=VideoApp.mainPage.mainPane.videoPlayer.canvasView;
a.play()},pause:function(){var a=VideoApp.mainPage.mainPane.videoPlayer.canvasView;
a.pause()},theatherMode:function(){var b=VideoApp.mainPage.mainPane;var a=b.get("classNames");
if(a.indexOf("theather_mode")!=-1){a.pop();b.set("classNames",a)}else{b.set("classNames",a.concat("theather_mode"))
}b.displayDidChange()}});SC.SliderExtended=SC.SliderView.extend({onMouseDown:null,onMouseUp:null,mouseDown:function(a){var b=this.get("onMouseDown");
if(b){b()}return arguments.callee.base.apply(this,arguments)},mouseUp:function(b){var a=this.get("onMouseUp");
if(a){a()}return arguments.callee.base.apply(this,arguments)}});SC.VideoView=SC.View.extend({classNames:"sc-video-view",displayProperties:["value","shouldAutoResize"],tagName:"video",videoCurrentTime:0,videoDuration:0,v:null,volume:0,time:"00:00/00:00",render:function(a,b){a.attr("src",this.src);
a.attr("poster",this.poster);a.push("video tag not supported by your browser")},seek:function(){var c=this.get("v");
if(c.paused){c.currentTime=this.get("videoCurrentTime")}var d=this.get("videoCurrentTime");
var a=this.get("videoDuration");var b=this.addZeros(Math.floor(d/60))+":"+this.addZeros(Math.floor(d%60))+"/"+this.addZeros(Math.floor(a/60))+":"+this.addZeros(Math.floor(a%60));
this.set("time",b)}.observes("videoCurrentTime"),addZeros:function(a){if(a.toString().length<2){return"0"+a
}return a},setVolume:function(){var a=this.get("v");a.volume=this.get("volume")}.observes("volume"),didCreateLayer:function(){var a=this.$()[0];
var b=this;this.set("v",a);this.set("volume",a.volume);a.addEventListener("durationchange",function(){SC.RunLoop.begin();
b.set("videoDuration",a.duration);SC.RunLoop.end()},false);a.addEventListener("timeupdate",function(){SC.RunLoop.begin();
b.set("videoCurrentTime",a.currentTime);SC.RunLoop.end()},false)},play:function(){var a=this.get("v");
a.play()},pause:function(){var a=this.get("v");a.pause()},playPause:function(){var a=this.get("v");
if(a.paused){a.play()}else{a.pause()}}});sc_require("views/video");sc_require("views/sliderExtended");
VideoApp.mainPage=SC.Page.design({mainPane:SC.MainPane.design({childViews:"videoPlayer sproutcore credits".w(),videoPlayer:SC.View.design({childViews:"canvasView controllersView".w(),layout:{centerX:0,centerY:0,width:640,height:480},canvasView:SC.VideoView.design({layout:{top:0,left:0,width:640,height:480},canPlayCB:VideoApp.appController.canPlay,classNames:"reflector",src:(SC.browser.safari?"http://tinyvid.tv/vfe/big_buck_bunny.mp4":"http://tinyvid.tv/vfe/big_buck_bunny.ogv")}),controllersView:SC.View.design({layout:{bottom:58,left:0,width:640,height:30},childViews:"playButton progressView timeView minusLabelView volumeView plusLabelView theaterButton".w(),classNames:"controllers",playButton:SC.ButtonView.design({title:"",titleMinWidth:25,icon:"play",layout:{top:0,left:5,width:30},action:"playPause",target:"VideoApp.appController"}),progressView:SC.SliderExtended.design({layout:{top:2,left:40,width:340},value:0,valueBinding:"VideoApp.mainPage.mainPane.videoPlayer.canvasView.videoCurrentTime",minimum:0,maximumBinding:"VideoApp.mainPage.mainPane.videoPlayer.canvasView.videoDuration",onMouseDown:VideoApp.appController.pause,onMouseUp:VideoApp.appController.play}),timeView:SC.LabelView.design({layout:{top:2,left:380,width:85,height:20},classNames:"time",textAlign:SC.ALIGN_CENTER,valueBinding:"VideoApp.mainPage.mainPane.videoPlayer.canvasView.time"}),minusLabelView:SC.LabelView.design({layout:{top:0,left:470,width:25},value:"",icon:"minus"}),volumeView:SC.SliderExtended.design({layout:{top:2,left:485,width:100},value:0,valueBinding:"VideoApp.mainPage.mainPane.videoPlayer.canvasView.volume",minimum:0,maximum:1}),plusLabelView:SC.LabelView.design({layout:{top:0,left:580,width:25},value:"",icon:"plus"}),theaterButton:SC.ButtonView.design({title:"",icon:"theater",titleMinWidth:30,layout:{top:0,right:5,width:30},action:"theatherMode",target:"VideoApp.appController"})})}),sproutcore:SC.LabelView.design({value:"Sproutcore video",classNames:"sproutfont",textAlign:SC.ALIGN_RIGHT,layout:{top:0,right:0,width:300,height:30}}),credits:SC.LabelView.design({tag:"a",classNames:"credits",value:"(c) copyright Blender Foundation | www.bigbuckbunny.org",textAlign:SC.ALIGN_RIGHT,layout:{bottom:0,right:0,width:500,height:20}})})});
VideoApp.main=function main(){VideoApp.getPath("mainPage.mainPane").append()};function main(){VideoApp.main()
};