Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Roffey 31 posts 184 karma points
    Oct 04, 2017 @ 08:43
    Mark Roffey
    0

    Returning media from mediaPicker and custom media type

    I've created a custom media type with a text box (alias: videoId and a media picker (alias: thumbnail).

    When I use the

    dialogService.mediaPicker({ callback: getInfo });
    

    the only relevant properties I get back are

    "properties": [
        {
          "id": 3832,
          "value": "167932-3433787",
          "alias": "videoId",
          "editor": "Umbraco.Textbox"
        },
        {
          "id": 3833,
          "value": "umb://media/fef2d563f8f5488fba3e1689c03b7197",
          "alias": "thumbnail",
          "editor": "Umbraco.MediaPicker2"
        }
      ]
    

    My question is, how do I get the actual media back from the MediaPicker2 value (in this case umb://media/fef2d563f8f5488fba3e1689c03b7197)?

  • Mark Roffey 31 posts 184 karma points
    Oct 04, 2017 @ 09:54
    Mark Roffey
    100

    SOLVED:

    The documentation states in umbraco.resources.mediaResource.getById requires an int. It does not. Passing the umb://media/fef2d563f8f5488fba3e1689c03b7197 works.

    http://umbraco.github.io/Belle/#/api/umbraco.resources.mediaResource

Please Sign in or register to post replies

Write your reply to:

Draft