Home ›
Showing a single media file with a preview image.
Before you read this article, it is important that you first take a look at the prerequisites
This is probably the most popular use case for the Open Standard Media Player. Here we will simply show a single media file with a preview image. To do this, we will use the file parameter to locate our file, and the image parameter to show an image while the player has not started playing the media. We will also need to disable the playlist region by using the disablePlaylist parameter. Our code will look as follows.
<?php
include("OSMPlayer.php");
$player = new OSMPlayer(array(
'file' => 'http://www.mysite.com/files/myvideo.flv',
'image' => 'http://www.mysite.com/files/myimage.jpg',
'disablePlaylist' => true
));
?>
<html>
<head>
<title>Open Standard Media (OSM) Player: PHP Demo</title>
<script type="text/javascript" src="jquery-ui/js/jquery.js"></script>
<?php print $player->getHeader(); ?>
</head>
<body>
<h2>Open Standard Media (OSM) Player</h2><br/>
<?php print $player->getPlayer(); ?>
</body>
</html>


