Reputation: 10592
I hate using these because I can never find a tutorial for them.
I have a jPlayer
that I am trying to use to play .flv
video files. I have been looking for a tutorial on how to use jPlayer
but everything I can find is either complete garbage, or does not show any code what so ever, just the end product (very helpful, I know).
Here is how I make my jPlayer
:
//Creates the JPlayer for that video
$('#videoPlayerDiv').jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
flv: videoLocation
}).jPlayer("play");
},
supplied: "flv",
swfPath: "jPlayer/js"
});
videoLocation
is a location to each video file. I have already tested the location and it is correct. When I run the page I get the video box to show up, but I cannot get it to play, or show any video file location.
If anyone can find an issue (or a tutorial) that would help me out a lot.
Upvotes: 0
Views: 5929
Reputation: 27038
here is another answer that worked for me:
<!DOCTYPE html>
<link href="http://jplayer.org/latest/skin/pink.flag/jplayer.pink.flag.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://jplayer.org/2.1.0/js/jquery.jplayer.min.js"></script>
<script type="text/javascript">
/*paste or reference your JS here*/
</script>
</head>
<body>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-single">
<div class="jp-gui jp-interface">
<ul class="jp-controls">
<!-- comment out any of the following <li>s to remove these buttons -->
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
</ul>
<!-- you can comment out any of the following <div>s too -->
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
</div>
<div class="jp-title">
<ul>
<li>Cro Magnon Man</li>
</ul>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>
</body>
$(document).ready(function() {
$("#jquery_jplayer_1").jPlayer({
ready: function(event) {
$(this).jPlayer("setMedia", {
flv:"http://www.website.com/videos/training_videos/Buying_Online_vs_Buying_From_Talent_Advisor.flv"
});
},
swfPath: "http://www.jplayer.org/2.1.0/js",
supplied: "flv"
});
});
Upvotes: 0
Reputation: 8966
Try this:
$('#videoPlayerDiv').jPlayer({
ready: function () {
this.element.jPlayer("setFile","path/to/flv/video/file.flv");
}
});
EDIT: OP decided to use flowplayer instead of jPlayer.
Upvotes: 1