PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 110926
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v110926
260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 All 189 releases
s2member / includes / menu-pages / code-samples / jwplayer-streaming-mp4-sca.php

jwplayer-streaming-mp4-sca.php in s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions 110926, at includes/menu-pages/code-samples/jwplayer-streaming-mp4-sca.php

35 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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>