Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3219 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am in the process of modifying a FileMaker CWP site where a user was allowed to view a video hosted outside of FileMaker. The company upgraded to FileMaker 14 from FileMaker 11 allowing the usage of the getContainerURL method and uses embedded video file in a FileMaker container. My issue is simple, when I use the method I am prompted to authenticate. The authentication prompt is not a total surprise because I “suspect” that the method call is a new session call to FileMaker. So is there a way to use HTML5 and play the video from FileMaker without the prompt?

Note: The prompt is presented across all browsers.

I cannot imagine this is a new question but for some reason I am unable to find a possible direction to the solution. If anyone can please point me in the right direction or point out the flaw in the simple code below it would be greatly appreciated.

Below is a simple version of my code:

(filemaker.db.php)

require_once('FileMaker/FileMaker.php');

$DB_HOST = 'http://127.0.0.1';
$DB_NAME = 'FRM_DB';
$DB_USER = 'username';
$DB_PASS = 'password';

$fmDB = new FileMaker($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS);

 

(index.php)

include_once("filemaker.db.php ");

$webLayout = "[WEB] fm_layout";

$workOrderNumber = "1234";

$containerField = "z_Rough_Media_Store_con";

$layoutFind = $fmDB->newFindCommand($webLayout);

$layoutFind->addFindCriterion("Work_Order_Num_n","==" .$workOrderNumber);

$result = $layoutFind->execute();

if(FileMaker::isError($result)){

    echo("<p>Failed to find Work Order: " .$workOrderNumber ." from Layout: " .$webLayout ." Error: " .$result->getMessage() .”</p>");

    exit();

}
$record = $result->getFirstRecord();
include_once(“headerFile.php”);
?>

    <br>

    <div class="container">

        <h2>HTML5 Video From FileMaker 14</h2>

        <video width="320" height="240" controls>

            <source src="<?php echo($fmDB ->getContainerDataURL($record->getField($containerField))); ?>" type="video/mp4" / >

            <p>Your browser does not support HTML5 Video</p>

        </video>

    </div>

    <br>

<?php include_once("footer.php"); ?>
Posted

$fmDB has the credentials supplied, so even if it is a new call, I would expect those to be used - unless the external storage has some form of protection itself...

What happens if you copy the final value of the src tag, and place it into a new browser window?

  • Like 1
  • Newbies
Posted

Hi Webko

First let me say thank you for your reply.

If I use the getContainer method, which I think is what you were asking, I am not prompted for authentication but the video is severed up as a binary. The HTML5 video tag does not like the binary data directly from the FileMaker container. I agree the credentials are provided through the $fmDB handle but for some reason, beyond me, using the getContainerURL() is acting like a call to FileMaker outside of the provided handle. I do hope this is making some sense.

Posted

What happens when you just echo out:

 

<?php echo($fmDB ->getContainerDataURL($record->getField($containerField))); ?>

This topic is 3219 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.