github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

newbamboo / panda_flex_uploader

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 7
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Flex uploader for Panda — Read more

  cancel

http://pandastream.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

typo 
dctanner (author)
Mon Mar 30 03:53:23 -0700 2009
commit  fb3266e188c176faea0b2b90d6933472ab6714c9
tree    3a2af1f6f3458994cf36bb5b05a64835e6d3520c
parent  ccc38931ffbc6e4168bdd1c75b957c791a7c8461
panda_flex_uploader /
name age
history
message
file .DS_Store Mon Mar 30 03:51:47 -0700 2009 First version [dctanner]
file README.markdown Mon Mar 30 03:53:23 -0700 2009 typo [dctanner]
directory bin-debug/ Mon Mar 30 03:51:47 -0700 2009 First version [dctanner]
directory bin-release/ Mon Mar 30 03:51:47 -0700 2009 First version [dctanner]
directory html-template/ Mon Mar 30 03:51:47 -0700 2009 First version [dctanner]
directory src/ Mon Mar 30 03:51:47 -0700 2009 First version [dctanner]
README.markdown

Flex uploader for Panda

Before beginning you will need to have Panda setup and running on your server or an EC2 instance. See http://pandastream.com/docs/ for details about how to do this.

To use the Flex uploader you will will first need to make a POST request to the API of your Panda install, to obtain an upload token. When making this request you include your API key (set when you installed Panda) so the upload can be authenticated. In the response of the POST request you will get an ID for the video which is passed to the Flex uploader and used to identify the upload.

If you're using Ruby on Rails for your client application, you can use the Panda ruby library. See Integrating Panda with your Ruby on Rails application for details. The example Rails Panda client includes an example of the Flex uploader in use.

If you're using PHP, there is a useful library for consuming REST APIs called HTTP_Request2.

Using the uploader

The src/panda_uploader.mxml file contains the bulk of the uploader. If you open the project up in Flex Builder and run Project -> Export Release Build. Copy the bin-release/panda_uploader.swf file to your client application (the public/ folder if you're using Rails).

When a user creates a new video in your client application, you will need to make the POST request to Panda to get an ID for the video. Details of making the request are covered in the API Documentation.

You will then want to display the Flex uploader to the user by embedding it. Take special note of the uploadDest flashVar which is set.

<object id="main" width="500" height="100"
    codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="movie" value="/panda_uploader.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="flashVars" value="uploadDest=UPLOAD_DEST" />
    <embed src="/panda_uploader.swf" quality="high" bgcolor="#ffffff"
      flashVars="uploadDest=UPLOAD_DEST"
        width="500" height="100" name="main" align="middle"
        play="true"
        loop="false"
        quality="high"
        allowScriptAccess="sameDomain"
        type="application/x-shockwave-flash"
        pluginspage="http://www.adobe.com/go/getflashplayer">
    </embed>
</object>

The UPLOAD_DEST text will need to be dynamically replaced with the upload url for that video. The url is built like so:

http://ADDRESS_OF_PANDA_EC2_INSTANCE/videos/VIDEO_ID_FROM_POST_REQUEST/upload

When the user chooses a file it will be immediately uploaded to Panda and added to the encoding queue just as a normal upload is.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server