question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example of how to use VimeJS with Sapper / Svelte Kit

See original GitHub issue

Documentation

SSR Examples for new Vime JS.

Documentation page URL: Does not yet exist

Reason: The only existing “documentation” around this is the final comment on https://github.com/vime-js/vime/issues/38 - using dynamic imports is easy, but then you have to also use svelte:component in order to use those dynamic modules, and even then there are loads of console errors during build:

The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
                    ^
2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3:     return new (P || (P = Promise))(function (resolve, reject) {
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
                            ^
2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3:     return new (P || (P = Promise))(function (resolve, reject) {

It would be good to have a written example of using the new “web components” based VimeJS, as I can’t see a clear path forward for using it in an SSR enabled environment.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:24 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
louishuddlestoncommented, Oct 25, 2021

Here’s how I’ve got Vime working with SvelteKit using @vime/core

<script>
  import { onMount } from 'svelte';

  export let src;
  let showPlayer = false;
  let player;

  onMount(async () => {
    const { defineCustomElements } = await import('@vime/core');
    defineCustomElements();
    showPlayer = true;
  });
</script>

{#if showPlayer}
  <vm-player bind:this={player}>
    <vm-video>
      <source data-src={src} type="video/mp4" />
    </vm-video>
    <vm-ui>
      <vm-default-controls />
    </vm-ui>
  </vm-player>
{/if}

@sveltejs/kit@1.0.0-next.180 @vime/core@5.0.33 svelte@3.43.1

5reactions
ralyodiocommented, Oct 7, 2021

why are the docs trash for svelte? can someone post an official solution here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sapper Integration
If you're using @vime-js/complete then you'll need to do a little bit of setting up. All the instructions can be found in the...
Read more >
Sapper and Svelte: A quick tutorial
Sapper, the companion component framework to Svelte, helps you build larger and more complex apps quickly and efficiently.
Read more >
Sapper to Svelte Kit Basics - Weekly Svelte - YouTube
Become a Level Up Pro and take your web skills to the next level!https://www.leveluptutorials.comThe best web development podcast out ...
Read more >
vime-js
Hello,. I need to be able to set the playback quality of an 8k video to 8K. I need to be able to...
Read more >
Vime - media player library built with Svelte (alternative to ...
I recently worked a bit on a video player for svelte for my own site but nothing as feature complete as this! I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found