
//Pass start and duration both as 0 to play full title
function RenderJW(PlayerContainer, xtid, start, duration, Pheight, Pwidth) {

    if (start == 0 && duration == 0) {// For Title

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}}
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 250, file: "fmg_250/" + xtid + "_250.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 550, file: "fmg_550/" + xtid + "_550.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 900, file: "fmg_900/" + xtid + "_900.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            }
        });

    }
    else {

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid.toString() + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}},
            autostart: true
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 250, file: "fmg_250/" + xtid + "_250.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 550, file: "fmg_550/" + xtid + "_550.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 900, file: "fmg_900/" + xtid + "_900.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    start: start, // for segment start time
                    duration: duration, // for segment stop time
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    start: start, // for segment start time
                    duration: duration // for segment stop time,
                });
            }
        });

    }

}

function RenderJWNoCC(PlayerContainer, xtid, start, duration, Pheight, Pwidth) {

    if (start == 0 && duration == 0) {// For Title

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            plugins: {'timeslidertooltipplugin-1': {}},
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip"
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 250, file: "fmg_250/" + xtid + "_250.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 550, file: "fmg_550/" + xtid + "_550.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 900, file: "fmg_900/" + xtid + "_900.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            }
        });

    }
    else {

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { 'timeslidertooltipplugin-1': {}},
            autostart: true
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 250, file: "fmg_250/" + xtid + "_250.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 550, file: "fmg_550/" + xtid + "_550.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 900, file: "fmg_900/" + xtid + "_900.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    start: start, // for segment start time
                    duration: duration, // for segment stop time
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    start: start, // for segment start time
                    duration: duration // for segment stop time,
                });
            }
        });

    }

}

//Pass start and duration both as 0 to play full title
function RenderJWNoH264(PlayerContainer, xtid, start, duration, Pheight, Pwidth) {

    if (start == 0 && duration == 0) {// For Title

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}}
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            }
        });

    }
    else {

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid.toString() + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}},
            autostart: true
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    start: start, // for segment start time
                    duration: duration, // for segment stop time
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    start: start, // for segment start time
                    duration: duration // for segment stop time,
                });
            }
        });

    }

}

function RenderJWNoCCNoH264(PlayerContainer, xtid, start, duration, Pheight, Pwidth) {


        if (xtid == '35671') {
                                if (start == 0 && duration == 0) {// For Title

                                    jwplayer(PlayerContainer).setup({
                                        flashplayer: "http://digital.films.com/JWplayer/player.swf",
                                        controlbar: "over",
                                        "controlbar.idlehide": true,
                                        height: Pheight, //359,
                                        width: Pwidth, //619,
                                        plugins: { 'timeslidertooltipplugin-1': {} },
                                        skin: "http://digital.films.com/JWplayer/skin/lulu.zip"
                                    }).onReady(function() {
                                        if (this.container.tagName.toLowerCase() == "object") {
                                            // Flash case
                                            this.load({

                                                //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                                                levels: [
                                            { bitrate: 400, file: "fmg_400/mp4:" + xtid + "_400.f4v", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                                            { bitrate: 700, file: "fmg_700/mp4:" + xtid + "_700.f4v", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                                            ],
                                                provider: "rtmp",
                                                image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                                            });
                                        } else {
                                            // HTML5 case
                                            this.load({

                                                //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                                                levels: [
                                            { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320 },
                                            { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640 },
                                            { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640 }
                                            ],
                                                provider: "http",
                                                image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                                            });
                                        }
                                    });

                                }
                                else {

                                    jwplayer(PlayerContainer).setup({
                                        flashplayer: "http://digital.films.com/JWplayer/player.swf",
                                        controlbar: "over",
                                        "controlbar.idlehide": true,
                                        height: Pheight, //359,
                                        width: Pwidth, //619,
                                        skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
                                        plugins: { 'timeslidertooltipplugin-1': {} },
                                        autostart: true
                                    }).onReady(function() {
                                        if (this.container.tagName.toLowerCase() == "object") {
                                            // Flash case
                                            this.load({

                                                //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                                                levels: [
                                            { bitrate: 400, file: "fmg_400/mp4:" + xtid + "_400.f4v", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                                            { bitrate: 700, file: "fmg_700/mp4:" + xtid + "_700.f4v", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                                            ],
                                                provider: "rtmp",
                                                start: start, // for segment start time
                                                duration: duration, // for segment stop time
                                                image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                                            });
                                        } else {
                                            // HTML5 case
                                            this.load({

                                                //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                                                levels: [
                                            { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320 },
                                            { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640 },
                                            { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640 }
                                            ],
                                                provider: "http",
                                                start: start, // for segment start time
                                                duration: duration // for segment stop time,
                                            });
                                        }
                                    });

                                }
        
        }
        else 
        {

                                if (start == 0 && duration == 0) {// For Title

                                    jwplayer(PlayerContainer).setup({
                                        flashplayer: "http://digital.films.com/JWplayer/player.swf",
                                        controlbar: "over",
                                        "controlbar.idlehide": true,
                                        height: Pheight, //359,
                                        width: Pwidth, //619,
                                        plugins: { 'timeslidertooltipplugin-1': {} },
                                        skin: "http://digital.films.com/JWplayer/skin/lulu.zip"
                                    }).onReady(function() {
                                        if (this.container.tagName.toLowerCase() == "object") {
                                            // Flash case
                                            this.load({

                                                //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                                                levels: [
                                            { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                                            { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                                            ],
                                                provider: "rtmp",
                                                image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                                            });
                                        } else {
                                            // HTML5 case
                                            this.load({

                                                //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                                                levels: [
                                            { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320 },
                                            { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640 },
                                            { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640 }
                                            ],
                                                provider: "http",
                                                image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                                            });
                                        }
                                    });

                                }
                                else {

                                    jwplayer(PlayerContainer).setup({
                                        flashplayer: "http://digital.films.com/JWplayer/player.swf",
                                        controlbar: "over",
                                        "controlbar.idlehide": true,
                                        height: Pheight, //359,
                                        width: Pwidth, //619,
                                        skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
                                        plugins: { 'timeslidertooltipplugin-1': {} },
                                        autostart: true
                                    }).onReady(function() {
                                        if (this.container.tagName.toLowerCase() == "object") {
                                            // Flash case
                                            this.load({

                                                //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                                                levels: [
                                            { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                                            { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                                            ],
                                                provider: "rtmp",
                                                start: start, // for segment start time
                                                duration: duration, // for segment stop time
                                                image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                                            });
                                        } else {
                                            // HTML5 case
                                            this.load({

                                                //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                                                levels: [
                                            { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320 },
                                            { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640 },
                                            { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640 }
                                            ],
                                                provider: "http",
                                                start: start, // for segment start time
                                                duration: duration // for segment stop time,
                                            });
                                        }
                                    });

                                }

        }

}


//-------------------------------------- Embed Player Functions ----------------------------------------

//Pass start and duration both as 0 to play full title
function RenderJWNoAuto(PlayerContainer, xtid, start, duration, Pheight, Pwidth) {

    if (start == 0 && duration == 0) {// For Title

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}}
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 250, file: "fmg_250/" + xtid + "_250.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 550, file: "fmg_550/" + xtid + "_550.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 900, file: "fmg_900/" + xtid + "_900.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            }
        });

    }
    else {

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid.toString() + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}}
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 250, file: "fmg_250/" + xtid + "_250.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 550, file: "fmg_550/" + xtid + "_550.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 },
                    { bitrate: 900, file: "fmg_900/" + xtid + "_900.mp4", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    start: start, // for segment start time
                    duration: duration, // for segment stop time
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    start: start, // for segment start time
                    duration: duration // for segment stop time,
                });
            }
        });

    }

}

//Pass start and duration both as 0 to play full title
function RenderJWNoH264NoAuto(PlayerContainer, xtid, start, duration, Pheight, Pwidth) {

    if (start == 0 && duration == 0) {// For Title

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}}
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            }
        });

    }
    else {

        jwplayer(PlayerContainer).setup({
            flashplayer: "http://digital.films.com/JWplayer/player.swf",
            controlbar: "over",
            "controlbar.idlehide": true,
            height: Pheight, //359,
            width: Pwidth, //619,
            skin: "http://digital.films.com/JWplayer/skin/lulu.zip",
            plugins: { captions: { file: "http://digital.films.com/FalshCC/" + xtid.toString() + ".xml", state: "false" }, 'timeslidertooltipplugin-1': {}}
        }).onReady(function() {
            if (this.container.tagName.toLowerCase() == "object") {
                // Flash case
                this.load({

                    //file: xtid + "_" + bitrate + ".mp4", streamer: "rtmp://fms.scctv.net/fmg_" + bitrate,
                    levels: [
                    { bitrate: 400, file: "fmg_400/" + xtid + "_400.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 320 },
                    { bitrate: 700, file: "fmg_700/" + xtid + "_700.flv", streamer: "rtmp://media3.scctv.net/fmg_flash_all", width: 640 }
                    ],
                    provider: "rtmp",
                    start: start, // for segment start time
                    duration: duration, // for segment stop time
                    image: "http://digital.films.com/Common/FMGimages/" + xtid + "_Full.jpg"
                });
            } else {
                // HTML5 case
                this.load({

                    //file: "http://media3.scctv.net/films/mp4:" + xtid + "_" + bitrate + ".mp4/playlist.m3u8", 
                    levels: [
                    { bitrate: 250, file: "http://media3.scctv.net/fmg_250/mp4:" + xtid + "_250.mp4/playlist.m3u8", width: 320},
                    { bitrate: 550, file: "http://media3.scctv.net/fmg_550/mp4:" + xtid + "_550.mp4/playlist.m3u8", width: 640},
                    { bitrate: 900, file: "http://media3.scctv.net/fmg_900/mp4:" + xtid + "_900.mp4/playlist.m3u8", width: 640}
                    ],
                    provider: "http",
                    start: start, // for segment start time
                    duration: duration // for segment stop time,
                });
            }
        });

    }

}
