An open API service indexing awesome lists of open source software.

https://github.com/syhily/astro-netease-player

A netease music plugin for adding a player to your astro website
https://github.com/syhily/astro-netease-player

aplayer astro netease withastro

Last synced: 2 months ago
JSON representation

A netease music plugin for adding a player to your astro website

Awesome Lists containing this project

README

        

# Astro Netease Player

A netease music plugin for adding a player to your astro website.
This plugin is based on the [aplayer-ts](https://github.com/liuly0322/aplayer-ts) instead of the aplayer plugin for better tree shaking.

## Install

```bash
# Use npm
npm install -D astro-netease-player

# Use pnpm
pnpm add -D astro-netease-player

# Use yarn
yarn add -D astro-netease-player
```

## Usage

### Use in MDX file

Open any MDX file and insert the `` tag.
The `1331313370` can be changed to the music id you like from the Netease music.

Go the the MDX render logic in your Astro post file. Modify the astro file as the sample shown below.

```
---
import MusicPlayer from 'astro-netease-player/MusicPlayer.astro';

const { Content, headings } = await post.render();
---

```

### Use in Astro component

Simply import the `astro-netease-player/MusicPlayer.astro` and use it as an Astro tag.