Search Unity

Question When I try to play a video file downloaded from AWS S3 with a URL from VideoPlayer, "Not allowed to

Discussion in 'Audio & Video' started by K_Kuriyama, Mar 18, 2022.

  1. K_Kuriyama

    K_Kuriyama

    Joined:
    Jul 4, 2020
    Posts:
    66
    I stored the video file downloaded from AWS S3 in idbfs.

    When I try to play with a URL from VideoPlayer, I get "Not allowed to load local resource: file: // idbfs /…". Can you figure out how to fix the problem?

    I'm not particular about using idbfs, so you can use other playback methods.

    However, I want to secure the video, so I want to access it as an IAM user.

    Therefore, it cannot be streamed directly from the S3 URL.

    I don't want to use the Streaming Assets folder as it will also be published.


    ・Environment
    Unity2021.2.14f1
     
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I am not familiar with idbfs, but if you are trying to authenticate to access private content, you will have to use UnityWebResquest as we don't provide control for the request header. After the file is downloaded, you can then set the VideoPlayer URL to the file path, and you should be able to play the video. Not sure if it answers your question thoroughly.
     
  3. K_Kuriyama

    K_Kuriyama

    Joined:
    Jul 4, 2020
    Posts:
    66
    @The_Island
    Thank you for answering.
    But I don't want to access it by URL.
    I hope you find a good way.
     
  4. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I don't know how secure you want the file to be. If you wish to deter people from accessing your video files, you could try asset bundle. It creates a serialized file with all the assets you want, including video files. Otherwise, if you want something more secure, then it is another story. The video player doesn't protect the frame from being read when decoding on the GPU, so even if you store the file securely, they will still be able to get it.
     
    Last edited: Mar 30, 2022