You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -98,7 +99,7 @@ This plugin currently supports a handful of options that might help you customiz
98
99
***debug** (boolean) - Display detailed logging in the browser console. ***Default: false***
99
100
***addCtaClickZone** (boolean) - Add or not a clickzone for the cta url. ***Default: true***
100
101
***addSkipButton** (boolean) - Add or not a skip button for skippable ads. ***Default: true***
101
-
***skipButtonOptions** (object) - Customize skip button text and style. ⚠️***inlineStyle*** option extends the default value, unless ***resetStyle*** is set to `true`.
102
+
***skipButtonOptions** (object) - Customize skip button text and style. Warning:***inlineStyle*** option extends the default value, unless ***resetStyle*** is set to `true`.
102
103
***Defaults:***
103
104
```
104
105
{
@@ -114,7 +115,7 @@ The plugin communicates with the consumer through default event bus built into V
Below you can find a list of the events currently supported. Just like the plugin options, this is a work in progress and more events should be available in the future, especially if requested through this repository.
125
126
126
-
***vast.canplay** - The plugin successfully parsed the VAST manifest and is capable of playing an ad
127
127
***vast.playAttempt** - The plugin will try and play a creative of an ad. It might be the case that the creative fails to load, in which case **vast.play** will never be fired
128
-
***vast.play** - The plugin started playing a creative
129
-
***vast.time** - Called every 100ms or so, this event gives the consumer an update of the current position within a creative
128
+
***vast.play** - The plugin started playing a creative. Contains `ctaUrl`, `skipDelay`, `adClickCallback` and `duration`
129
+
***vast.metadata** - Fired when ad metadata is available. Contains `duration`, `id`, `adId` and `type`
130
+
***vast.time** - Called on each time update during ad playback. Contains `position`, `currentTime` and `duration`
131
+
***vast.skip** - Called when the user skips the current ad
130
132
***vast.complete** - Called once the current ad pod (set of ads) is done playing
131
-
***vast.error** - Called if the plugin fails at some point in the process
132
-
***vast.click** - Called once the plugin succeffully registers a click in the call to action element associated with an ad - check the [Implementing a CTA](#implementing-a-cta) section for more details
133
+
***vast.click** - Called once the plugin successfully registers a click in the call to action element associated with an ad - check the [Implementing a CTA](#implementing-a-cta) section for more details
134
+
***vast.error** - Called if the plugin fails at some point in the process. Contains `message` and optionally `tag`
133
135
134
-
#### Runnning locally
136
+
#### Running locally
135
137
136
-
Running the plugin locally to further develop it is quite simple. Since the plugin repository does not contain any selfcontained development environment, we recommend using [**yalc**](https://www.npmjs.com/package/yalc) to publish the package in a local repository and then use [**yalc**](https://www.npmjs.com/package/yalc) again to install the plugin from the same local repository in in a dedicated development environment or even within the project you are working on.
138
+
The plugin includes a self-contained development environment with a demo page.
137
139
138
-
Here's a small step-by-step to run the plugin locally.
139
-
140
-
* Install Yalc globally with ```npm i yalc -g``` or, using yarn: ```yarn global add yalc```
141
140
* Clone the repository with ```git clone https://github.com/ArteGEIE/videojs-vast.git```
142
-
* Install the plugin dependencies with ```npm install```
143
-
* Run the plugin in watch mode with ```npm start```, leave this terminal open while you are working on the plugin's code
144
-
* In your local project, run ```yalc add videojs-vast``` to install the plugin from your local repository
145
-
* Run your project normally, it will consume the local version of the plugin
141
+
* Install dependencies with ```npm install```
142
+
* Run ```npm start``` to start the dev environment (serves the demo on http://localhost:3333, watches for changes and rebuilds automatically)
143
+
144
+
If you prefer using [**yalc**](https://www.npmjs.com/package/yalc) to test the plugin within your own project:
145
+
146
+
* Install Yalc globally with ```npm i yalc -g```
147
+
* Run ```npm run build:local``` to build and push to the local yalc registry
148
+
* In your project, run ```yalc add @artegie/videojs-vast```
149
+
150
+
#### Testing
151
+
152
+
*```npm test``` - Run all tests (unit + E2E)
153
+
*```npm run test:unit``` - Run unit tests (Vitest)
154
+
*```npm run test:e2e``` - Run E2E tests (Cypress, requires the dev server on port 3333)
155
+
*```npm run test:open``` - Open Cypress interactive runner
0 commit comments