ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Embedded swf and mp4 video

March 25, 2014 9:14am

Subscribe [1]
  • #1 / Mar 25, 2014 9:14am

    Draccusfly

    2 posts

    Hi,

    I am trying to get mp4 video to play on our website without varying degrees of success.  the code is as follows:

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


    <object classid=‘clsid:D27CDB6E-AE6D-11cf-96B8-444553540000’ width=‘800’ height=‘450’ id=‘single1’ name=‘single1’>

     

    <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_insp_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_insp_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_insp_popularvideos', $data);
    }
    $DB->query($sql);
    }

    ?>

    Currently as the code lies, I can play MP4 video but it will not resize or show any controls in the player.  As the video is 1080*780 it will not fit in the screen properly and will not play in IE at all.

    I am not a developer and have very little experience with HTML, PHP etc so need a bit of an idiots guide to get this working..

    Any pointers would be greatly appreciated.

    Dracuusfly

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases