Mark Panaghiston
unread,May 3, 2011, 7:34:30 AM5/3/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jpl...@googlegroups.com
Hello John,
The playHead method is not really the best one to use. Its behaviour depends on how much has loaded and generally before anything has loaded, it has no effect.
To control the start time, use the play method with the optional time parameter. The following command starts playback from 10 seconds.
$(...).jPlayer("play", 10);
To control the end time, you would setup an event handler on the timeupdate event. This will check the currentTime and then perform the action you want when it occurs. I will use a pause for this example and it will pause after 30 seconds of play.
$(...).bind($.jPlayer.event.timeupdate, function(event) {
if(event.jPlayer.status.currentTime > 30) {
$(this).jPlayer("pause");
}
});
You should note that the media URLs will still be accessible by anyone who uses a web dev tool such as Firebug as they can see the URLs, or through inspecting the code in most cases. They could then bypass your limiting solution.
The best way for cases like this is to produce 2 versions, the normal version that you sell and the short preview that you allow easy access to.
Other solution include restricting the referrer on the server to your site. While far from perfect, it can help stop direct access to the media files outside your site. Group members have already given such details on how to do this. Try searching the group if you are interested.
Best regards,
Mark P.