Kod:
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
function jwplayermycode_info() {
return array(
"name" => "JWPlayer MyCode Embed",
"description" => "A simple MyCode which able you to embed JWPlayer player into your posts easily.",
"website" => "http://www.smkcp.co.cc",
"author" => "acrox999",
"authorsite" => "http://www.smkcp.co.cc",
"version" => "3.0",
"compatibility" => "1*",
'guid' => '27136d166055f29850ddc251788a5d3b'
);
}
$plugins->add_hook("parse_message", "jwplayermycode_run");
function jwplayermycode_activate() {
}
function jwplayermycode_deactivate() {
}
function jwplayermycode_run($content) {
$content = preg_replace("/\[video](.*?)\[\/video\]/si", "<object><embed src='./jwplayer/player.swf' width='530' height='350' allowscriptaccess='always' allowfullscreen='true' flashvars='file=$1'</embed></object>", $content);
$content = preg_replace("/\[audio](.*?)\[\/audio\]/si", "<object><embed src='./jwplayer/player.swf' width='470' height='20' allowscriptaccess='always' allowfullscreen='true' flashvars='file=$1'</embed></object>", $content);
return $content;
}
?>PHP Kod:
<script type='text/javascript' src='swfobject-2.2.js'></script>
<div id='mediaplayer'></div>
<script type="text/javascript">
var flashvars = {
'file': '/videos/bunny.mp4',
'image': '/thumbs/bunny.jpg',
'plugins': 'captions-2',
'captions.back': 'false',
'captions.file': '/captions/bunny.txt'
};
var params = {
'allowfullscreen': 'true',
'allowscriptaccess': 'always'
};
var attributes = {
'id': 'playerID',
'name': 'playerID'
};
swfobject.embedSWF('player.swf', 'mediaplayer', '480', '270', '9', 'false',
flashvars, params, attributes);
</script>
seklinde nasil duzenleriz

