diff --git a/examples/webpack/README.md b/examples/webpack/README.md deleted file mode 100644 index a8591c38..00000000 --- a/examples/webpack/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Minimal Example - -This example includes Webamp in a Webpack bundle. The audio file and skin are fetched from a free CDN at run time. - -**Note:** Currently Webamp is published to NPM as a single bundle which includes all of its dependencies. This means that no matter what you do, Webamp is going to bring along it's own React, Redux, JSZip, etc. If you have a use case where you would like Webamp to share some or all of these dependencies with your own application, please file an issue and I can look into it. - -To try it out: - -``` -$ git clone git@github.com:captbaritone/webamp.git -$ cd webamp/examples/webpack/ -$ npm install -$ npm run build -$ open index.html -``` diff --git a/examples/webpack/index.html b/examples/webpack/index.html deleted file mode 100755 index 08d1e25f..00000000 --- a/examples/webpack/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -
- - - diff --git a/examples/webpack/index.js b/examples/webpack/index.js deleted file mode 100644 index cc5691cd..00000000 --- a/examples/webpack/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import Webamp from "webamp"; - -new Webamp({ - initialTracks: [ - { - metaData: { - artist: "DJ Mike Llama", - title: "Llama Whippin' Intro", - }, - // NOTE: Your audio file must be served from the same domain as your HTML - // file, or served with permissive CORS HTTP headers: - // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3", - duration: 5.322286, - }, - ], -}).renderWhenReady(document.getElementById("app")); diff --git a/examples/webpack/package.json b/examples/webpack/package.json deleted file mode 100644 index 5339304a..00000000 --- a/examples/webpack/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "webamp-webpack-example", - "version": "0.0.0", - "description": "An example of using Webamp within a Webpack bundle", - "main": "index.js", - "scripts": { - "build": "webpack ./index.js --output-path dist --mode=development" - }, - "author": "", - "license": "ISC", - "dependencies": { - "webamp": "1.5.0" - }, - "devDependencies": { - "webpack": "^5.95.0", - "webpack-cli": "^5.1.4" - }, - "prettier": {} -} diff --git a/examples/webpackLazyLoad/README.md b/examples/webpackLazyLoad/README.md deleted file mode 100644 index 80855001..00000000 --- a/examples/webpackLazyLoad/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Minimal Lazy Loading Example - -## API is still being finalized and may change when released - -This example includes Webamp in a Webpack bundle. The audio file and skin are fetched from a free CDN at run time. Milkdrop and visualizer presets are lazy loaded after playing starts. - -**Note:** Currently Webamp is published to NPM as a single bundle which includes all of its dependencies. This means that no matter what you do, Webamp is going to bring along it's own React, Redux, JSZip, etc. If you have a use case where you would like Webamp to share some or all of these dependencies with your own application, please file an issue and I can look into it. - -To try it out: - -``` -$ git clone git@github.com:captbaritone/webamp.git -$ cd webamp/examples/webpackLazyLoad/ -$ npm install -$ npm run build -$ open index.html -``` diff --git a/examples/webpackLazyLoad/index.html b/examples/webpackLazyLoad/index.html deleted file mode 100755 index 47c95f48..00000000 --- a/examples/webpackLazyLoad/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -
- - - diff --git a/examples/webpackLazyLoad/index.js b/examples/webpackLazyLoad/index.js deleted file mode 100644 index 22ef741b..00000000 --- a/examples/webpackLazyLoad/index.js +++ /dev/null @@ -1,45 +0,0 @@ -import Webamp from "webamp"; - -const webamp = new Webamp({ - initialTracks: [ - { - metaData: { - artist: "DJ Mike Llama", - title: "Llama Whippin' Intro", - }, - // NOTE: Your audio file must be served from the same domain as your HTML - // file, or served with permissive CORS HTTP headers: - // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3", - duration: 5.322286, - }, - ], - __butterchurnOptions: { - importButterchurn: () => { - // Only load butterchurn when music starts playing to reduce initial page load - return import("butterchurn"); - }, - getPresets: async () => { - // Load presets from preset URL mapping on demand as they are used - const resp = await fetch( - // NOTE: Your preset file must be served from the same domain as your HTML - // file, or served with permissive CORS HTTP headers: - // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - "https://unpkg.com/butterchurn-presets-weekly@0.0.2/weeks/week1/presets.json" - ); - const namesToPresetUrls = await resp.json(); - return Object.keys(namesToPresetUrls).map((name) => { - return { name, butterchurnPresetUrl: namesToPresetUrls[name] }; - }); - }, - butterchurnOpen: true, - }, - __initialWindowLayout: { - main: { position: { x: 0, y: 0 } }, - equalizer: { position: { x: 0, y: 116 } }, - playlist: { position: { x: 0, y: 232 }, size: [0, 4] }, - milkdrop: { position: { x: 275, y: 0 }, size: [7, 12] }, - }, -}); - -webamp.renderWhenReady(document.getElementById("app")); diff --git a/examples/webpackLazyLoad/package.json b/examples/webpackLazyLoad/package.json deleted file mode 100644 index 0c060f9d..00000000 --- a/examples/webpackLazyLoad/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "webamp-webpack-lazy-example", - "version": "0.0.0", - "description": "An example of using Webamp within a Webpack bundle", - "main": "index.js", - "scripts": { - "build": "webpack index.js -o bundle.js" - }, - "author": "", - "license": "ISC", - "dependencies": { - "butterchurn": "^2.6.7", - "webamp": "1.5.0" - }, - "devDependencies": { - "webpack": "^4.29.6", - "webpack-cli": "^3.3.0" - } -}