opensocial.Activity with mediaItem attachedd

7 views
Skip to first unread message

Ângela Costa

unread,
Jun 23, 2010, 11:14:00 AM6/23/10
to OpenSocial Client Libraries
Hello.
I trying to post a new activity trough my hi5 application. It works
fine until i try to add a media item(image) to the activity.
The code i using is:

function postActivity()
{
var activityParams = {};
activityParams[opensocial.Activity.Field.TITLE] = "this is a
title";
activityParams[opensocial.Activity.Field.BODY] = "this is a
body body";
var mediaItems = {};
var mediaItem =
opensocial.newActivityMediaItem(opensocial.Activity.MediaItem.Type.IMAGE,"http://
www.myDomain/img.jpg");

// Add a media item link if supported
mediaItem.setField(hi5.ActivityMediaItemField.LINK, ("http://
www.myDomain/img.jpg"));
mediaItems.push(mediaItem);
activityParams[opensocial.Activity.Field.MEDIA_ITEMS] =
mediaItems;

var activity = opensocial.newActivity(activityParams);
opensocial.requestCreateActivity(activity,
opensocial.CreateActivityPriority.HIGH,callback);
}

Could anyone please tell me what is wrong?
would really, really appreciated that

Thanks
AC

Robson Dantas

unread,
Jun 23, 2010, 11:40:48 AM6/23/10
to opensocial-cl...@googlegroups.com
Angela,

I think the best place to post your question is under http://groups.google.com/group/opensocial-api

BTW, it can be a hi5 limitation to post media item. Have you checked your callback to see the result ( an error message, for example ) ?

-Robson Dantas


--
You received this message because you are subscribed to the Google Groups "OpenSocial Client Libraries" group.
To post to this group, send email to opensocial-cl...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-client-l...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-client-libraries?hl=en.


Ângela Costa

unread,
Jun 23, 2010, 11:59:08 AM6/23/10
to OpenSocial Client Libraries
Hi Robson. Thanks for our answer.
The callback function is not fired. There is some problem before that
but i don't know wich is

Ok i will post my question there.
Thanks


On Jun 23, 4:40 pm, Robson Dantas <biu.dan...@gmail.com> wrote:
> Angela,
>
> I think the best place to post your question is underhttp://groups.google.com/group/opensocial-api
>
> <http://groups.google.com/group/opensocial-api>BTW, it can be a hi5
> limitation to post media item. Have you checked your callback to see the
> result ( an error message, for example ) ?
>
> -Robson Dantas
>
> Em 23 de junho de 2010 12:14, Ângela Costa
> <angelalaranjeiraco...@gmail.com>escreveu:
>
>
>
> > Hello.
> > I trying to post a new activity trough my  hi5 application. It works
> > fine until i try to add a media item(image) to the activity.
> > The code i using is:
>
> >           function postActivity()
> >           {
> >                var activityParams = {};
> >                activityParams[opensocial.Activity.Field.TITLE] = "this is a
> > title";
> >       activityParams[opensocial.Activity.Field.BODY] = "this is a
> > body body";
> >                var mediaItems = {};
> >                var mediaItem =
>
> > opensocial.newActivityMediaItem(opensocial.Activity.MediaItem.Type.IMAGE,"h ttp://
> >www.myDomain/img.jpg");
>
> >                 // Add a media item link if supported
> >         mediaItem.setField(hi5.ActivityMediaItemField.LINK, ("http://
> >www.myDomain/img.jpg"));
> >                 mediaItems.push(mediaItem);
> >                 activityParams[opensocial.Activity.Field.MEDIA_ITEMS] =
> > mediaItems;
>
> >                var activity = opensocial.newActivity(activityParams);
> >                opensocial.requestCreateActivity(activity,
> > opensocial.CreateActivityPriority.HIGH,callback);
> >           }
>
> > Could anyone please tell me what is wrong?
> >  would really,  really appreciated that
>
> > Thanks
> > AC
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "OpenSocial Client Libraries" group.
> > To post to this group, send email to
> > opensocial-cl...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > opensocial-client-l...@googlegroups.com<opensocial-client- libraries%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages