@pie-framework/pie-fixed-player-static
v1.0.0-152280c.5
Published
PIE fixed player static bundle containing: categorize, drag-in-the-blank, hotspot, image-cloze-association, multiple-choice. Production-ready, self-contained package with pre-bundled elements (hash: 152280c).
Readme
@pie-framework/pie-fixed-player-static
Version: 1.0.0-152280c.5
Pre-bundled PIE fixed player with static element versions for production use.
Note: This is for production use with a fixed set of PIE elements. For development/testing
in Pieoneer, use pie-inline-player instead.
Included Elements
- @pie-element/[email protected]
- @pie-element/[email protected]
- @pie-element/[email protected]
- @pie-element/[email protected]
- @pie-element/[email protected]
Installation
npm install @pie-framework/[email protected]Usage
<script type="module">
import '@pie-framework/pie-fixed-player-static';
</script>
<pie-fixed-player
item-id="your-item-id"
token="your-jwt-token"
api-base-url="https://api.example.com"
env='{"mode": "gather", "role": "student"}'>
</pie-fixed-player>Attributes
item-id- Item identifierapi-base-url- Base URL for API callstoken- JWT authentication tokenenv- Environment config (mode, role)session- Session data arrayadd-correct-response- Show correct answersexternal-style-urls- Additional CSS URLsloader-config- Loader configuration (JSON string, see below)- Custom styling attributes
Loader Configuration
Control resource loading behavior and New Relic tracking via the loader-config attribute:
<pie-fixed-player
item-id="your-item-id"
loader-config='{"trackPageActions": true, "maxResourceRetries": 3}'>
</pie-fixed-player>Options:
trackPageActions(boolean, default: false) - Enable New Relic instrumentation for module imports and resource loadingmaxResourceRetries(number, default: 3) - Maximum retry attempts for failed resourcesresourceRetryDelay(number, default: 500) - Initial delay in ms before retrying
Global Configuration:
Alternatively, set configuration globally before importing the package:
<script>
window.PIE_LOADER_CONFIG = {
trackPageActions: true,
maxResourceRetries: 3,
resourceRetryDelay: 500
};
</script>
<script type="module">
import '@pie-framework/pie-fixed-player-static';
</script>Resilient Loading
This package includes automatic retry logic for module imports and resource loading:
- Module imports (math-rendering, bundle, player): 4 attempts with exponential backoff (200ms, 400ms, 800ms)
- Runtime resources (images, audio, video): Configurable retry attempts with exponential backoff
- Console logging: warnings for retries, errors only for permanent failures
- New Relic tracking (when enabled): tracks import timing, retries, and failures
Events
load-complete- Fired when item loads successfullysession-changed- Fired when user interacts with questionsplayer-error- Fired on errors
License
MIT
