{"id":13713296,"url":"https://github.com/MoePlayer/hexo-tag-dplayer","last_synced_at":"2025-05-06T23:31:36.555Z","repository":{"id":57263313,"uuid":"65282733","full_name":"MoePlayer/hexo-tag-dplayer","owner":"MoePlayer","description":"Embed dplayer in Hexo posts/pages","archived":false,"fork":false,"pushed_at":"2018-04-28T15:55:41.000Z","size":55,"stargazers_count":212,"open_issues_count":15,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-18T14:11:30.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/MoePlayer.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}},"created_at":"2016-08-09T09:36:02.000Z","updated_at":"2025-03-26T04:16:17.000Z","dependencies_parsed_at":"2022-09-02T05:23:45.772Z","dependency_job_id":null,"html_url":"https://github.com/MoePlayer/hexo-tag-dplayer","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoePlayer%2Fhexo-tag-dplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoePlayer%2Fhexo-tag-dplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoePlayer%2Fhexo-tag-dplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoePlayer%2Fhexo-tag-dplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoePlayer","download_url":"https://codeload.github.com/MoePlayer/hexo-tag-dplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252787521,"owners_count":21804278,"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":[],"created_at":"2024-08-02T23:01:31.813Z","updated_at":"2025-05-06T23:31:31.525Z","avatar_url":"https://github.com/MoePlayer.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# hexo-tag-dplayer\n本项目是将diygod的dplayer运行在hexo的插件\n\n感谢关注这个插件的人们，感谢aplayer的hexo插件作者@grzhan，感谢A or D播放器作者@Diygod\n\n感谢插件豆子@dixyes的移植\n\n借鉴项目：https://github.com/grzhan/hexo-tag-aplayer\n\n这个项目的两个维护者一个只会卖萌，一个又沉迷屁股(这是豆子)\n\n所以有什么bug很长时间没解决的，请谅解\n\n如果您能修复的话，也希望请您修复一下提交个pr什么的，祝君安康\n\n\n---------------------------------------------\n\n\n\nEmbed DPlayer([https://github.com/DIYgod/DPlayer](https://github.com/DIYgod/DPlayer)) in Hexo posts/pages.\n\n[Hexo Demo](https://morz.org/archives/2016-09-09/%E8%A7%86%E9%A2%91%E5%88%86%E4%BA%AB-%E3%80%90%E6%9D%B1%E6%96%B9Vocal%E3%80%91%E8%8A%B1%E6%98%A0%E3%80%8C%E3%82%BF%E3%83%9E%E3%82%B7%E3%82%A4%E3%83%8E%E3%83%8F%E3%83%8A%E3%80%8D-%E5%87%8B%E5%8F%B6%E6%A3%95-%E3%80%8CSubbed%E3%80%8D.html)\n\n![plugin screenshot](https://video-cache.morz.org/data/img/dplayer-1.jpg)\n\n\n\n## npm install\n\n\tnpm install hexo-tag-dplayer --save\n\n## Usage\n\n\t{% dplayer key=value ... %}\n\nkey can be \n\n    dplayer options:\n        'autoplay', 'loop', 'screenshot', 'hotkey', 'mutex', 'dmunlimited' : bool options, use \"yes\" \"y\" \"true\" \"1\" \"on\" or just without value to enable\n        'preload', 'theme', 'lang', 'logo', 'url', 'pic', 'thumbnails', 'vidtype', 'suburl', 'subtype', 'subbottom', 'subcolor', 'subcolor', 'id', 'api', 'token', 'addition', 'dmuser' : string arguments\n        'volume', 'maximum' : number arguments\n    container options:\n        'width', 'height' : string, used in container element style\n    other:\n        'code' : value of this key will be append to script tag\n\narguments to DPlayer options mapping:\n\n    {\n        container: \"you needn't set this\",\n        autoplay: 'autoplay',\n        theme: 'theme',\n        loop: 'loop',\n        lang: 'lang',\n        screenshot: 'screenshot',\n        hotkey: 'hotkey',\n        preload: 'preload',\n        logo: 'logo',\n        volume: 'volume',\n        mutex: 'mutex',\n        video: {\n            url: 'url',\n            pic: 'pic',\n            thumbnails: 'thumbnails',\n            type: 'vidtype',\n        },\n        subtitle: {\n            url: 'suburl',\n            type: 'subtype',\n            fontSize: 'subsize',\n            bottom: 'subbottom',\n            color: 'subcolor',\n        },\n        danmaku: {\n            id: 'id',\n            api: 'api',\n            token: 'token',\n            maximum: 'maximum',\n            addition: ['addition'],\n            user: 'dmuser',\n            unlimited: 'dmunlimited',\n        },\n        icons: 'icons',\n        contextmenu: 'menu',\n    }\n    \nsee dplayer documents for more infomation.\n\nfor example:\n\n    {% dplayer \"url=https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.mp4\" \"addition=https://dplayer.daoapp.io/bilibili?aid=4157142\" \"api=https://api.prprpr.me/dplayer/\" \"pic=https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.jpg\" \"id=9E2E3368B56CDBB4\" \"loop=yes\" \"theme=#FADFA3\" \"autoplay=false\" \"token=tokendemo\" %}\n    {% dplayer 'url=some.mp4' \"id=someid\" \"api=https://api.prprpr.me/dplayer/\" \"addition=/some.json\" 'code=player.on(\"loadstart\",function(){console.log(\"loadstart\")})' \"autoplay\" %} \n\n\n## PJAX compatible\n\n```js\n$(document).on('pjax:start', function () {\n    if (window.dplayers) {\n        for (let i = 0; i \u003c window.dplayers.length; i++) {\n            window.dplayers[i].destroy();\n        }\n        window.dplayers = [];\n    }\n});\n```\n\n## Customization\n\nYou can modify variables `scriptDir`(default: \"/assets/js/\" ) and `styleDir`(default: \"/assets/css/\") in `index.js` according to your blog's directory structure.\n\nor just use _config.yml configuration:\n\n    # on _config.yml of hexo-site\n    hexo-tag-dplayer:\n      js_path: /path/to/your/default/path\n      css_path: /sth\n      default: #default tag argument \n        id: somedefid # equals to setting id=somedefid in all {%dplayer%} tags\n        api: https://api.prprpr.me/dplayer/\n        #and other options...\n\n## Issue\n\nIf any issue occurs, tell me via issue, use a hexo raw tag like below to use dplayer:\n\n    {% raw %}\n    \u003cdiv id=\"player1\" class=\"dplayer\"\u003e\u003c/div\u003e\n    \u003cscript src=\"dist/DPlayer.min.js\"\u003e\u003c/script\u003e\u003c!-- use your path --\u003e\n    \u003cscript\u003e\n    var dp = new DPlayer({{\n        container: document.getElementById('dplayer'),\n        autoplay: false,\n        theme: '#FADFA3',\n        loop: true,\n        screenshot: true,\n        hotkey: true,\n        logo: 'logo.png',\n        volume: 0.2,\n        mutex: true,\n        video: {\n            url: 'demo.mp4',\n            pic: 'demo.png',\n            thumbnails: 'thumbnails.jpg',\n            type: 'auto'\n        },\n        subtitle: {\n            url: 'webvtt.vtt',\n            type: 'webvtt',\n            fontSize: '25px',\n            bottom: '10%',\n            color: '#b7daff'\n        },\n        danmaku: {\n            id: 'demo',\n            api: 'https://api.prprpr.me/dplayer/',\n            token: 'demo',\n            maximum: 3000,\n            user: 'DIYgod',\n            margin: {\n                bottom: '15%'\n            },\n            unlimited: true\n        },\n        contextmenu: [\n            {\n                text: 'custom contextmenu',\n                link: 'https://github.com/MoePlayer/DPlayer'\n            }\n        ]\n    });\n    \u003c/script\u003e\n    {% endraw %}\n    \nsee [DPlayer](https://github.com/DIYgod/DPlayer) for usage detail\n\n## Todo\n\n- [x] Publish it to the [hexo plugin list](https://hexo.io/plugins) and npm\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoePlayer%2Fhexo-tag-dplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMoePlayer%2Fhexo-tag-dplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoePlayer%2Fhexo-tag-dplayer/lists"}