diff --git a/package.json b/package.json index 383d84f..2e69767 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "title": "Player.js", "name": "@gumlet/player.js", - "version": "2.0.2", + "version": "2.0.3", "homepage": "http://github.com/gumlet/player.js", "main": "dist/player.min.js", + "module": "dist/player.min.js", "repository": { "type": "git", "url": "git://github.com/gumlet/player.js.git" diff --git a/src/main.js b/src/main.js index 7a87312..11ac88f 100644 --- a/src/main.js +++ b/src/main.js @@ -1,28 +1,26 @@ -import core from "./core" -import Player from "./player" -import Receiver from "./receiver" -import MockAdapter from "./adapters/mock" -import VideoJSAdapter from "./adapters/video" -import HTML5Adapter from "./adapters/html" +import core from "./core"; +import Player from "./player"; +import Receiver from "./receiver"; +import MockAdapter from "./adapters/mock"; +import VideoJSAdapter from "./adapters/video"; +import HTML5Adapter from "./adapters/html"; const playerjs = { - Player, - Receiver, - MockAdapter, - VideoJSAdapter, - HTML5Adapter, - CONTEXT: core.CONTEXT, - VERSION: core.VERSION, - METHODS: core.METHODS, - addEvent: core.addEvent -} + Player, + Receiver, + MockAdapter, + VideoJSAdapter, + HTML5Adapter, + CONTEXT: core.CONTEXT, + VERSION: core.VERSION, + METHODS: core.METHODS, + addEvent: core.addEvent, +}; -if (typeof define === 'function' && define.amd) { - define(function () { - return playerjs - }) -} else { +// Attach to the window object explicitly +if (typeof window !== "undefined") { window.playerjs = playerjs; } +// Export as ES module export default playerjs; \ No newline at end of file