Passive App Setup

This section contains basic instructions for setting up your Facebook app in your programming language.

To set up your application:

  1. Locate the folder for your programming language from the Facebook Code Sample zip file and copy the contents to your project folder.
  2. Open the Ooyala Facebook usage file (Facebook Code Sample).
  3. Copy the contents to your application.
  4. Make sure to include the imported file.
  5. Insert the return value of the head prefix method as an attribute of the HTML head tag. For example:
 <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#">
  6. Insert the meta tags under the HTML head tag. For a description of these tags, see Sharing Video on Facebook. For example:
    <meta property="fb:app_id" content="318471738213669" />
    <meta property="og:type" content="video.other" />
    <meta property="og:title" content="Bhangra Empire - Jashan 2011" />
    <meta property="og:description" content="dancing" />
    <meta property="og:url" content="https://glowing-spring-6591.herokuapp.com/jashan_2011">
    <meta property="og:image" content="http://ak.c.ooyala.com/c1d3AxMzo5_lJK08LHYfpzFF02StTtfk/Y2BrwET1VVpfCiI35jMDoxOjBrOwKdHu" />
    <meta property="og:video" content="http://glowing-spring-6591.herokuapp.com/jashan_2011" />
    <meta property="og:video:secure_url" content="https://glowing-spring-6591.herokuapp.com/jashan_2011" />
    <meta property="og:video:type" content="text/html" />
    <meta property="og:video" content="http://player.ooyala.com/player.swf?embedCode=c1d3AxMzo5_lJK08LHYfpzFF02StTtfk&keepEmbedCode=true&docUrl=http%3A%2F%2Fexample.com" />
    <meta property="og:video:secure_url" content="https://player.ooyala.com/player.swf?embedCode=c1d3AxMzo5_lJK08LHYfpzFF02StTtfk&keepEmbedCode=true" />
    <meta property="og:video:type" content="application/x-shockwave-flash" />
    <meta property="og:video:height" content="480" />
    <meta property="og:video:width" content="640" />	
          
        
  7. If you want to automatically add video viewing updates to your viewers’ timelines, add the following to the HTML head as a subelement:
 <script src="http://player-next-staging.ooyala.com/fb/ooyala_fb.js"></script>
  8. If you want to automatically add video viewing updates to your viewers’ timelines, add the following to the body of your page, substituting your Facebook App ID (yourAppId) and Channel URL (yourChannelUrl):

    <div id="fb-root"></div>
    <script type="text/javascript">
      window.fbAsyncInit = function () {
        FB.init({
          appId: "yourAppId", // App ID
          channelUrl: "yourChannelUrl", // Channel File
          status: true, // check login status
          cookie: true, // enable cookies to allow the server to access the session
          xfbml: true // parse XFBML
        });
      };
    
      // Load the SDK Asynchronously
      (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s);
        js.id = id;
        js.src = "//connect.facebook.net/en_US/all.js";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));
    </script>   
  9. Run and test your application.

Was this article helpful?