var conf = {
    clip: {
        provider: "rtmp",
        autoPlay: true,
        autoBuffering: true,
        baseUrl: 'rtmp://media.victoriaadvocate.com/videoserv/',
        onBegin: function(clip) {
            // track initial request of movie
            _gaq.push(['_trackEvent', 'Videos', 'Request', clip.url]);
            if ( typeof(clip.playlist) == "undefined") {
                $f().getPlugin("controls").hide();
            } else {
                $f().getPlugin("controls").show();
                $("#video_info").fadeOut(750, function() {
                    $("#video_info h3").html(clip.title);
                    //alert('title' + clip.title);
                    if (clip.caption > '') {
                        $(".caption").html(clip.caption);
                    } else {
                        $(".caption").html("&nbsp;");
                    }
                    if (clip.credit_url > '') {
                        var byline = 'Video by <a href="' + clip.credit_url + '">' + clip.credit + '</a>';
                    } else {
                        if (clip.credit > '') {
                            var byline = clip.credit;
                        } else {
                            var byline = '';
                        }
                    }
                    $("#byline").html(byline);
                    if (clip.story_url > '') {
                        $("#video_story").show();
                        $("#video_story_link").attr("href", clip.story_url);
                    } else {
                        $("#video_story").hide();
                    }
                }).fadeIn(750);
            }
            $("li[videoid="+clip.id+"]").remove();
        },
        
        // track start actual play event for this clip
        onStart: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Play', clip.url]);
        },

        // track pause event for this clip. time (in seconds) is also tracked
        onPause: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Pause', clip.url, parseInt(this.getTime())]);
        },

        // track stop event for this clip. time is also tracked
        onStop: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Stop', clip.url, parseInt(this.getTime())]);
        },

        // track resume event for this clip. time is also tracked
        onResume: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Resume', clip.url, parseInt(this.getTime())]);
        },

        // track onBufferEmpty event for this clip. time is also tracked
        onBufferEmpty: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'BufferEmpty', clip.url, parseInt(this.getTime())]);
        },

        // track resize event for this clip. time is also tracked
        onResized: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Resize', clip.url, parseInt(this.getTime())]);
        },

        // track fullscreen event for this clip. time is also tracked
        onFullscreen: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Fullscreen', clip.url, parseInt(this.getTime())]);
        },

        // track seek event for this clip. time is also tracked
        onSeek: function(clip, info) {
            _gaq.push(['_trackEvent', 'Videos', 'Seek', clip.url, info]);
        },

        // track finish event for this clip
        onFinish: function(clip) {
            _gaq.push(['_trackEvent', 'Videos', 'Finish', clip.url, parseInt(this.getTime())]);
        },

        // track error events for this clip
        onError: function(clip, error_code, error_message) {
            _gaq.push(['_trackEvent', 'Videos', 'Error', clip.url, error_code+':'+error_message]);
        }
    },
    
    controls: {
        "timeColor":"#ffffff",
        "slowForward":true,
        "bufferGradient":"none",
        "backgroundColor":"rgba(125, 125, 125, 0.35)",
        "volumeSliderGradient":"none",
        "slowBackward":false,
        "timeBorderRadius":20,
        "progressGradient":"none",
        "time":true,"height":26,
        "volumeColor":"#4599ff",
        "tooltips":{"marginBottom":5,"volume":true,"scrubber":true,"buttons":false},
        "fastBackward":false,
        "opacity":1,
        "timeFontSize":12,
        "bufferColor":"#ffffff",
        "border":"0px",
        "volumeSliderColor":"#ffffff",
        "buttonColor":"#ffffff",
        "mute":true,
        "autoHide":{"enabled":true,"hideDelay":1000,"hideStyle":"slide","mouseOutDelay":1000,"hideDuration":400,"fullscreenOnly":false},
        "backgroundGradient":"none",
        "width":"100pct",
        "display":"block",
        "sliderBorder":"1px solid rgba(128, 128, 128, 0.7)",
        "buttonOverColor":"#ffffff",
        "fullscreen":true,
        "timeBgColor":"rgb(0, 0, 0, 0)",
        "scrubberBarHeightRatio":0.4,
        "bottom":0,
        "stop":false,
        "zIndex":1,
        "sliderColor":"#000000",
        "scrubberHeightRatio":0.6,
        "tooltipTextColor":"#ffffff",
        "sliderGradient":"none",
        "timeBgHeightRatio":0.8,
        "volumeSliderHeightRatio":0.6,
        "name":"controls",
        "timeSeparator":" ",
        "volumeBarHeightRatio":0.2,
        "left":"50pct",
        "tooltipColor":"rgba(0, 0, 0, 0)",
        "playlist":true,
        "durationColor":"#b8d9ff",
        "play":true,
        "fastForward":true,
        "progressColor":"#000000",
        "timeBorder":"0px solid rgba(0, 0, 0, 0.3)",
        "volume":true,
        "scrubber":true,
        "volumeBorder":"1px solid rgba(128, 128, 128, 0.7)",
        "builtIn":false
    },
    
    overlays: {
        "regions": [
            {
                "id": "bottom-center",
                "verticalAlign": 300,
                "horizontalAlign": "left",
                "backgroundColor": "#000000",
                "style": ".smalltext { font-size: 12px; color:#ffffff; }",
                "color": "#FFFFFF",
                "opacity": 0.7,
                "borderRadius": 0,
                "padding": "5 5 5 5",
                "width": "100%",
                "height": 60
            },
            {
                "id": "bottom-notice",
                "verticalAlign": 338,
                "horizontalAlign": "right",
                "backgroundColor": "transparent",
                "width": "100pct",
                "height": 40,
                "showCloseButton": false,
                "style": ".smalltext {font-size:12px; color:#000000;}"
            }
        ]
    },
    
    clickSign: {
        "enabled": true,
        "verticalAlign": "center",
        "horizontalAlign": "center",
        "width": 250,
        "height": 32,
        "opacity": 0.7,
        "borderRadius": 20,
        "backgroundColor": "#000000",
        "style": ".smalltext { font-size: 12px; color:#ffffff; }",
        "html": "<p class=\"smalltext\" align=\"center\">Click here for more information.</p>",
        "scaleRate": 0.75
    },
    
    servers: {
        "type": "OpenX",
        "apiAddress": "http://openx.victoriaadvocate.com/www/delivery/fc.php",
        "allowAdRepetition": true
    },
    
    openAdStreamer: {
        url: "{{ STATIC_MEDIA_URL }}victoriaadvocate/flash/flowplayer/OpenAdStreamer.swf",
        
        "deliveryType": "streaming",
        "overlays": {
            "regions": [
                {
                    "id": "bottom-center",
                    "verticalAlign": "bottom",
                    "horizontalAlign": "left",
                    "backgroundColor": "#000000",
                    "style": ".smalltext { font-size: 12px; color:#ffffff; }",
                    "color": "#FFFFFF",
                    "opacity": 0.7,
                    "borderRadius": 0,
                    "padding": "5 5 5 5",
                    "width": "100%",
                    "height": 50
                }
            ]
        },
        "debug": {
            "debugger": "firebug",
            "levels": "all"
        },
        "ads": {
            "pauseOnClickThrough": true,
            "clickSign": {
                "enabled": true,
                "verticalAlign": "center",
                "horizontalAlign": "center",
                "width": 250,
                "height": 32,
                "opacity": 0.7,
                "borderRadius": 20,
                "backgroundColor": "#000000",
                "style": ".smalltext { font-size: 12px; color:#ffffff; }",
                "html": "<p class=\"smalltext\" align=\"center\">Click here to view our Web site.</p>",
                "scaleRate": 0.75
            },
            "servers": [
                {
                    "type": "OpenX",
                    "apiAddress": "http://openx.victoriaadvocate.com/www/delivery/fc.php"
                }
            ],
            "schedule": [
                {
                    "zone": "108",
                    "position": "pre-roll"
                },
                {
                    "zone": "2",
                    "startTime": "00:00:10",
                    "duration": "10",
                    "position": "bottom-center"
                }
            ]
        }
    }
}

