Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Embed SWF and MP4 video

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Embed SWF and MP4 video

Postby draccusfly » Tue Mar 25, 2014 5:21 am

Hi,

I have some php code to format and display swf video on our site:

{if logged_out}
{redirect="/portal"}
{/if}


<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='800' height='450' id='single1' name='single1'>
<param name='movie' value='/portal_files/videos/{segment_3}/{segment_4}/{segment_5}'>
<param name='allowfullscreen' value='true'>
<param name='allowscriptaccess' value='always'>
<param name='wmode' value='transparent'>

<embed
id='single2'
name='single2'
src='/portal_files/videos/{segment_3}/{segment_4}/{segment_5}'
width='800'
height='450'
bgcolor='#fff'
allowscriptaccess='always'
allowfullscreen='true'
/>
</object>


<?php

global $DB,$IN;

$video = $IN->fetch_uri_segment('5');
$product = $IN->fetch_uri_segment('4');
$type = $IN->fetch_uri_segment('3');
$path_to_video = $IN->URI;

if(!empty($video)){
$existingVideo = $DB->query("SELECT * FROM exp_popularvideos WHERE path_to_video = '".$DB->escape_str($path_to_video)."' LIMIT 1");
if ($existingVideo->num_rows > 0)
{
$watch_count = $existingVideo->row['watch_count'] + 1;
$data = array('watch_count' => $watch_count);
$sql = $DB->update_string('exp_popularvideos', $data, "path_to_video = '".$path_to_video."'");
} else {
$data = array(
'watch_count' => "1",
'video' => $video,
"path_to_video" => $path_to_video,
"product" => $product,
"type" => $type
);
$sql = $DB->insert_string('exp_popularvideos', $data);
}
$DB->query($sql);
}

?>


This will play swf files without any issues, but I am now getting new content come in as MP4 and have been tasked with getting them working. I am no developer and have little experience in this field, but need to know how I can achieve this?

Any help greatly appreciated..

Drac
draccusfly
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Mar 25, 2014 5:17 am

Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron