0

I'm working with wordpress,and trying to paste video url to video player I have php script that get from I database video url.

$post_id = $_GET['post_id'];

global $wpdb;

$query = "SELECT * FROM wp_posts WHERE wp_posts.post_type = 'attachment' AND wp_posts.post_mime_type LIKE '%flv%' AND wp_posts.post_parent = $post_id";

$result = $wpdb->get_row($query);

$video = $result->guid;

Can someone help me with this,to finish this thing.

HTTPService id="video_url" resultFormat="text"

VideoPlayer x="10" y="10" width="384" height="308" source="HERE I NEED TO LOAD DINAMICLY VIDEO URL" id="videoDisplay" autoPlay="false"

Video url is pulled when page loads. Script that pull data from database and player are on the same page.

Can someone help me with this please.

user147
  • 1,312
  • 5
  • 22
  • 41

1 Answers1

1

If you are getting the video's id on the same script that displays the player you can parse the data to flex application using flashvars. In this case there is no need for the HTTPservice. You will use php to get the id and then, when you will display the player you will send to it the id:

Check this link for detailed info on how to set the flashvars.

And this one to see how you work with flashvars in flex4.

Chris Ghenea
  • 12,473
  • 1
  • 29
  • 36
  • It looks great,which files should I put wordpress theme folder.How to compiler it in right way? – user147 Jan 24 '11 at 23:55
  • do you have a "release" folder under your project's folder? – Chris Ghenea Jan 25 '11 at 09:19
  • I figure that out,and it is working great,I have only just left to send image from flex to my php script that will save that image,not sure how to send image via http:service,any idea please? – user147 Jan 25 '11 at 23:50
  • Ok,just how to send image via http:service in flex? – user147 Jan 25 '11 at 23:58
  • Ok,I manage to send an image,now I have a problem,I need to return some result,it is text result,and in other script I need to return an array,and I need to paste result from php into label.Can you help me with this,please. – user147 Jan 26 '11 at 02:26
  • Why when click on save image to img control,this code dont work on server,but on localhost work,code : var bmpData:BitmapData = new BitmapData(videoDisplay.width,videoDisplay.height-25); bmpData.draw(videoDisplay); var bm:Bitmap = new Bitmap(bmpData); img.source = bm; var jpg_e:JPEGEncoder = new JPEGEncoder(); var bytes:ByteArray = new ByteArray(); bytes = jpg_e.encode(bmpData); var b64e:Base64Encoder = new Base64Encoder() b64e.encodeBytes(bytes); str = b64e; – user147 Jan 26 '11 at 03:50
  • You should ask another question with this topic so other people that might have the same problem could find it easy, plus more people cam answer it. – Chris Ghenea Jan 26 '11 at 11:06
  • Yeah,you are right,I just wanted to finish everything,and to post all code. – user147 Jan 26 '11 at 14:19