You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Problem escaping apostrophe in html section of content plugin Created Aug 3, 2010

This thread is solved

Views: 2508     Replies: 13     Last reply Sep 16, 2010  
You must login first before you can use this feature

jefferson

Posts: 4

Registered:
Aug 3, 2010

Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Hello

I am including a name - O'Kelly - in the html: property of the generic content plugin. If I put it in like this, the Javascript error console thinks that this is the end of the property list, which I would expect. But If I escape the apostrophe, using the backslash , it fails to load, although no error message appears in the console? How do I incorporate the apostrophe?

My code (without the backslash) is:

content:
{
url:'../flowplayer/flowplayer.content-3.2.0.swf',
bottom: 5,
height:40,
backgroundColor: '#000000',
backgroundGradient: 'none',
border: 0,
textDecoration: 'outline',
html: '<p>Mrs O'Kelly describes the range of research interests</p>',
style:
{
body:
{
fontSize: 10,
fontFamily: 'Arial',
textAlign: 'center',
color: '#ffffff'
}
}
}

Any help gratefully received.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Reply to: Problem escaping apostrophe in html section of content plugin, from jefferson
Have you tried double quotes around the value:


html: "<p>Mrs O'Kelly describes the range of research interests</p>",

?

However, even if it works, it's only quick and dirty, but as you're not using a real apostrophe (&#8217;) it could get you going.

jefferson

Posts: 4

Registered:
Aug 3, 2010

» » Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Reply to: » Problem escaping apostrophe in html section of content plugin, from blacktrash
Thanks for the suggestion - I've tried it but no joy.

jefferson

Posts: 4

Registered:
Aug 3, 2010

» » » Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Reply to: » » Problem escaping apostrophe in html section of content plugin, from jefferson
For anyone who's interested, I have got round the problem by using the back tick character (top left on the keyboard).

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Reply to: » » Problem escaping apostrophe in html section of content plugin, from jefferson
Good news! You can just use html entities - it is expanded here, but I entered &#8217; (or &#rsquo; for that matter):

Flowplayer forum example

HTML setup for the player

<!-- include latest Flowplayer javascript file -->
<script language="javascript" src="path/to/flowplayer-3.2.6.js"></script>

<!-- player container with optional splash image -->
<a href="path/to/video_file" id="playerContainer">
	<img src="path/to/splash_image" />
</a>


JavaScript coding

Following script will install Flowplayer into our player container


<script language="javascript">
// our custom configuration is given in third argument
flowplayer("playerContainer", "path/tohttp://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",{
plugins: {
  myContent: {
    url: "flowplayer.content-3.2.0.swf",
    html: "<p>Mrs O’Kelly</p>"
  }
}
});
</script>


jefferson

Posts: 4

Registered:
Aug 3, 2010

» » » » Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Reply to: » » » Problem escaping apostrophe in html section of content plugin, from blacktrash
Thanks, blacktrash, I'll have another go at that!

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » Problem escaping apostrophe in html section of content plugin

Posted: Aug 3, 2010

Reply to: » » » » Problem escaping apostrophe in html section of content plugin, from jefferson
Note that you're right in as far as the ' apostrophe indeed breaks the script, neither &#39; nor &apos; (the latter not portable anyway) work. I also tried unicode escaping (u0027) to no avail.

Jonathan Schmidt

Posts: 6

Registered:
Jun 8, 2010

» » » » » » Problem escaping apostrophe in html section of content plugin

Posted: Aug 31, 2010

Reply to: » » » » » Problem escaping apostrophe in html section of content plugin, from blacktrash
I ran into the same problem in the viral.email.texts.* and viral.share.description fields and could only work around it by using a backtick. The error I kept getting referenced the com.adobe.serialization.json module (pasted below), so maybe it's not Flowplayer? No amount of escaping or replacement with apostrophes/single quote alternatives ever worked except the backtick.

Error: Unterminated string literal
at com.adobe.serialization.json::JSONTokenizer/parseError()
at com.adobe.serialization.json::JSONTokenizer/readString()
at com.adobe.serialization.json::JSONTokenizer/getNextToken()
at com.adobe.serialization.json::JSONDecoder/nextToken()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder()
at com.adobe.serialization.json::JSON$/decode()
at org.flowplayer.config::ConfigParser$http://flowplayer.org/core/internal::parse()
at org.flowplayer.view::Launcher/createFlashVarsConfig()
at org.flowplayer.view::Launcher/callAndHandleError()
at MethodInfo-63()
at flash.display::DisplayObjectContainer/addChild()
at org.flowplayer.view::Preloader/initialize()
at org.flowplayer.view::Preloader/enterFrameHandler()


Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » » » Problem escaping apostrophe in html section of content plugin

Posted: Sep 1, 2010

Reply to: » » » » » » Problem escaping apostrophe in html section of content plugin, from schmidtj
This error comes from the Adobe's JSON library Flowplayer uses. You could try escaping using the JavaScript escape() function.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » » Problem escaping apostrophe in html section of content plugin

Posted: Sep 10, 2010

Reply to: » » » » » » » Problem escaping apostrophe in html section of content plugin, from Anssi
No, that returns the string %27 which doesn't work with the content plugin either.

joliet

Posts: 11

Registered:
Aug 18, 2010

replace apostrophe with simple guillemet

Posted: Sep 16, 2010

Reply to: » » » » » Problem escaping apostrophe in html section of content plugin, from blacktrash
if it is only for typography, I have solve the issue with replacing the apostrophe by simple guillemet
 & #8217;
or
 & rsquo;
juste delete the space after the &, I put it because if not, the code is not shown.
It works perfectly fine into the playlist, for example.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» replace apostrophe with simple guillemet

Posted: Sep 16, 2010

Reply to: replace apostrophe with simple guillemet, from joliet
Errmh, you've read the thread?

http://flowplayer.org/forum/5/47032#post-47040

;-)

and you can show the code by doing &amp;#rsquo; - now, how did I do that ;-)

joliet

Posts: 11

Registered:
Aug 18, 2010

you"re right

Posted: Sep 16, 2010

Reply to: » replace apostrophe with simple guillemet, from blacktrash
well, you are right to laugh at me because I am not very skilled with javascript, and I had many big problem in putting the flowplayer (with javascript controlbar and playlist) in order to make a website for blind people ; it is the reason why I share each time I think I solved a problem... and the page where I have done that (the accessible flowplayer more playlist and javascript controlbar) is
http://www.bertrandjoliet.com/tanguy/internet_fnac.php
It is a work page, and probably you will see many mistakes, but it works with Jaws and it was the goal.
Thanks for all your work,
(and I forgot the Śamp...)

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» you"re right

Posted: Sep 16, 2010

Reply to: you"re right, from joliet
Just to be clear: I did not love at you. If you understood my ironic smiley that way, I herewith apologize. And I fully support the attitude of sharing your knowledge.