---
title: "Vimeo Player · Nuxt Scripts"
description: "Show performance-optimized Vimeo videos in your Nuxt app."
canonical_url: "https://scripts.nuxt.com/scripts/v0/content/vimeo-player"
meta:
  "og:description": "Show performance-optimized Vimeo videos in your Nuxt app."
  "og:image": "https://scripts.nuxt.com/_og/d/c_Docs%2Ctitle_Vimeo%2BPlayer%2Cdescription_Show%2Bperformance-optimized%2BVimeo%2Bvideos%2Bin%2Byour%2BNuxt%2Bapp.%2Cheadline_Content%2Cp_Ii9zY3JpcHRzL3YwL2NvbnRlbnQvdmltZW8tcGxheWVyIg%2Cs_NKByWU-KZuRSd1Rd.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Vimeo Player · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/d/c_Docs%2Ctitle_Vimeo%2BPlayer%2Cdescription_Show%2Bperformance-optimized%2BVimeo%2Bvideos%2Bin%2Byour%2BNuxt%2Bapp.%2Cheadline_Content%2Cp_Ii9zY3JpcHRzL3YwL2NvbnRlbnQvdmltZW8tcGxheWVyIg%2Cs_NKByWU-KZuRSd1Rd.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Content**

# **Vimeo Player**

[Copy for LLMs](https://scripts.nuxt.com/scripts/v0/content/vimeo-player.md)

[**Vimeo**](https://vimeo.com/) is a video hosting platform that allows you to upload and share videos.

Nuxt Scripts provides a `**useScriptVimeoPlayer**` composable and a headless `**ScriptVimeoPlayer**` a component to interact with the Vimeo Player.

## Types

To use Video Player with full TypeScript support, you will need to install the `**@types/vimeo__player**` dependency.

```bash
pnpm add -D @types/vimeo__player
```

## ScriptVimeoPlayer

The `**ScriptVimeoPlayer**` component is a wrapper around the `**useScriptVimeoPlayer**` composable. It provides a simple way to embed Vimeo videos in your Nuxt app.

It's optimized for performance by leveraging the [**Element Event Triggers**](https://scripts.nuxt.com/docs/v0/guides/script-triggers#element-event-triggers), only loading the Vimeo Player when the specific elements events happen.

By default, it will load on the `**mousedown**` event.

### Demo

![Play video](https://i.vimeocdn.com/video/777002624-a8787a8e267a1787e192a6df5e22bff485a7597189d41490789bdb20faf68385-d_295x166?region=us)

**Click to load**

Clicking the video will load the Vimeo iframe and start the video.

### Props

The `**ScriptVimeoPlayer**` component accepts the following props:

- `**trigger**`: The trigger event to load the Vimeo Player. Default is `**mousedown**`. See [**Element Event Triggers**](https://scripts.nuxt.com/docs/v0/guides/script-triggers#element-event-triggers) for more information.
- `**aboveTheFold**`: Optimizes the placeholder image for above-the-fold content. Default is `**false**`.
- `**rootAttrs**`: Override the root attributes that are automatically set.
- `**placeholderAttrs**`: The attributes for the placeholder image. Default is `**{ loading: 'lazy' }**`.
- `**id**`: Shorthand for `**vimeoOptions.id**`.
- `**url**`: Shorthand for `**vimeoOptions.url**`.
- `**vimeoOptions**`: All options from the Player SDK are supported, please consult the [**Embed Options**](https://developer.vimeo.com/player/sdk/embed) for full documentation.

```ts
interface VimeoPlayerProps {
  id: number | undefined
  url?: string | undefined
  autopause?: boolean | undefined
  autoplay?: boolean | undefined
  background?: boolean | undefined
  byline?: boolean | undefined
  color?: string | undefined
  controls?: boolean | undefined
  dnt?: boolean | undefined
  height?: number | undefined
  interactive_params?: string | undefined
  keyboard?: boolean | undefined
  loop?: boolean | undefined
  maxheight?: number | undefined
  maxwidth?: number | undefined
  muted?: boolean | undefined
  pip?: boolean | undefined
  playsinline?: boolean | undefined
  portrait?: boolean | undefined
  responsive?: boolean | undefined
  speed?: boolean | undefined
  quality?: VimeoVideoQuality | undefined
  texttrack?: string | undefined
  title?: boolean | undefined
  transparent?: boolean | undefined
  width?: number | undefined
}
```

#### **Eager Loading Placeholder**

The Vimeo Video placeholder image is lazy-loaded by default. You should change this behavior if your video is above the fold or consider using the `**#placeholder**` slot to customize the placeholder image.

```vue
<ScriptVimeoPlayer above-the-fold />
```

### Component API

See the [**Facade Component API**](https://scripts.nuxt.com/docs/v0/guides/facade-components#facade-components-api) for full props, events, and slots.

### Events

The `**ScriptVimeoPlayer**` component emits all events from the Vimeo Player SDK. Please consult the [**Player Events**](https://developer.vimeo.com/player/sdk/reference#about-player-events) for full documentation.

```ts
const emits = defineEmits<{
  play: [e: EventMap['play'], player: Player]
  playing: [e: EventMap['playing'], player: Player]
  pause: [e: EventMap['pause'], player: Player]
  ended: [e: EventMap['ended'], player: Player]
  timeupdate: [e: EventMap['timeupdate'], player: Player]
  progress: [e: EventMap['progress'], player: Player]
  seeking: [e: EventMap['seeking'], player: Player]
  seeked: [e: EventMap['seeked'], player: Player]
  texttrackchange: [e: EventMap['texttrackchange'], player: Player]
  chapterchange: [e: EventMap['chapterchange'], player: Player]
  cuechange: [e: EventMap['cuechange'], player: Player]
  cuepoint: [e: EventMap['cuepoint'], player: Player]
  volumechange: [e: EventMap['volumechange'], player: Player]
  playbackratechange: [e: EventMap['playbackratechange'], player: Player]
  bufferstart: [e: EventMap['bufferstart'], player: Player]
  bufferend: [e: EventMap['bufferend'], player: Player]
  error: [e: EventMap['error'], player: Player]
  loaded: [e: EventMap['loaded'], player: Player]
  durationchange: [e: EventMap['durationchange'], player: Player]
  fullscreenchange: [e: EventMap['fullscreenchange'], player: Player]
  qualitychange: [e: EventMap['qualitychange'], player: Player]
  camerachange: [e: EventMap['camerachange'], player: Player]
  resize: [e: EventMap['resize'], player: Player]
  enterpictureinpicture: [e: EventMap['enterpictureinpicture'], player: Player]
  leavepictureinpicture: [e: EventMap['leavepictureinpicture'], player: Player]
}>()
```

### Slots

As the component is provided headless, there are a number of slots for you to customize the player however you like before it's loaded in.

**default**

The default slot is used to display content that will always be visible.

```vue
<template>
  <ScriptVimeoPlayer :id="331567154">
    <div class="bg-blue-500 text-white p-5">
      Video by NuxtJS
    </div>
  </ScriptVimeoPlayer>
</template>
```

**awaitingLoad**

The slot is used to display content while the video is loading.

```vue
<template>
  <ScriptVimeoPlayer :id="331567154">
    <template #awaitingLoad>
      <div class="bg-blue-500 text-white p-5">
        Click to play!
      </div>
    </template>
  </ScriptVimeoPlayer>
</template>
```

**loading**

The slot is used to display content while the video is loading.

```vue
<template>
  <ScriptVimeoPlayer :id="331567154">
    <template #loading>
      <div class="bg-blue-500 text-white p-5">
        Loading...
      </div>
    </template>
  </ScriptVimeoPlayer>
</template>
```

**placeholder**

The slot is used to display a placeholder image before the video is loaded. By default, this will show the vimeo thumbnail for the video. You can display it however you like.

```vue
<template>
  <ScriptVimeoPlayer :id="331567154">
    <template #placeholder="{ placeholder }">
      <img :src="placeholder" alt="Video Placeholder">
    </template>
  </ScriptVimeoPlayer>
</template>
```

## useScriptVimeoPlayer

The `**useScriptVimeoPlayer**` composable lets you have fine-grain control over the Vimeo Player SDK. It provides a way to load the Vimeo Player SDK and interact with it programmatically.

```ts
export function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput) {}
```

Please follow the [**Registry Scripts**](https://scripts.nuxt.com/docs/v0/guides/registry-scripts) guide to learn more about advanced usage.

### VimeoPlayerApi

```ts
export interface VimeoPlayerApi {
  Vimeo: {
    Player: ScriptVimeoPlayer
  }
}
```

## Example

Loading the Vimeo Player SDK and interacting with it programmatically.

```vue
<script setup lang="ts">
const video = ref()
const { onLoaded } = useScriptVimeoPlayer()

let player
onLoaded(({ Vimeo }) => {
  player = new Vimeo.Player(video.value, {
    id: 331567154
  })
})
</script>

<template>
  <div>
    <div ref="video" />
    <button @click="player.play()">
      Play
    </button>
  </div>
</template>
```

[Edit this page](https://github.com/nuxt/scripts/edit/0.x/docs/content/content/vimeo-player.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/v0/content/vimeo-player.md)

[**Google Maps** Show performance-optimized Google Maps in your Nuxt app.](https://scripts.nuxt.com/scripts/v0/content/google-maps) [**YouTube Player** Show performance-optimized YouTube videos in your Nuxt app.](https://scripts.nuxt.com/scripts/v0/content/youtube-player)

**On this page **

- [Types](#types)
- [ScriptVimeoPlayer](#scriptvimeoplayer)
- [useScriptVimeoPlayer](#usescriptvimeoplayer)
- [Example](#example)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/v0/content/vimeo-player#webpage","@type":"WebPage","description":"Show performance-optimized Vimeo videos in your Nuxt app.","name":"Vimeo Player","url":"https://scripts.nuxt.com/scripts/v0/content/vimeo-player","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/v0/content/vimeo-player#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/v0/content/vimeo-player"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/v0/content/vimeo-player#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"V0","item":"https://scripts.nuxt.com/scripts/v0","position":3},{"@type":"ListItem","name":"Content","item":"https://scripts.nuxt.com/scripts/v0/content","position":4},{"@type":"ListItem","name":"Vimeo Player","item":"https://scripts.nuxt.com/scripts/v0/content/vimeo-player","position":5}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
