Is it possible?

I have a php file (and iframe) wich recives a variable from it's main page, then it makes some conversions to this variable to create an URL that should be included in a flv player, I must use html to include the player but I don't know how to parse the varable from the php "area" of this page to the HTML, is it possible?

Member Avatar for diafol

flv players usually use js for parameters. You can control a video to play via js. You could have a bunch of links controlled by an event handler that change the 'file' or similar property of the flv player. No need for php.

I have an example on one of my sites:

http://www.cemeg.diafol.org/byd-eang.php

Hi @ardav

Sounds nice, but I don't want a link to ckic on, I need no show the video directly and my problem is between php (I need to use php to remake the url) and html (I need it to show embed and show the player)

I dont know if I'm expressing correctly my problem :S

Member Avatar for diafol

Ok, which flv player are you using?

@evstevemd can it handle variables between php and htl?

@ardav jwplayer

@evstevemd can it handle variables between php and htl?

To send Variable to HTML just echo it, to send it to PHP however you either us POST/GET or use AJAX.

somthing like:

pseudo code:

<?php
$fileurl = 'www.somedomain.com/somefile.file'
<?
<html>

.......s1.addVariable("file", echo $fileurl)........
</html>

?

Member Avatar for diafol
<head>
...
<?php
if(isset($_GET['videoid']) && !empty($_GET['videoid']) && file_exists("videos/" . $_GET['videoid'] . ".flv")){
  $vid = "videos/" . $_GET['videoid'] . ".flv";
?>
<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>
<?php
}
?>
...
</head>
<body>
...
<?php
if(isset($vid)){
?>
<div id='mediaplayer'></div>
<script type="text/javascript">
  jwplayer('mediaplayer').setup({
    'flashplayer': 'player.swf',
    'id': 'playerID',
    'width': '480',
    'height': '270',
    'file': '<?php echo $vid;?>'
  });
</script>
<?php
}
?>
...
</body>

Something like that?
I don't like that code all mixed up html/php, but it was quick to type. :(

somthing like:

pseudo code:

<?php
$fileurl = 'www.somedomain.com/somefile.file'
<?
<html>

.......s1.addVariable("file", echo $fileurl)........
</html>

?

What are you trying to accomplish?

@ardav PERFECT! The last thing I was needing was the echo PERFECT, THANKS!


@evstevemd thanks! You started the final solution!

Thanks you both, really! ;)

Warm regards from Spain!

Member Avatar for diafol

De nada, ok mark this thread as solved please.


@evstevemd thanks! You started the final solution!

:)

Thanks you both, really! ;)

Warm regards from Spain!

Welcome to DW!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.