Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Facebook vs. URL w/ query string


I'm having a problem with both the Facebook plugin, and the Facebook part of the Sharing plugin. No matter how i encode the url the plugin sends the & symbol to Facebook and everying from that point on gets lost. Any advice you can offer would be appreciated. Thanks! -Scott

bc.. var mediaLink=escape('www.jugtones.com?display=media%26video=bricks');

so.addVariable('linktarget',mediaLink);
so.addVariable('sharing.link',mediaLink);

17 Community Answers

JW Player

User  
0 rated :

Waylan, thanks for the response. I tried using encodeURIComponent, just as it is in your response, but the result is the same.

The URL sent to facebook is still "http://www.facebook.com/sharer.php?u=www.jugtones.com?display=media&video=Bricks". Facebook still cuts it off at the & symbol.

I tested again (using encodeURIComponent) with both the Facebook & Sharing plugins and the result is the same.

Any other ideas?

Thanks for your time,
-Scott

JW Player

User  
0 rated :

It's kind of an unusual URI in that it contains another URI.

You might try double-encoding the URI in the hope that Facebook will be able to unencode the URI with &video=bricks still intact.

bc.. var mediaLink = encodeURIComponent(encodeURIComponent('www.jugtones.com?display=media&video=bricks'));



JW Player

User  
0 rated :

I gave it a try, but no dice. It seems like the plugin itself translates my encoded URL back to normal characters when creating & opening the URL. I've tried encoding the URL in every way i know how, but it always comes out the same in both FF & IE.

Thanks for your time,
-Scott

JW Player

User  
0 rated :

does this plugin plays the video on facebook or just share the link on facebook ?

Ethan Feldman

JW Player Support Agent  
0 rated :

It shares the link on Facebook.

JW Player

User  
0 rated :

i dont have solution but just want to put alight on discussion that even i face same issue

but actually the problem is from nowhere

it is the behaviour of any url in any browser
for example in sharing web address your URL is itself a querystring parameter if you have two querystring parameter till first parameter it work fine but when second parameter cums i.e '&' it becomes the part of sharing website URL parameter...... so here is the issue for which even i didnt got any solution yet.....

JW Player

User  
0 rated :

bc.. var mediaLink = encodeURIComponent('www.jugtones.com?display=media&video=bricks');



JW Player

User  
0 rated :

Ok. The twitter plugin works fine by the way, probably because it converts the URL to a tiny URL before sending it to twitter.

I found that if you convert the &'s to %26's in the URL that opens on facebook, it posts ok. But if you convert the &'s to %26's in the source code, it's not passed through correctly.

This thread - http://www.longtailvideo.com/support/forums/jw-player/bug-reports/9327/facebook-it-plugin - gave me the idea to remove the http:// prefix. That helps keep the title of the post neat.

And then, I found if I triple URL encode the part of the URL with the &'s in it (not the x.x.x/x? part - only from then on, y=y&y=y...) then it works! So

http://a.b.c/d?e=f&g=h

becomes

a.b.c/d?e%25253Df%252526g%25253Dh

And facebook accepts that with a decent post title and a working URL

JW Player

User  
0 rated :

hi guys,

I have got the following url string which I am passing to jwplayer:

http://www.wru.co.uk/tools/multimedia.php?location=mainsite&projguid=9909B5B32F304A129504EFE4DEDDC16B&medid=5511&css=/9.css&nocache=1&jwplayer=1

I have tried various solutions which I have found on this forum but I can't get this to work still.

I did the method which Ben@e-motion suggested.
1) I removed http:// prefix from the url
2) Triple encoded the following part location=mainsite&projguid=9909B5B32F304A129504EFE4DEDDC16B&medid=5511&css=/9.css&nocache=1&jwplayer=1

But this is still not working.

Is there any definite solution for this problem?

thanks
Bahti

Ethan Feldman

JW Player Support Agent  
0 rated :

I just went to your link and used the fbit plugin on the page to post to my fb account.

I got this URL – http://www.wru.co.uk/tools/multimedia.php?location=mainsite&projguid=9909B5B32F304A129504EFE4DEDDC16B&medid=5511&css=%2F9.css&nocache=1&jwplayer=1

Works fine.

JW Player

User  
0 rated :

I still haven't been able to get this to work. The triple URL encoding method above gets the query string through successfully, but a "/" symbol is being added to the end of the url by either the plugin or by Facebook.

Example URL:
http://jugtones.com/?display=media&video=Bricks

The code i'm using:
bc.. var medialink = encodeURIComponent(encodeURIComponent(encodeURIComponent('jugtones.com/?display=media&video=Bricks')));

so.addVariable('sharing.link', medialink);



Thanks for any advice you can offer,
-Scott

JW Player

User  
0 rated :

Ok, sorry.. i missed something above. It works if i only tripple-url encode the query part of the string, as stated above.

bc.. var medialink = 'jugtones.com/'+encodeURIComponent(encodeURIComponent(encodeURIComponent('?display=media&video=Bricks')));

so.addVariable('sharing.link', medialink);



This breaks functionality of the link in the other parts of the sharing-2 plugin, but it works in the facebook plugin.

Ethan Feldman

JW Player Support Agent  
0 rated :

@Scott W. – Try using this tool – http://webcoder.info/reference/URIEsc.html, it should help fix your issues.

JW Player

User  
0 rated :

Hi everyone, I got a problem in the URL too. The JW player doesn't recognize the URL so doesn't show up the Play symbol on the player screen to start playing video. I'm sure that I used the encodeURIComponent.

Here are two sample of the URL and one is ok and one is not

1. This url is ok
http://localhost/file=test.flv

2. This url is not ok
http://localhost/GetFile?file=test.flv

I don't mean that if the video could be played or not but at least JW player could recognize the second url.

I used JW Player 5.4.1530 (licensed version).

Thank you very much if you could help me on this issue.

Regards,
Thuy

Ethan Feldman

JW Player Support Agent  
0 rated :

You need to URL encode the link. Use the link I posted above.

JW Player

User  
0 rated :

This work to me.
convert the &'s to %26's in the URL that opens on facebook
Like THIS:
bc.. <iframe src="http://www.facebook.com/plugins/like.php?href=http://youDomainName.com?SID=25&LID=2&AID=1309&Ctype=1&ACatID=13"></iframe>


TO THIS
bc.. <iframe src="http://www.facebook.com/plugins/like.php?href=http://youDomainName.com?SID=25%26LID=2%26AID=1309%26Ctype=1%26ACatID=13"></iframe>

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks.

This question has received the maximum number of answers.