| 1 |
<div id="jw-container">JW Player® appears here.</div> |
| 2 |
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script> |
| 3 |
|
| 4 |
<script type="text/javascript"> |
| 5 |
/* The Shortcode here will return a JSON object for JavaScript notation. */ |
| 6 |
/* A direct URL to the RTMP source; counting the file against the current User in real-time. */ |
| 7 |
/* API Shortcode `s2File` returns a null object if access is denied to the current User/Member. */ |
| 8 |
var mp4 = [s2File download="video.mp4" url_to_storage_source="true" count_against_user="true" get_streamer_json="true" /]; |
| 9 |
</script> |
| 10 |
|
| 11 |
<script type="text/javascript"> |
| 12 |
if(typeof mp4 === 'object') /* `s2File` returns a null object if access is denied to the current User. */ |
| 13 |
{ |
| 14 |
jwplayer("jw-container").setup({modes: /* JW Player®. */ |
| 15 |
[ |
| 16 |
/* First try real-time streaming with Flash® player. */ |
| 17 |
{type: "flash", provider: "rtmp", src: "/jwplayer/player.swf", |
| 18 |
config: {streamer: mp4['streamer'], file: mp4['file']}}, |
| 19 |
|
| 20 |
/* Else, try an HTML5 video tag. */ |
| 21 |
{type: "html5", provider: "video", |
| 22 |
config: {file: mp4['url']}}, |
| 23 |
|
| 24 |
/* Else, this is a safe fallback. */ |
| 25 |
{type: "download", /* Download the file. */ |
| 26 |
config: {file: mp4['url']}} |
| 27 |
], |
| 28 |
/* Set video dimensions. */ width: 480, height: 270 |
| 29 |
}); |
| 30 |
} |
| 31 |
else /* Else, `s2File` returned a null object value. */ |
| 32 |
{ |
| 33 |
document.write('Sorry, you do NOT have access to this file.'); |
| 34 |
} |
| 35 |
</script> |