{"id":13767464,"url":"https://github.com/videojs/videojs-contrib-dash","last_synced_at":"2025-05-10T22:31:51.827Z","repository":{"id":34734577,"uuid":"38712778","full_name":"videojs/videojs-contrib-dash","owner":"videojs","description":"Video.js plugin for supporting the MPEG-DASH playback through a video.js player","archived":false,"fork":false,"pushed_at":"2023-05-24T20:02:29.000Z","size":61634,"stargazers_count":297,"open_issues_count":68,"forks_count":130,"subscribers_count":43,"default_branch":"main","last_synced_at":"2025-04-29T14:08:26.642Z","etag":null,"topics":["mpeg-dash-playback","video","videojs"],"latest_commit_sha":null,"homepage":"https://videojs.github.io/videojs-contrib-dash/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/videojs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null}},"created_at":"2015-07-07T20:24:45.000Z","updated_at":"2025-03-31T00:57:30.000Z","dependencies_parsed_at":"2024-06-18T12:40:17.441Z","dependency_job_id":"8ff150fa-58aa-4ece-81ff-79666550c781","html_url":"https://github.com/videojs/videojs-contrib-dash","commit_stats":{"total_commits":181,"total_committers":27,"mean_commits":6.703703703703703,"dds":0.7569060773480663,"last_synced_commit":"9f1988891603d2584afc929279ccb314ceb5612f"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-contrib-dash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-contrib-dash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-contrib-dash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-contrib-dash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/videojs","download_url":"https://codeload.github.com/videojs/videojs-contrib-dash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253411528,"owners_count":21904147,"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":["mpeg-dash-playback","video","videojs"],"created_at":"2024-08-03T16:01:08.894Z","updated_at":"2025-05-10T22:31:50.012Z","avatar_url":"https://github.com/videojs.png","language":"JavaScript","funding_links":[],"categories":["Implementations","HarmonyOS","Protocols \u0026 Transport"],"sub_categories":["Client","Windows Manager","Adaptive Streaming"],"readme":"# video.js MPEG-DASH Source Handler\n\n[![Build Status](https://travis-ci.org/videojs/videojs-contrib-dash.svg?branch=master)](https://travis-ci.org/videojs/videojs-contrib-dash)\n[![Greenkeeper badge](https://badges.greenkeeper.io/videojs/videojs-contrib-dash.svg)](https://greenkeeper.io/)\n[![Slack Status](http://slack.videojs.com/badge.svg)](http://slack.videojs.com)\n\n[![NPM](https://nodei.co/npm/videojs-contrib-dash.png?downloads=true\u0026downloadRank=true)](https://nodei.co/npm/videojs-contrib-dash/)\n\nA video.js source handler for supporting MPEG-DASH playback through a video.js player on browsers with support for Media Source Extensions.\n\n__Supported Dash.js version: 4.x__\n\nMaintenance Status: Stable\n\nDrop by our slack channel (#playback) on the [Video.js slack](http://slack.videojs.com).\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Getting Started](#getting-started)\n- [Protected Content](#protected-content)\n- [Captions](#captions)\n  - [Using TTML Captions](#using-ttml-captions)\n- [Multi-Language Labels](#multi-language-labels)\n- [Passing options to Dash.js](#passing-options-to-dashjs)\n  - [Deprecation Warning](#deprecation-warning)\n- [Initialization Hook](#initialization-hook)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Getting Started\n\nDownload [Dash.js](https://github.com/Dash-Industry-Forum/dash.js/releases) and [videojs-contrib-dash](https://github.com/videojs/videojs-contrib-dash/releases). Include them both in your web page along with video.js:\n\n```html\n\u003cvideo id=example-video width=600 height=300 class=\"video-js vjs-default-skin\" controls\u003e\u003c/video\u003e\n\u003cscript src=\"video.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Dash.js --\u003e\n\u003cscript src=\"dash.all.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- videojs-contrib-dash script --\u003e\n\u003cscript src=\"videojs-dash.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\nvar player = videojs('example-video');\n\nplayer.ready(function() {\n  player.src({\n    src: 'https://example.com/dash.mpd',\n    type: 'application/dash+xml'\n  });\n\n  player.play();\n});\n\u003c/script\u003e\n```\n\nCheckout our [live example](http://videojs.github.io/videojs-contrib-dash/) if you're having trouble.\n\n## Protected Content\n\nIf the browser supports Encrypted Media Extensions and includes a Content Decryption Module for one of the protection schemes in the dash manifest, video.js will be able to playback protected content.\n\nFor most protection schemes, the license server information (URL \u0026amp; init data) is included inside the manifest. The notable exception to this is Widevine-Modular (WV). To playback WV content, you must provide the URL to a Widevine license server proxy.\n\nFor this purpose, videojs-contrib-dash adds support for a \"keySystemOptions\" array to the object when using the `player.src()` function:\n\n```javascript\nplayer.src({\n  src: 'http://example.com/my/manifest.mpd',\n  type: 'application/dash+xml',\n  keySystemOptions: [\n    {\n      name: 'com.widevine.alpha',\n      options: {\n        serverURL: 'http://m.widevine.com/proxy'\n      }\n    }\n  ]\n});\n```\n\nYou may also manipulate the source object by registering a function to the `updatesource` hook. Your function should take a source object as an argument and should return a source object.\n\n```javascript\nvar updateSourceData = function(source) {\n  source.keySystemOptions = [{\n    name: 'com.widevine.alpha',\n    options: {\n      serverURL:'https://example.com/anotherlicense'\n    }\n  }];\n  return source;\n};\n\nvideojs.Html5DashJS.hook('updatesource', updateSourceData);\n```\n\n## Captions\n\nAs of `video.js@5.14`, native captions are no longer supported on any browser besides Safari. Dash can handle captions referenced embedded vtt files, embedded captions in the manifest, and with fragmented text streaming. It is impossible to use video.js captions when dash.js is using fragmented text captions, so the user must disable native captions when using `videojs-contrib-dash`.\n\n```javascript\nvideojs('example-video', {\n  html5: {\n    nativeCaptions: false\n  }\n});\n```\n\nA warning will be logged if this setting is not applied.\n\n### Using TTML Captions\n\nTTML captions require special rendering by dash.js. To enable this rendering, you must set option `useTTML` to `true`, like so:\n\n```javascript\nvideojs('example-video', {\n  html5: {\n    dash: {\n      useTTML: true\n    }\n  }\n});\n```\n\nThis option is not `true` by default because it will also render CEA608 captions in the same method, and there may be some errors in their display. However, it does enable styling captions via the captions settings dialog.\n\n## Multi-Language Labels\n\nWhen labels in a playlist file are in multiple languages, the 2-character language code should be used if it exists; this allows the player to auto-select the appropriate label.\n\n## Passing options to Dash.js\n\nIt is possible to pass options to Dash.js during initialiation of video.js. All methods in the [`Dash.js#MediaPlayer` docs](http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html) are supported.\n\nTo set these options, pass the exact function name with a scalar or array value to call the correpsonding MediaPlayer function.\n\nFor example:\n\n```javascript\nvar player = videojs('example-video', {\n  html5: {\n    dash: {\n      setLimitBitrateByPortal: true,\n      setMaxAllowedBitrateFor: ['video', 2000]\n    }\n  }\n});\n```\n\nA warning will be logged if the configuration property is not found.\n\n### Deprecation Warning\n\nPreviously the `set` prefix was expected to be omitted. This has been deprecated and will be removed in a future version.\n\n## Initialization Hook\n\nSometimes you may need to extend Dash.js, or have access to the Dash.js MediaPlayer before it is initialized. For these cases, you can register a function to the `beforeinitialize` hook, which will be called just before the Dash.js MediaPlayer is initialized.\n\nYour function should have two parameters:\n 1. The video.js Player instance\n 2. The Dash.js MediaPlayer instance\n\n```javascript\nvar myCustomCallback = function(player, mediaPlayer) {\n  // Log MediaPlayer messages through video.js\n  if (videojs \u0026\u0026 videojs.log) {\n    mediaPlayer.getDebug().setLogToBrowserConsole(false);\n    mediaPlayer.on('log', function(event) {\n      videojs.log(event.message);\n    });\n  }\n};\n\nvideojs.Html5DashJS.hook('beforeinitialize', myCustomCallback);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideojs%2Fvideojs-contrib-dash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvideojs%2Fvideojs-contrib-dash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideojs%2Fvideojs-contrib-dash/lists"}