/** * Created by fcomparini on 10-09-14. * * */ function loadjscssfile(filename, filetype){ if (filetype=="js"){ //if filename is a external JavaScript file var fileref=document.createElement('script') fileref.setAttribute("type","text/javascript") fileref.setAttribute("src", filename) } else if (filetype=="css"){ //if filename is an external CSS file var fileref=document.createElement("link") fileref.setAttribute("rel", "stylesheet") fileref.setAttribute("type", "text/css") fileref.setAttribute("href", filename) } if (typeof fileref!="undefined") document.getElementsByTagName("head")[0].appendChild(fileref) } function doesFileExist(urlToFile) { try { var xhr = new XMLHttpRequest(); xhr.open('HEAD', urlToFile, false); xhr.send(); if (xhr.status == "404") { return false; } else { return true; } } catch(err) { return false; } } var pdkey = "#$4cfdc58f3f36726dc11"; var oas = "de.tvn.cl"; var strm = "//strm.tvn.cl"; var ua = "UA-68762-3"; var logo ="logo_tvn_player_2013.png"; if (document.domain.indexOf("tvndeportes") != -1) pdkey = "#$62172b388804edb6a26"; if (document.domain.indexOf("24horas") != -1) { pdkey = "#$a4c71ee3a2358ec92de"; oas = "de.24horas.cl"; strm = "//strm.24horas.cl"; ua = "UA-68762-21"; logo = "24Horas_preview_Player.png"; } if (document.domain.indexOf("tvn.org") != -1) pdkey = "#$65c12fa33d7a86a4e45"; if (document.domain.indexOf("tvn.cl") != -1) { pdkey = "#$4cfdc58f3f36726dc11"; oas = "de.tvn.cl"; strm = "//strm.tvn.cl"; ua = "UA-68762-3"; logo = "logo_tvn_player_2013.png"; } loadjscssfile(strm + "/js/flowplayer-3.2.13.min.js","js"); loadjscssfile(strm + "/js/flowplayer.ipad-3.2.13.min.js","js"); var iOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false); var Android = (navigator.userAgent.match(/Android/g) ? true : false); var AndroidVersion = 0; if (Android) { var ua = navigator.userAgent; AndroidVersion = parseFloat(ua.slice(ua.indexOf("Android") + 8)); } Debug = true; Levels = 'all'; var SaltarDesde = 15; var SaltarDuracion = 300; if (document.domain.indexOf("www.tvn.cl") != -1 ) {Debug = false; Levels = 'none';} if (document.domain.indexOf("www.24horas.cl") != -1 ) {Debug = false; Levels = 'none';} if (typeof OAS_videopage == "undefined") OAS_videopage = ""; if (typeof geobloqueo == "undefined") geobloqueo = false; if (!(window.console && console.log)) { console = { log: function() {}, debug: function() {}, info: function() {}, warn: function() {}, error: function() {} }; } // configuracion comun var confcomun = { buffering: true, key: pdkey, play: { url: strm + '/img/play_negro.png', width: 69, height: 69 }, contextMenu: [ // 1. "About Flowplayer..."; selecting this item goes to our homepage {'Player TVN ...' : function() { location.href = "http://www.tvn.cl"; }}, // 2. menu separator. '-', // 3. version information. 'Player TVN 3.2.18' ], canvas: { background: '#000000 url("' + strm + '/img/' + logo +'") no-repeat 50pct 50pct', backgroundGradient: 'none', border: '2px solid #000000', height: '360px', width: '640px' }, debug: Debug, plugins: { controls: { autoHide: true, backgroundGradient: 'none', width: '90%', left: 7, bottom: 7, opacity: 0.75, borderRadius: 10, tooltips: { buttons: true, play: 'Reproducir', pause: 'Pausa', menu: 'Calidades', unmute: 'No Silenciar', mute: 'Silenciar', fullscreen: 'Pantalla Completa', fullscreenExit: 'Salir de Pantalla Completa' } } } } // configuraciones comunes var flashhls = { url: strm + "/swf/flashlsFlowPlayer.swf", hls_debug: true, hls_debug2: true } var httpstreaming = { url: strm + "/swf/flowplayer.httpstreaminghls-3.2.17.swf" }; var httpstreaminglive = { url: strm + '/swf/flowplayer.httpstreaminghls-debug-3.2.17.swf', liveButton: false, startLivePosition: true, dvrDynamicBufferTime: 10, dvrSnapToLiveClockOffset: 10 }; var rtmp = { url: strm + "/swf/flowplayer.rtmp-3.2.3.swf" }; var youtube = { url: strm + '/swf/flowplayer.youtube-3.2.6.swf', enableGdata: false, bitratesOnStart: true, onVideoRemoved: function() { console.log("Video Removed"); }, onVideoError: function() { console.log("Incorrect Video ID"); }, onEmbedError: function() { console.log("Embed Not Allowed"); } }; var thumbs = { url: strm + "/swf/flowplayer.controls-preview-3.2.12.swf", frameWidth: 128, frameHeight: 72, thumbnails: true, interval: 5, thumbnailsOffset: 0, loadOnStart: true, tooltip: { hook: false, cornerRadius: 10, padding: 2, paddingTop: 0, paddingBottom: 0, color: "#CCCCCC" } }; var bwcheck = { url: strm + "/swf/flowplayer.bwcheck-httpstreaming.swf", dynamic: true, qos: { frames: false, screen: false, bufferScaleDownFactor: 0.8 }, onStreamSwitch: function(newItem) { var content = $f().getPlugin('calidad'); message = newItem.bitrate + "k"; content.setHtml(message); } }; var calidad = { url: strm + '/swf/flowplayer.content-3.2.8.swf', bottom: '7px', right: '7px', width: '48px', height: '26px', verticalAlign: 3, horizontalAlign: 3, backgroundGradient: 'none', backgroundColor: "#000000", opacity: 0.85, borderRadius: 10, border: 0, style: { body: { fontSize: 12, fontFamily: 'Arial', textAlign: 'center', color: "#ffffff" } } }; var analytics = { url: strm + '/swf/flowplayer.analytics-3.2.9.swf', accountId: ua }; var viral = { url: strm + '/swf/flowplayer.viralvideos-3.2.14.swf', email: false, share: false }; var p = Object; p.autostart = true; var ova = { "url": strm + "/swf/ova.swf", "autoPlay": p.autostart, "player": { "setUrlResolversOnAdClips": false }, "debug": { "levels": Levels }, "ads": { "overlays": { "closeButton": { "type": "standard" } }, "clickSign": { "enabled": true, "verticalAlign": "center", "horizontalAlign": "center", "width": 200, "height": 32, "opacity": 0.5, "borderRadius": 20, "backgroundColor": "#000000", "style": ".smalltext { font-size:12; }", "html": "CLIC PARA MAS INFORMACION", "scaleRate": 0.75 }, "displayCompanions": true, "companions": [ { "id":"Pub_Derecha_1","width":"300","height":"250" } ], "schedule": [ { "position":"pre-roll", "tag": "http://" + oas +"/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position1", "notice": { "type": "countdown", "show": "true", "region": "reserved-system-message", "message": "publicidad termina en _countdown_ segundos" } }, { "position":"auto:bottom", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position4", "duration":"recommended:10", "startTime":"00:00:10" }, { "position": "post-roll", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position2", "notice": { "type": "countdown", "show": "true", "region": "reserved-system-message", "message": "publicidad termina en _countdown_ segundos" } } ] }, "debug": { "levels": "info", "debugger": "firebug" } }; var ova_np = { "url": strm + "/swf/ova.swf", "autoPlay": p.autostart, "player": { "setUrlResolversOnAdClips": false, "metaData": false, "modes": { "linear": { "controls": { "enablePlay": true, "enablePause": true, "enablePlaylist": false, "enableFullscreen": true, "enableTime": false, "enableMute": true, "enableVolume": true } } } }, "debug": { "levels": Levels }, "ads": { "overlays": { "closeButton": { "type": "standard" } }, "clickSign": { "enabled": true, "verticalAlign": "center", "horizontalAlign": "center", "width": 200, "height": 32, "opacity": 0.5, "borderRadius": 20, "backgroundColor": "#000000", "style": ".smalltext { font-size:12; }", "html": "CLIC PARA MAS INFORMACION", "scaleRate": 0.75 }, "displayCompanions": true, "companions": [ { "id":"Pub_Derecha_1","width":"300","height":"250" } ], "schedule": [ { "position":"auto:bottom", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position4", "duration":"recommended:10", "startTime":"00:00:10" }, { "position": "post-roll", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position2", "notice": { "type": "countdown", "show": "true", "region": "reserved-system-message", "message": "publicidad termina en _countdown_ segundos" } } ] }, "debug": { "levels": "info", "debugger": "firebug" } }; var ova_bs = { "url": strm + "/swf/ova.swf", "autoPlay": p.autostart, "player": { "setUrlResolversOnAdClips": false, "metaData": false, "modes": { "linear": { "controls": { "enablePlay": true, "enablePause": true, "enablePlaylist": false, "enableFullscreen": true, "enableTime": false, "enableMute": true, "enableVolume": true } } } }, "debug": { "levels": Levels }, "ads": { "controls": { "skipAd": { "enabled": true, "html": "
Saltar
", "region": { "id": "my-new-skip-ad-button", "verticalAlign": 3, "horizontalAlign": 3, "backgroundColor": "#ff3300", "opacity": 0.8, "borderRadius": 15, "padding": "0 1 1 13", "width": 60, "height": 20 }, "showAfterSeconds": 15, "showForSeconds": 300 } }, "overlays": { "closeButton": { "type": "standard" } }, "clickSign": { "enabled": true, "verticalAlign": "center", "horizontalAlign": "center", "width": 200, "height": 32, "opacity": 0.5, "borderRadius": 20, "backgroundColor": "#000000", "style": ".smalltext { font-size:12; }", "html": "CLIC PARA MAS INFORMACION", "scaleRate": 0.75 }, "displayCompanions": true, "companions": [ { "id":"Pub_Derecha_1","width":"300","height":"250" } ], "schedule": [ { "position":"pre-roll", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position1", "notice": { "type": "countdown", "show": "true", "region": "reserved-system-message", "message": "publicidad termina en _countdown_ segundos" } }, { "position":"auto:bottom", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position4", "duration":"recommended:10", "startTime":"00:00:10" }, { "position": "post-roll", "tag":"http://" + oas + "/RealMedia/ads/adstream_sx.ads/" + OAS_videopage + "@Position2", "notice": { "type": "countdown", "show": "true", "region": "reserved-system-message", "message": "publicidad termina en _countdown_ segundos" } } ] }, "debug": { "levels": "info", "debugger": "firebug" } }; function play(DivId,p) { document.getElementById(DivId).innerHTML=""; if (typeof p === 'string') { var tmp = p; p = Object; p.url = tmp; } if (typeof p.duracion === 'undefined') p.duracion = 0; if (typeof p.autostart === 'undefined') p.autostart = true; if (typeof p.baseurl === 'undefined') p.baseurl = ""; if (typeof p.thumbs === 'undefined') p.thumbs = ""; if (typeof p.rtsp === 'undefined') p.rtsp = ""; if (typeof p.ipad === 'undefined') p.ipad = ""; if (typeof p.live === 'undefined') p.live = false; if (typeof p.ads === 'undefined') p.ads = true; if (typeof p.imagen === 'undefined') { p.imagen = strm + "/img/" + logo; } else { var result = doesFileExist(p.imagen); if (result == false) p.imagen = strm + "/img/" + logo; } p.imagen = escape(p.imagen); if ((p.url.indexOf('encoder') == 0) || (p.url.indexOf('tvchile') == 0) || (p.url.indexOf('tvnabierta') == 0)) p.live = true; if (p.url.indexOf("http://strm.24horas.cl") == 0 ) { var nombre = p.url.replace("http://strm.24horas.cl/",""); if (nombre.indexOf(".")) { nombre = nombre.split('.')[0]; } p.url = "http://wow.tvn.cl:1935/mediacache/_definst_/smil://elemental24h/" + nombre + "/video.smil/playlist.m3u8"; } if (p.url.indexOf("http://strm.tvn.cl") == 0 ) { var nombre = p.url.replace("http://strm.tvn.cl/",""); if (nombre.indexOf(".")) { nombre = nombre.split('.')[0]; } p.url = "http://wow.tvn.cl:1935/mediacache/_definst_/smil://elemental/" + nombre + "/video.smil/playlist.m3u8"; } if (p.live) { if (p.url.indexOf('tvchile') != -1) p.url = "encoder2"; if (p.url.indexOf('tvnabierta') != -1) p.url = "encoder6"; if (p.url.indexOf('encoder') == 0) { var randomnumber = Math.floor(Math.random()*4)+1; var ServerOld = 'wow' + randomnumber + '.tvn.cl:1935/tvn-live/'; switch (p.url.substr(7,1)) { case "1": var param = { url: "http://mdstrm.com/live-stream-playlist-v/5346f688db603a8b0dd9aa66.m3u8", ipad: "http://mdstrm.com/live-stream-playlist-v/5346f688db603a8b0dd9aa66.m3u8", rtsp: "rtsp://" + ServerOld + "mp4:b26226ff4616997e7921be49f3cddbe8_240p", autostart: true, imagen: p.imagen }; playHLSlive(DivId,param); break; case "2": var param = { url: "http://mdstrm.com/live-stream-playlist-v/533adcc949386ce765657d7c.m3u8", ipad: "http://mdstrm.com/live-stream-playlist-v/533adcc949386ce765657d7c.m3u8", rtsp: "rtsp://" + ServerOld + "mp4:285a5c6dade574d5f111419c85c6cf17_240p", autostart: true, imagen: p.imagen }; playHLSlive(DivId,param); break; case "3": var param = { url: "http://mdstrm.com/live-stream-playlist-v/5346f5f2c1e6f5810b5b9df0.m3u8", ipad: "http://mdstrm.com/live-stream-playlist-v/5346f5f2c1e6f5810b5b9df0.m3u8", rtsp: "rtsp://" + ServerOld + "mp4:225f11a5627dd430dbed14a5a169dd74_240p", autostart: true, imagen: p.imagen }; playHLSlive_sp(DivId,param); break; case "4": var param = { url: "http://mdstrm.com/live-stream-playlist-v/53443c472c6e89675103cc4c.m3u8", ipad: "http://mdstrm.com/live-stream-playlist-v/53443c472c6e89675103cc4c.m3u8", rtsp: "rtsp://" + ServerOld + "mp4:b19cd9ff05e2134cadc1a2a49fbacbf3_240p", autostart: true, imagen: p.imagen }; playHLSlive_sp(DivId,param); break; case "5": var param = { url: "http://mdstrm.com/live-stream-playlist-v/5346f657c1e6f5810b5b9df3.m3u8", ipad: "http://mdstrm.com/live-stream-playlist-v/5346f657c1e6f5810b5b9df3.m3u8", rtsp: "rtsp://" + ServerOld + "mp4:afb76bb126ed1661821563583d2c23f3_240p", autostart: true, imagen: p.imagen }; playHLSlive_sp(DivId,param); break; case "6": var param = { url: "http://mdstrm.com/live-stream-playlist-v/525431f81bc42c4539000057.m3u8", ipad: "http://mdstrm.com/live-stream-playlist-v/525431f81bc42c4539000057.m3u8", rtsp: "rtsp://" + ServerOld + "mp4:7cb6048ff45cb5cdf7f5fed828597fd1_240p", autostart: true, imagen: p.imagen }; playHLSlive(DivId,param); break; } } else { if (p.url.indexOf(".m3u8")!=-1) { if (p.ads) { var param = { url: p.url, ipad: p.url, autostart: true, imagen: p.imagen }; playHLSlive(DivId,param); } else { var param = { url: p.url, ipad: p.url, autostart: true, imagen: p.imagen }; playHLSlive_sp(DivId,param); } } } } else { // video reference de tvn.cl de la forma if ((p.url.indexOf("video.smil") != -1) && (p.url.indexOf(".m3u8")==-1)) { p.url = "http://wow.tvn.cl:1935/mediacache/_definst_/smil:/" + p.url + "/playlist.m3u8"; p.ipad = p.url; } // HLS genérico y arreglo si es de tvn.cl o 24horas.cl desde elemental if (p.url.indexOf(".m3u8") != -1) { var Video = p.url; if (p.url.indexOf("wow.tvn.cl") != -1) { var Server = 'tvn.mdstrm.com/mediacache/_definst_/'; if (geobloqueo) Server= 'tvn-vod2.mdstrm.com/mediacache/_definst_/'; var BaseURL = "http://" + Server; Video = Video.replace("wow.tvn.cl:1935/mediacache/_definst_",Server); } var q = { url: Video, baseurl: BaseURL, duracion: p.duracion, autostart: p.autostart, thumbs: p.thumbs, ipad: Video, rtsp: p.rtsp, imagen: p.imagen } if ((q.url.indexOf("elemental")!=-1) && (q.url.indexOf("video.smil")!=-1)) { var nombre = q.url.split('/')[9]; var folder = q.url.split('/')[8]; q.rtsp = "rtsp://wow.tvn.cl:1935/mediacache/_definst_/mp4:/elemental/" + nombre + "/" + nombre + "_240.mp4"; q.thumbs = "http://www.tvn.cl/archivos/"+ folder + "/" + nombre + "/imagenes/" + nombre + ".[index].jpg"; } if (document.domain.indexOf("24horas")!=-1) { if ((q.duracion==0) || (q.duracion>=60)) { if (q.duracion<=300) { playHLS_bs(DivId,q); } else { playHLS(DivId,q); } } else { playHLS_np(DivId,q); } } else { playHLS(DivId,q); }; } // videos mp4 if (p.url.indexOf(".mp4") != -1) { // videos rtmp de 24horas pasados a HLS if ((p.url.indexOf("rtmp")!=-1) && (p.url.indexOf("wow1.tvn.cl")!=-1)) { p.url= p.url.replace("mp4:",""); if (p.url.indexOf('vizrt2')!=-1) { p.url='mp4://24horas2/'+ p.url.substring(p.url.lastIndexOf('/') +1); } else { p.url='mp4://24horas/'+ p.url.substring(p.url.lastIndexOf('/') +1); } // mediastream+TVN var Server = 'tvn.mdstrm.com/mediacache/_definst_/'; if (geobloqueo) Server= 'tvn-vod2.mdstrm.com/mediacache/_definst_/'; p.url.replace("rtmp://wow1.tvn.cl/","http://tvn.mdstrm.com/mediacache/_definst_/"); p.baseurl = "http://"+Server; p.rtsp = "rtsp://wow.tvn.cl:1935/mediacache/_definst_/" + p.url; // solo TVN // var randomnumber=Math.floor(Math.random()*4)+1; // var Server = 'wow'+ randomnumber; // p.url.replace("rtmp://wow1.tvn.cl/","http://" + Server +".tvn.cl:1935/mediacache/_definst_/mp4:/"); // p.baseurl = "http://" + Server +".tvn.cl:1935/mediacache/_definst_/mp4:/"; p.url = p.baseurl + p.url + "/playlist.m3u8"; p.ipad = p.url; if (document.domain.indexOf("24horas")!=-1) { if ((p.duracion==0) || (p.duracion>=60)) { if (p.duracion<=300) { playHLS_bs(DivId,p); } else { playHLS(DivId,p); } } else { playHLS_np(DivId,p); } } else { playHLS(DivId,p); } } // Videos Url de tvn.cl else if (p.url.indexOf("http") == -1) { var Server = 'tvn.mdstrm.com/mediacache/_definst_/'; if (geobloqueo) Server= 'tvn-vod2.mdstrm.com/mediacache/_definst_/'; p.baseurl = "http://"+Server; p.url = "http://" + Server + "mp4:/" + p.url + "/playlist.m3u8"; p.rtsp = "rtsp://wow.tvn.cl:1935/mediacache/_definst_/" + p.url; p.ipad = p.url; if (document.domain.indexOf("24horas")!=-1) { if ((p.duracion==0) || (p.duracion>=60)) { if (p.duracion<=300) { playHLS_bs(DivId,p); } else { playHLS(DivId,p); } } else { playHLS_np(DivId,p); } } else { playHLS(DivId,p); } } else { if (document.domain.indexOf("24horas")!=-1) { if ((p.duracion==0) || (p.duracion>=60)) { if (p.duracion<=300) { playgenerico_bs(DivId,p); } else { playgenerico(DivId,p); } } else { playgenerico_np(DivId,p); } } else { playgenerico(DivId,p); } } } // videos youtube solo con Id if ((p.url.indexOf("http:")==-1) && (p.url.indexOf(".")==-1)) { p.url = "https://www.youtube.com/watch?v=" + p.url; } // videos de youtube if ((p.url.indexOf("youtube.com") != -1) || (p.url.indexOf("youtu.be") != -1)) { playyoutube(DivId,p); } if (p.url.indexOf("rtmp")==0) { playgenerico(DivId,p); } } } //player HLS con preroll, overlay, postroll function playHLS(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if ((p.imagen.indexOf("logo_tvn_player_2013.png")==-1)) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { url: escape(p.url), ipadUrl: p.url, urlResolvers: ['httpstreaming','bwcheck'], provider: 'httpstreaming', scaling: 'fit', bufferLength: 20, baseUrl: p.baseurl, framesURL: p.thumbs }; conf.plugins.httpstreaming = httpstreaming; conf.plugins.thumbs = thumbs; conf.plugins.bwcheck = bwcheck; conf.plugins.calidad = calidad; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf).ipad(); } else { if (AndroidVersion >= 3) { document.getElementById(DivId).innerHTML = ""; } else { document.getElementById(DivId).innerHTML = ""; } } } //player HLS solo overlay, postroll function playHLS_np(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; conf.clip = { url: escape(p.url), ipadUrl: p.url, urlResolvers: ['httpstreaming','bwcheck'], provider: 'httpstreaming', scaling: 'fit', autoBuffering: true, bufferLength: 20, baseUrl: p.baseurl, framesURL: p.thumbs }; conf.plugins.httpstreaming = httpstreaming; conf.plugins.thumbs = thumbs; conf.plugins.bwcheck = bwcheck; conf.plugins.calidad = calidad; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova_np; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf ).ipad(); } else { if (AndroidVersion >= 3) { document.getElementById(DivId).innerHTML = ""; } else { document.getElementById(DivId).innerHTML = ""; } } } //player HLS con preroll y boton saltar, overlay, postroll function playHLS_bs(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { url: escape(p.url), ipadUrl: p.url, urlResolvers: ['httpstreaming','bwcheck'], provider: 'httpstreaming', scaling: 'fit', autoBuffering: true, bufferLength: 20, baseUrl: p.baseurl, framesURL: p.thumbs }; conf.plugins.httpstreaming = httpstreaming; conf.plugins.thumbs = thumbs; conf.plugins.bwcheck = bwcheck; conf.plugins.calidad = calidad; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova_bs; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf ).ipad(); } else { if (AndroidVersion >= 3) { document.getElementById(DivId).innerHTML = ""; } else { document.getElementById(DivId).innerHTML = ""; } } } //player urls http y rtmp con preroll, overlay, postroll function playgenerico(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { scaling: 'scale', autoBuffering: true, bufferLength: 20 }; conf.playlist = [ { "url": p.url, "scaling": "scale", "duration": p.duracion } ]; conf.plugins.rtmp = rtmp; conf.plugins.rtmpInstream = rtmp; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf ).ipad(); } else { document.getElementById(DivId).innerHTML = ""; } } //player urls http y rtmp solo overlay, postroll function playgenerico_np(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { scaling: 'scale', autoBuffering: true, bufferLength: 20 }; conf.playlist = [ { "url": p.url, "scaling": "scale", "duration": p.duracion } ]; conf.plugins.rtmp = rtmp; conf.plugins.rtmpInstream = rtmp; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova_np; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf ).ipad(); } else { document.getElementById(DivId).innerHTML = ""; } } //player urls http y rtmp con preroll y boton saltar, overly, postroll function playgenerico_bs(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { scaling: 'scale', autoBuffering: true, bufferLength: 20 }; conf.playlist = [ { "url": p.url, "scaling": "scale", "duration": p.duracion } ]; conf.plugins.rtmp = rtmp; conf.plugins.rtmpInstream = rtmp; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova_bs; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf ).ipad(); } else { document.getElementById(DivId).innerHTML = ""; } } //player youtube function playyoutube(DivId,p) { console.log( arguments.callee.name ); var ysplit; var youtubeId; if (p.url.indexOf("?")!=-1) { ysplit = p.url.split("="); youtubeId = ysplit[ysplit.length - 1]; } else { ysplit = p.url.split("/"); youtubeId = ysplit[ysplit.length - 1]; } var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { autoPlay: p.autostart, scaling: 'scale', autoBuffering: true, bufferLength: 20, ipadUrl: p.ipad }; conf.playlist = [ { "url": "api:" + youtubeId + "", "scaling": "scale", "provider": "youtube", "urlResolvers": ["youtube"] } ]; conf.plugins.rtmp = rtmp; // conf.plugins.bwcheck = { // url: strm + "/swf/flowplayer.bwcheck-3.2.5.swf", // netConnectionUrl: strm + "/swf/flowplayer.bwcheck-3.2.5.swf", // checkOnStart: true, // maxWidth: 854 // }; conf.plugins.youtube = youtube; if ((!Android) && (!iOS)) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.16.swf",wmode:"opaque"}, conf).ipad(); } else { document.getElementById(DivId).innerHTML = ""; } } //player HLS live sin publicidad function playHLSlive_sp(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { autoPlay: p.autostart, scaling: 'fit', url: escape(p.url), urlResolvers: ['httpstreaming', 'bwcheck'], provider: 'httpstreaming', ipadUrl: escape(p.url), live: true }; conf.plugins.controls.time = false; conf.plugins.controls.scrubber = false; conf.plugins.controls.width = '160'; conf.plugins.httpstreaming = httpstreaminglive; conf.plugins.bwcheck = bwcheck; conf.plugins.calidad = calidad; conf.plugins.analytics = analytics; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.18.swf",wmode:"opaque"}, conf ).ipad(); } else { if (AndroidVersion >= 3) { document.getElementById(DivId).innerHTML = ""; } else { document.getElementById(DivId).innerHTML = ""; } } } //player HLS live con preroll y boton saltar, overlay (y postroll) function playHLSlive(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.clip = { autoPlay: p.autostart, scaling: 'fit', url: escape(p.url), urlResolvers: ['httpstreaming', 'bwcheck'], provider: 'httpstreaming', ipadUrl: escape(p.ipad), live: true }; conf.plugins.controls.time = false; conf.plugins.controls.scrubber = false; conf.plugins.controls.width = '160'; conf.plugins.httpstreaming = httpstreaminglive; conf.plugins.bwcheck = bwcheck; conf.plugins.calidad = calidad; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova_bs; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.18.swf",wmode:"opaque"}, conf ).ipad(); } else { if (AndroidVersion >= 3) { document.getElementById(DivId).innerHTML = ""; } else { document.getElementById(DivId).innerHTML = ""; } } } //player RTMP live con preroll y boton saltar, overlay (y postroll) function playRTMPlive(DivId,p) { console.log( arguments.callee.name ); var conf = JSON.parse(JSON.stringify(confcomun)); if (p.imagen.indexOf("logo_tvn_player_2013.png")==-1) { conf.canvas = ""; document.getElementById(DivId).style.backgroundImage = "url('" + unescape(p.imagen) + "')"; document.getElementById(DivId).style.backgroundSize = "contain"; document.getElementById(DivId).style.position= "relative"; document.getElementById(DivId).innerHTML=""; } else { conf.canvas.background = '#000000 url(' + p.imagen + ') no-repeat 50pct 50pct'; } conf.plugins.controls.time = false; conf.plugins.controls.scrubber = false; conf.plugins.controls.width = '160'; conf.clip = { scaling: 'scale', autoBuffering: true, bufferLength: 5, ipadUrl: p.url }; conf.playlist = [ { "url": p.url, "scaling": "scale", "provider": "rtmp", "ipadUrl": p.url } ]; conf.plugins.rtmp = rtmp; conf.plugins.rtmpInstream = rtmp; conf.plugins.analytics = analytics; conf.plugins.openAdStreamer = ova_bs; conf.plugins.openAdStreamer.autoPlay = p.autostart; if (!Android) { $f(DivId,{src: strm + "/swf/flowplayer.commercial-3.2.18.swf",wmode:"opaque"}, conf ).ipad(); } else { if (AndroidVersion >= 3) { document.getElementById(DivId).innerHTML = ""; } else { document.getElementById(DivId).innerHTML = ""; } } }