{"id":13908578,"url":"https://github.com/Eyevinn/video-event-filter","last_synced_at":"2025-07-18T07:31:39.674Z","repository":{"id":41839699,"uuid":"315555819","full_name":"Eyevinn/video-event-filter","owner":"Eyevinn","description":"A simple module to filter the events sent from the video element in a way that align with what is, most probably, expected from an analytics perspective.","archived":false,"fork":false,"pushed_at":"2024-03-07T13:00:24.000Z","size":210,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-07T20:44:20.433Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eyevinn.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-11-24T07:45:25.000Z","updated_at":"2023-10-31T04:09:03.000Z","dependencies_parsed_at":"2024-04-16T03:43:22.899Z","dependency_job_id":"5bafd1ee-93ef-4f37-b3a0-65356cd42987","html_url":"https://github.com/Eyevinn/video-event-filter","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/Eyevinn/video-event-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fvideo-event-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fvideo-event-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fvideo-event-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fvideo-event-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eyevinn","download_url":"https://codeload.github.com/Eyevinn/video-event-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fvideo-event-filter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265720598,"owners_count":23817268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library"],"created_at":"2024-08-06T23:02:50.484Z","updated_at":"2025-07-18T07:31:39.431Z","avatar_url":"https://github.com/Eyevinn.png","language":"TypeScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"\u003e [!CAUTION]\n\u003e This repository has been deprecated in favour of [eyevinn/media-event-filter](https://github.com/Eyevinn/media-event-filter \"Media Event Filter\")\n\nVideo Event Filter\n===\n\nA simple module to filter the events sent from the video element in a way that align with what is, most probably, expected from an analytics perspective.\n\n### Difference vs default events\n\nThe main differences that this filtering brings is\n\n- No `pause` is triggered while not playing. I.e. for seek, buffering or similar.\n- Instead of `waiting` event we have a proper **`buffering`** and `buffered` event flow.\n- `timeupdate` is only triggered during ongoing playback.\n- A `play` event after `pause` is now called **`resume`** to differ from the `play` event.\n\n## Implementation\n\n```js\n  import { VideoEventFilter } from \"@eyevinn/video-event-filter\";\n\n  const videoElement = document.querySelector(\"video\");\n\n  const videoEventFilter = new VideoEventFilter(videoElement);\n  videoEventFilter.addEventListener(\"*\", (event, data) =\u003e {\n    console.log(\"EVENT:\", event);\n  });\n```\n\n### Events\n\nThese are exposed as an Enum `PlayerEvents`.\n\n- `loading`\n- `loaded`, video have loaded, but not started\n- `play`, video have started to play\n- `pause`\n- `resume`, video have started to play after a `pause`\n- `seeking`\n- `seeked`, video is done seeking. Continue in the state that existed before.\n- `buffering`\n- `buffered`, video is done buffering. Continue in the state that existed before.\n- `timeupdate`\n- `ended`\n- `error`\n\n### States\n\nYou can also fetch the current state from the player, which will match the states exposed in `PlayerState`.\n\n```js\n  import { VideoEventFilter } from \"@eyevinn/video-event-filter\";\n\n  const videoElement = document.querySelector(\"video\");\n  const videoEventFilter = new VideoEventFilter(videoElement);\n\n  const currentState = videoEventFilter.getState()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEyevinn%2Fvideo-event-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEyevinn%2Fvideo-event-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEyevinn%2Fvideo-event-filter/lists"}