1.0.10 • Published 12 months ago

munchyroll v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

MUNCHYROLL 🎥🍩

MUNCHYROLL is a custom video player built with the power of modern JavaScript and TypeScript. It's designed to support a wide range of video formats, including adaptive streaming with HLS (HTTP Live Streaming). Whether you need to stream .m3u8, .ts, or .mp4 files, MUNCHYROLL has you covered.

🚀 Features

  • Customizable Controls: Easily configure buttons and control positions, including custom controls.

  • Plugin Support: Extend the player's functionality with plugins.

  • HLS Support: Stream .m3u8, .ts, and .mp4 files seamlessly with HLS.js.
  • Cross-browser Compatibility: Fallbacks for browsers like Safari, which natively support HLS.

🛠 Installation

Install MUNCHYROLL and its dependencies:

npm install munchyroll
  • cdn
  <script
      src="https://cdn.jsdelivr.net/npm/munchyroll@1.0.9 /umd/munchyroll.umd.js"
      defer></script>

📦 Usage

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Munchyroll Player Demo</title>
    <style></style>
    <script
      src="https://cdn.jsdelivr.net/npm/munchyroll@1.0.9 /umd/munchyroll.umd.js"
      defer></script>
    <script defer>
      document.addEventListener("DOMContentLoaded", function () {
        munchyrolljs({
          src: "https://stream.mux.com/ddBx5002F02xe7ftFvTFkYBxEdQ2inQ2o029CMqu9A4IcY/high.mp4",
          controls: {
            timeDisplay: true,
            captionsButton: true,
            pipButton: true,
            playButton: true,
            seekForwardButton: true,
            seekBackwardButton: true,
            muteButton: true,
            volumeRange: true,
            playbackRateButton: true,
            fullscreenButton: true,
          },
          attr: {
            height: "70%",
            width: "100%",
            autoplay: false,
            loop: false,
            muted: false,
            //poster: "https://via.placeholder.com/800x450?text=Munchyroll+Player",
          },
        });
      });
    </script>
  </head>
  <body>
    <munchyrolljs></munchyrolljs>
  </body>
</html>

📝 API

munchyrolljs(options: VideoOptions)

  • options: An object to configure the video player.
    • src: The source URL of the video.
    • attr: An object containing video attributes like width, height, autoplay, etc.
    • controls: An object to configure player controls. Includes support for custom controls.
    • plugins: An array of functions to extend the player's functionality.

VideoOptions

interface VideoOptions {
src: string;
attr: {
autoplay?: boolean;
loop?: boolean;
muted?: boolean;
poster?: string;
preload?: "auto" | "metadata" | "none";
width: string;
height: string;
playsInline?: boolean;
};
controls?: {
playButton?: boolean;
seekForwardButton?: boolean;
seekBackwardButton?: boolean;
muteButton?: boolean;
volumeRange?: boolean;
timeDisplay?: boolean;
captionsButton?: boolean;
playbackRateButton?: boolean;
pipButton?: boolean;
fullscreenButton?: boolean;
customControls?: ControlOption[];
};
plugins?: (() => void)[];
}

📖 License

MUNCHYROLL is licensed under the MIT License.

MIT License

---

Copyright (c) 2024 notunderctx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago