Search Unity

Video Custom file extensions on URL disallow the video from playing

Discussion in 'Audio & Video' started by mobiusmedia, Sep 19, 2017.

  1. mobiusmedia

    mobiusmedia

    Joined:
    Aug 14, 2017
    Posts:
    19
    Hi there,

    I am trying to play video from a URL that does not end in ".mp4".

    There is some internal check in the VideoPlayer code that ensures the file extension is within a predefined set (e.g. ".mp4" or ".webm").

    Renaming the file to anything different but maintaining the same file signature causes the VideoPlayer to fail playback.

    It would be nice to not be constricted by this arbitrary detail, since the file signature can be checked in the initial bytes of the file stream to determine if the file is compatible or not.

    To quote the MP4 spec: "The preferred file extension is ‘.mp4’." (http://jchblog.u.qiniudn.com/doc/ISO_IEC_14496-14_2003-11-15.pdf)

    i.e. the ".mp4" extension is not a requirement for functionality.
     
  2. superkerokero

    superkerokero

    Joined:
    Dec 9, 2015
    Posts:
    8
    3 years after...... I still have the same problem.
    It would be nice if video player API also takes some argument like VIdeoType(similar to AudioType for loading audioClips)
     
  3. jfrs20

    jfrs20

    Joined:
    Jul 8, 2020
    Posts:
    13
    similar concern: play file with name without extension at all (got name from database, don't have influence on naming of that file)

    any chance?
    Thanks!
     
    vladwarpin and wightwhale like this.
  4. ysyd2015

    ysyd2015

    Joined:
    Jun 16, 2021
    Posts:
    1
    I have encountered the same problem. Unity video player failed to play video file without extension.

    This issue cause troubles in the resource updating system of my game.
    The file name of all updatable game resources (asset bundles & video files etc.) in my game is SHA-1 checksum of the resource file.

    I hope unity can remove this restriction.
     
    vladwarpin likes this.
  5. omNomios_au

    omNomios_au

    Joined:
    May 23, 2018
    Posts:
    1
    Apologies for the +1.
    Came across this issue today. Noticed that the player stops working when I removed the extension.
    I guess the developer of that component is a Windows user.
    The only workaround I have is to symlink the file (or copy it locally) before I feed the file::// url to the video component.

    I'm pretty new to the Unity community, does anyone know if this "bug" has been reported yet?