﻿function openFlowPlayer(vidFile) {
    var swfPath = "http://" + window.location.host + "/flash/flowplayer-3.2.5.swf?" + Math.random();
    flowplayer("a.video", swfPath, {
        key: '#@e942898eefb7693b2d7',
        clip: {
            autoPlay: true,
            buffering: true
        },
        screen: {
            height: "100pct",
            top: 0
        },
        plugins: {
            controls: {
                timeColor: "#ffffff",
                borderRadius: 5,
                bufferGradient: "none",
                slowForward: true,
                backgroundColor: "rgba(0, 0, 0, 0.8)",
                volumeSliderGradient: "none",
                slowBackward: false,
                timeBorderRadius: 20,
                time: true,
                progressGradient: "none",
                height: 25,
                volumeColor: "rgba(253, 195, 21, 1)",
                tooltips: {
                    marginBottom: 5,
                    volume: true,
                    scrubber: true,
                    buttons: false
                },
                opacity: 1,
                fastBackward: false,
                timeFontSize: 12,
                bufferColor: "#a3a3a3",
                volumeSliderColor: "#ffffff",
                border: "0px",
                buttonColor: "#ffc20e",
                mute: true,
                autoHide: {
                    enabled: true,
                    hideDelay: 500,
                    hideStyle: "fade",
                    mouseOutDelay: 500,
                    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)",
                borderWidth: 0,
                scrubberBarHeightRatio: "0.1",
                bottom: "5px",
                stop: false,
                sliderColor: "rgba(56, 56, 56, 1)",
                zIndex: 1,
                scrubberHeightRatio: 0.6,
                tooltipTextColor: "#ffffff",
                sliderGradient: "none",
                timeBgHeightRatio: 1,
                volumeSliderHeightRatio: 0.6,
                name: "controls",
                timeSeparator: " ",
                volumeBarHeightRatio: 0.25,
                left: "0",
                tooltipColor: "#000000",
                playlist: false,
                durationColor: "rgba(129, 129, 129, 1)",
                play: true,
                fastForward: true,
                timeBorder: "0px solid rgba(0, 0, 0, 0.3)",
                progressColor: "rgba(253, 195, 21, 1)",
                scrubber: true,
                volume: true,
                builtIn: false,
                volumeBorder: "1px solid rgba(128, 128, 128, 0.7)"
            }
        }
    });
    //console.log("video path is :" + swfPath);
    if ($f.length > 0) {
        // auto start the first video on the page after 5 seconds
        //setTimeout(function() { $f(0).play() }, 5000);
    }
}
