Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Load Picture & Video from DataBase ,or Pic's & Video's Url ?

Discussion in 'Project Tiny' started by box621863, Dec 6, 2018.

  1. box621863

    box621863

    Joined:
    Nov 20, 2013
    Posts:
    1
    Can I use Project Tiny to load Picture& video from DataBase or Url like youtube,img?
     
  2. sebastianm_unity

    sebastianm_unity

    Unity Technologies

    Joined:
    May 3, 2018
    Posts:
    21
    For images: Yes, you can!
    However, you will need to do this using code.

    There are four relevant components:
    * Sprite2DRender: that's what renders a sprite, it points to an entity with a Sprite on it
    * Sprite2D: a single sprite, defines the sprite source rectangle, points to an entity with a Image2D on it
    * Image2D: an image, can be loaded via Image2DLoadFromFile
    * Image2DLoadFromFile: attach this component on an entity next to an Image2D component to start loading. You can set the URI to load an image from. The URI can be either a regular one or a Data URI to load from memory.

    Make sure you initialize all the component fields in code, for example colors or pixelsToWorldUnits should not be zero.

    I can post more complete example code if you need more help with this.
     
  3. gwenaelle_unity

    gwenaelle_unity

    Unity Technologies

    Joined:
    Jul 24, 2018
    Posts:
    16
    And for Video,
    Yes you can use URL video sources. As long as the video format is supported by your browser (MP4, WebM, Ogg).
    You will need to use a VideoPlayer and a VideoClip component on an entity.
    We do not support right now, embedded Youtube videos. But that's something we can work on.
     
  4. paradudum

    paradudum

    Joined:
    May 9, 2018
    Posts:
    3
    is there a demo available? I could not make it work in any way. TY
     
  5. ZyXeM

    ZyXeM

    Joined:
    Jul 10, 2015
    Posts:
    6
    I am also interested in this, Can you send an more complete example code? Also I want to ask if this is possible to use with animations or sound(something similar).
     
  6. aafasou

    aafasou

    Joined:
    Jan 2, 2019
    Posts:
    7
    hi can you post some example code?
     
  7. pthkbusiness

    pthkbusiness

    Joined:
    Feb 26, 2019
    Posts:
    2
    Hi,

    For example, if I got a video or image DB on Amazon or Azure. How can I use unity to read kind of QR code or pass any unique identifier on the fly to the video URL field in unity so that user can see different videos or images based on the code they have? Thanks.
     
  8. Zoelovezle

    Zoelovezle

    Joined:
    Aug 7, 2015
    Posts:
    54
    CommunityUS likes this.