Welcome Developers!

in

Welcome!

in

How to use MyOpenSpace.Video.Field.VIDEO_URI field?

Last post 03-31-2009 9:32 PM by Michael. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-31-2009 2:38 PM

    How to use MyOpenSpace.Video.Field.VIDEO_URI field?

    How do you use the MyOpenSpace.Video.Field.VIDEO_URI field returned from a newFetchVideosRequest()?

    Michael

    Filed under:
  • 03-31-2009 2:53 PM In reply to

    Re: How to use MyOpenSpace.Video.Field.VIDEO_URI field?

    For v0.8, the code should be:

     

    var c = document.getElementById("Output");
    var os;
    var dataRequest;
    function dataRequest()
    {
      os = opensocial.Container.get();
      dataRequest = os.newDataRequest();
      var videosParams = {};
      var VIDEOSReq = os.newFetchVideosRequest(opensocial.IdSpec.PersonId.VIEWER, videosParams);
      dataRequest.add(VIDEOSReq, "optkeygetVideosVIEWER");
      dataRequest.send(getResponse);
    }
    function getResponse(response)
    {
      var VIEWER_VIDEOS = response.get("optkeygetVideosVIEWER").getData().asArray();
      for(var i=0; i < VIEWER_VIDEOS.length; i++)
        c.appendChild(document.createTextNode("VIEWER_VIDEO_TITLE=" + VIEWER_VIDEOSIdea.getField(MyOpenSpace.Video.Field.TITLE) + "\r\n"));
      c.appendChild(document.createTextNode("\r\n"));
    }
    dataRequest();

    I pulled this from our OpenSocial Editor for v0.8, found here: http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=124902

     

    Make sure you click on the "video" button.

    Follow us on twitter:
    http:www.twitter.com/myspacedevteam

    Follow the MDP profile
    http://www.myspace.com/myspacedeveloperplatform
  • 03-31-2009 9:32 PM In reply to

    Re: How to use MyOpenSpace.Video.Field.VIDEO_URI field?

    Right - I'm getting that OK, now in the results,

    video.getField(MyOpenSpace.Video.Field.VIDEO_URL) returns a URL like this:

    http://api.msappspace.com/opensocial-api-v1.svc/JSON/opensocial/OWNER/videos/23514819

    If you go to the URL you get an error message.

    I'd like to be able to play the video.

    What do I do with the URL to play the video?

    Thanks,

    Michael

Page 1 of 1 (3 items)