# Link to Media field returns no url

**URL:** <https://community.prismic.io/t/link-to-media-field-returns-no-url/1483>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [August 9, 2020, 11:00am UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483 "2020-08-09T11:00:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jn1](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@jn1](https://community.prismic.io/u/jn1)\
**Post date:** [August 9, 2020, 11:00am UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/1 "2020-08-09T11:00:25Z")

</div>

`Media link fields` only return `{ "link_type": "media" }` for me in nuxt.js. I can't access any url field, although I have definitely set a media item in the dashboard. This also occurs for the simple `link field`. How do I get the actual url for the media item (mp4 video in this case)?

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [August 10, 2020, 10:19am UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/3 "2020-08-10T10:19:27Z")

</div>

Hi Visionautik,

Welcome to the Prismic community, I will try to help you with this.

For videos, we recommend that you host them through a specialized service such as YouTube or Vimeo. These services offer video compression support and both provide an excellent video player.

By doing this, you can easily add your videos to your Prismic documents by using the [Embed field](https://user-guides.prismic.io/en/articles/484832-embed)

Refer to this [documentation](https://user-guides.prismic.io/en/articles/768851-media-supported) for more info.

Please let us know if you need any further help,  
Fares

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [August 10, 2020, 2:31pm UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/5 "2020-08-10T14:31:01Z")

</div>

Also apart from the solution that I gave (using an external service), I think the issue you are having is probably because you didn’t publish the document.

Can send me the name of your repository so that I check if the image exists throwout the API.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [September 17, 2020, 4:54pm UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/6 "2020-09-17T16:54:49Z")

</div>

closed on September 17, 2020, 4:54pm UTC, flag & select 'Something Else' to reopen.

This issue has been closed due to inactivity.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:29pm UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/7 "2021-12-09T17:29:28Z")

</div>

Opened on December 9, 2021, 5:29pm UTC



---

<div class="post-metadata">

**Author:** ![james6](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@james6](https://community.prismic.io/u/james6)\
**Post date:** [March 8, 2023, 10:43am UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/8 "2023-03-08T10:43:09Z")

</div>

We're using 'Link to media' to serve our video and we can confirm that only `link_type` is accessible in Typescript (Next.js).

We have been using Cloudflare Stream to serve our videos, but after some tests we're finding that your CDN is far superior for delivery.

As a work around for now, we're doing the following:

`const video = slice.primary.video as any` - we're then doing `video.url` to get the link within our video player.

Could suggest the correct way to get the URL, please?

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [March 10, 2023, 3:47pm UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/10 "2023-03-10T15:47:58Z")

</div>

Hello @james6

Thanks for reaching out to us.

I believe it should be possible to get the URL of a video. I would like to should investigate your API. I need the following:

1. Your repo name.
2. Name of the Custom Type where you are adding the video.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![vincent.mingam](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@vincent.mingam](https://community.prismic.io/u/vincent.mingam)\
**Post date:** [August 18, 2023, 2:07pm UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/12 "2023-08-18T14:07:45Z")

</div>

Hello @Priyanka,

Almost as @james6, I prefer prismic CDN to serve my medias and I'm doing the following :

`const video = slice.primary.media as FilledLinkToMedia;`

but, as you see, I need to explicit the type `FilledLinkToMedia` in order to get `video.url` accessible in Typescript (Next.js)

Then same question as @james6 :

> Could you suggest the correct way to get the URL, please?

Regards,

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [September 5, 2023, 1:02pm UTC](https://community.prismic.io/t/link-to-media-field-returns-no-url/1483/15 "2023-09-05T13:02:55Z")

</div>

> [@vincent.mingam](#):
>
> but, as you see, I need to explicit the type `FilledLinkToMedia` in order to get `video.url` accessible in Typescript (Next.js)

That is the correct way to get the video url.
