0

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?

3
Contributors
12
Replies
15
Views
6 Years
Discussion Span
Last Post by Stefano Mtangoo
Featured Replies
  • 1
    diafol 3,669   6 Years Ago

    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 … Read More

  • 1
    diafol 3,669   6 Years Ago

    [CODE]<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;?>' … Read More

1

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

0

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

0

@evstevemd can it handle variables between php and htl?

@ardav jwplayer

0

@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.

0

somthing like:

pseudo code:

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

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

?

1
<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. :(

0

somthing like:

pseudo code:

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

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

?

What are you trying to accomplish?

0

@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!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.