bloom-player 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -116,19 +116,21 @@ Bloom books link to each other using each book's "Instance ID". This is a guid t
|
|
|
116
116
|
"pageCount":16,
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
When the user clicks on a link to another book, Bloom Player will first request a resource from `/book/THE-INSTANCE-ID/index.htm`. If you do a redirect to `C:/mybook/index.htm`, then this will be followed by requests for things like `C:/mybook/basePage.css` and `C:/mybook/image1.png`.
|
|
120
|
-
|
|
121
119
|
To support this, your host needs to:
|
|
122
120
|
|
|
123
121
|
1. intercept that request
|
|
124
122
|
2. extract the Instance ID
|
|
125
123
|
3. figure out the path to that book in your system
|
|
126
124
|
4. if the target is still zipped in a BloomPUB, you may need to unzip it or read the resource directly out of the archive
|
|
127
|
-
5.
|
|
125
|
+
5. handle the incoming urls for all subsequent.
|
|
126
|
+
|
|
127
|
+
Note that when Bloom Player wants to switch to a different book, it will start requesting resources, e.g. `/book/THE-INSTANCE-ID/.distribution`, `/book/THE-INSTANCE-ID/meta.json` and `/book/THE-INSTANCE-ID/index.htm`. Be prepared to receive several of these before you've handled the first one.
|
|
128
|
+
|
|
129
|
+
Depending on your situation, you may find handling this as simple as doing a 302 redirect (as Bloom Editor does), or you may want to take each incoming URL and return the contents of that file (as BloomPUB Viewer does).
|
|
128
130
|
|
|
129
|
-
If
|
|
131
|
+
If step (3) is slow, you might need to cache or even pre-prepare an index for use at runtime.
|
|
130
132
|
|
|
131
|
-
As an example, the file `.storybook/main.ts` sets up Storybook's vite dev server to proxy a couple instance ids to correct folders in this repository's `/public/testBooks` directory.
|
|
133
|
+
As an example, in this repository, the file `.storybook/main.ts` sets up Storybook's vite dev server to proxy a couple instance ids to correct folders in this repository's `/public/testBooks` directory.
|
|
132
134
|
|
|
133
135
|
# Development
|
|
134
136
|
|