Hi and thanks for a great product. I’m having a little trouble though. I’ve successfully integrated amazon cloudfront and s2members together and my videos seem to stream brilliantly. However, that’s not the case for iPhone and iPad.
What I get is a screen informing me that there is a problem and it exposes the URL. Exposing the URL is not an issue at the moment but getting the video to work with the HTML 5 fallback is. My code is as follows…..
<?php
// Configuration.
$s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
$s2_jw_config["mp4_video_file_name"] = "http://panicattacksdoc.com/wp-content/plugins/s2member-files/Panic Attacks Part1.mp4"; // Name of your MP4 test file.
// Don't edit anything else below unless you know what you're doing.
?>
<div id="jw-container">JW Player® appears here.</div>
<script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>
<?php /* A direct URL to the RTMP source; counting the file against the current User in real-time. */
$cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name"], "url_to_storage_source" => true, "count_against_user" => true); ?>
<?php /* API Function `s2member_file_download_url()` returns false if access is denied to the current User. */
if (($mp4 = s2member_file_download_url ($cfg, "get-streamer-array"))) { ?>
<script type="text/javascript">
jwplayer("jw-container").setup({modes: /* JW Player®. */
[
/* First try real-time streaming with Flash® player. */
{type: "flash", provider: "rtmp", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}},
/* Else, try an HTML5 video tag. */
{type: "html5", provider: "video",
config: {file: "<?php echo $mp4["url"]; ?>"}},
/* Else, this is a safe fallback. */
{type: "download", /* Download the file. */
config: {file: "<?php echo $mp4["url"]; ?>"}}
],
/* Set video dimensions. */ width: 640, height: 480, 'image': 'http://panicattacksdoc.com/wp-content/uploads/2012/06/Panic-Attacks-Treatment-clip.png', 'title': 'Part 1 | Introduction', 'logo.position': 'bottom-left', 'logo.file': '/wp-content/uploads/2012/06/PanicAttacksLogo-clearer1.png', 'logo.over': '1', 'logo.out': '0.5', 'logo.link': 'http://panicattacksdoc.com', 'logo.hide': 'false', 'logo.margin': '0', 'stretching': 'none', 'controlbar.position': 'bottom'
});
</script>
<?php } else /* Access is denied to the current User. */ { ?>
Sorry, you do NOT have access to this file.
<?php } ?>
I’m not sure what is wrong. I’m a complete noob when it comes to coding for the web. I would greatly appreciate your help, Lewis.
-
This topic was modified 4 years, 5 months ago by
Lewis Smith.