Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static final String MIME_VIDEO_HLS = "application/x-mpegURL";
    private static final String MIME_VIDEO_MP4 = "video/mp4";

    public static String getMimeType(String url) {
        if (url != null && url.contains(".m3u8")) {
            return MIME_VIDEO_HLS;
        } else {
            return MIME_VIDEO_MP4;
        }
    }
}