Plugin Documentation

Overview

The MerlMovie app allows the integration of various streaming sources through a plugin system. Each plugin can provide metadata about the source, including how to fetch and display the media content. This document explains how to create a metadata file for your plugin to be compatible with the MerlMovie app.

Metadata JSON Structure

Each plugin requires a JSON file that contains specific metadata fields. Below is an example structure:

{
    "name": "ExamplePlugin",
    "image": "https://example.com/logo.png",
    "embed_url": "https://example.com/embed/{t}/{i}",
    "tv_embed_url": "https://example.com/embed/{t}/{i}/{s}/{e}",
    "stream_type": "api"
}
    

Field Descriptions

name: The name of the streaming source or plugin.

image: The URL to the logo or image representing the streaming source.

embed_url: The URL template for embedding a movie. The placeholders are as follows:

tv_embed_url: The URL template for embedding a TV show episode. The placeholders are as follows:

Note: The embed_url or tv_embed_url is not hosted by MerlMovie. It should be deployed on your own hosting service or a third-party API. Ensure it returns the required JSON structure as in the preview below.

stream_type: Indicates the type of content the URLs will return. It can be either:

Explanation of Stream Types

"url": When the stream_type is set to "url", the MerlMovie app will open the embed_url or tv_embed_url in a web view. This is suitable for sources that return HTML or other web content.

"api": When the stream_type is set to "api", the embed_url and tv_embed_url should return a JSON response. This triggers the MerlMovie app to stream the media directly using the internal built-in video player, providing a smoother and more integrated user experience.

JSON Response Structure for "api" Stream Type

If you choose "api" as the stream_type, the URL must return a JSON object with the following structure:

{
    "qualities": [
        {
            "name": "1080p",
            "link": "https://example.com/beautiful.mp4"
        },
        {
            "name": "Auto",
            "link": "https://example.com/master.m3u8"
        }
    ],
    "subtitles": [
        {
            "name": "English",
            "link": "https://example.com/en.vtt"
        },
        {
            "name": "Spanish",
            "link": "https://example.com/es.srt"
        }
    ]
}
    

JSON Response Fields

qualities: An array of available video qualities. Each object contains:

subtitles: An array of available subtitles. Each object contains:

Better User Experience with "api" Stream Type

By using the "api" stream type and returning JSON responses, the MerlMovie app will start streaming the media in the internal built-in video player instead of a web view. This ensures a more seamless and enhanced viewing experience for users, especially when dealing with HLS streams or MP4 files.

Conclusion

This metadata structure allows the MerlMovie app to integrate various streaming sources flexibly. By properly configuring the metadata JSON file and ensuring the correct structure for API responses, you can extend the functionality of the MerlMovie app with your custom plugins while providing users with a superior streaming experience.