tutorials:readspeaker
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:readspeaker [2022/10/28 18:58] – [What you would normally do] joaosaraiva | tutorials:readspeaker [2026/03/27 17:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Integration with ReadSpeaker ====== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ===== What you intend to do ===== | ||
| + | |||
| + | You intend to have ReadSpeaker read HTML content protected by Paperview. The content to be read should be the real Paperview-protected content, and not the typical gibberish that is initially rendered in lieu of that protected content. | ||
| + | |||
| + | ===== What you would normally do ===== | ||
| + | |||
| + | ReadSpeaker is typically included in a web page by including a small script inside the '' | ||
| + | <code html> | ||
| + | < | ||
| + | ... | ||
| + | <script src=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Additionally, | ||
| + | <code html> | ||
| + | <div id=" | ||
| + | <a rel=" | ||
| + | <span class=" | ||
| + | <span class=" | ||
| + | </a> | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Finally, the content to be read should be included in the page, in an HTML element accessible via the '' | ||
| + | <code html> | ||
| + | <div id=" | ||
| + | <!-- start of Paperview article content --> | ||
| + | <div data-paperview-seller=" | ||
| + | txof lh68ifyitqwzi0< | ||
| + | 9 iizs 8 o2i g48kl<br /> | ||
| + | 57mlrq | ||
| + | </ | ||
| + | <script src=" | ||
| + | <!-- end of article content --> | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | In a [[https:// | ||
| + | ===== What is the problem ===== | ||
| + | |||
| + | Following the instructions provided by the ReadSpeaker documentation makes the component read aloud the gibberish that temporarily stands for the Paperview-protected content, not the protected content itself. | ||
| + | |||
| + | ===== How you can solve the problem ===== | ||
| + | |||
| + | Instead of adding the ReadSpeaker script via the above-mentioned manner, add the following Javascript snippet to the page (either in a '' | ||
| + | <code javascript> | ||
| + | window.addEventListener(" | ||
| + | window.rsConf = { | ||
| + | general: { usePost: true } | ||
| + | } | ||
| + | |||
| + | const script = document.createElement(' | ||
| + | script.id = ' | ||
| + | script.async = false | ||
| + | script.defer = false | ||
| + | document.head.appendChild(script) | ||
| + | |||
| + | script.onload = function() { | ||
| + | ReadSpeaker.init() | ||
| + | } | ||
| + | |||
| + | script.src = ' | ||
| + | }); | ||
| + | </ | ||
| + | If possible, this script should be included inside the '' | ||
| + | |||
| + | Add the ReadSpeaker buttons in the usual manner, typically one button per piece of article content. If you're using a WordPress setup, your Paperview articles will typically have a single piece of HTML, and so you would only need to add one ReadSpeaker button. | ||
| + | However, you will need to adjust the URL in the '' | ||
| + | <code html> | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | The values to include in the placeholders (with square brackets) of the above URLs are the following: | ||
| + | * **REGION** is the geographical region closest to where your article readers are expected to be. Examples include '' | ||
| + | * **CUSTOMER_ID** (**customerid** parameter) is your customer ID in the ReadSpeaker system. | ||
| + | * **LANGUAGE** (**lang** parameter) is the language in which the content is written and should be read. Examples include '' | ||
| + | * **VOICE_TO_USE** (**voice** parameter) depends on the value of the **lang** parameter (e.g., '' | ||
| + | * **READ_ID** (**readid** parameter) is the ID of the HTML element that contains the content to be read. | ||
| + | |||
| + | After this, you should be able to have ReadSpeaker read aloud the Paperview-protected content of your articles. 8-) | ||
