hls_prefix = "http://vod-vip6.streaming.in2ip.nl/vod/_definst_/smil:smil/"; hls_suffix = ".smil/playlist.m3u8"; thumb_prefix = "//vod-vip2.streaming.in2ip.nl/thumbs/"; fallback_prefix = "hls_prefix"; fallback_suffix = "hls_suffix"; android = false; jwplayer.key="7eCag2aFzXjq2qMBqgeckji91YrheUGuvY/2Mhj1KBE="; function showPlayer(element, token, width, height, onComplete) { if(typeof(onComplete)==='undefined') onComplete = null; if (android) { document.getElementById(element).innerHTML = 'click for video'; document.location = fallback_prefix+token+fallback_suffix; } else { // setup jw jwplayer(element).setup({ playlist: [{ sources: [{ file: hls_prefix+token+hls_suffix },{ file: fallback_prefix+token+fallback_suffix }], tracks: [{ file: thumb_prefix+token+".vtt", kind: "thumbnails" }] }], analytics: { enabled: false }, width: width, height: height, primary: "flash", events:{ onError: function() { jwplayer().stop(); } }, autostart: true }); } jwplayer().onComplete(onComplete); } window.onunload = function(e) { jwplayer().remove(); } window.onbeforeunload = function(e) { jwplayer().remove(); }