Git Product home page Git Product logo

svelte-video-player's People

Contributors

meigo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

svelte-video-player's Issues

Feature request: Hls support

This lib looks great. Would be great if there was Hls support—is this something you're planning on adding? ..I'm trying to figure out what would be involved in adding this functionality..

feature: pass ID to video player

Hi, thank you for the component. Could you add an id prop to pass onto the video tag? That would make it easier to auto play when launched inside a modal.

First frame as poster image

Would it be possible to add the option to just use the first frame (or any specified frame) of the video as the poster picture instead of having to create and link an external image?
Thanks for the module it works great!

Video format error

I have noticed url are checked for the extensions, and if the extension is not present, cosole.error() is invoked. Some video's url have no extension however, but the player plays them just fine. Maybe it would be beneficial to get rid of this console noise?

if you check this link for example; the video plays just fine.

video doesn't change when `source` is updated

Hi, when the components source property changes, should the video that's displayed be updated?

My test case:

<script>
    import VideoPlayer from 'svelte-video-player';
    let src1 = 'https://res.cloudinary.com/dvm02rtnk/video/upload/v1628057414/blender/HERO_Blender_Grease_Pencil_Showcase_1080p_ctsjpy.mp4';
    let src2 = 'https://res.cloudinary.com/dvm02rtnk/video/upload/v1628057411/blender/Agent_327_Operation_Barbershop_1080p_hf1iq7.mp4';

    let source = "please select a video";
</script>
<h1>svelte-video-player</h1>
<div style="max-width: 40%">
    <div>
    Select
    <button on:click={() => source = src1}>Video 1</button>
    <button on:click={() => source = src2}>Video 2</button>
    </div>
    <div>
    Currently playing: {source}
    </div>
    <VideoPlayer bind:source={source} />
</div>

Pressing a button changes source, but VideoPlayer seems to want to play please select a video (if I do let source = src1 is player the first video, always.

Info request - autoplay or seeking from outside the component

First of all, thank you for the player;

I am probably missing some basic information;

is there a way to cause video seeking to a specific time , or play/pause from an external event instead of a user interaction?

like

  • "autoplay onmount"
  • seek to 00:05 when the user click a specfic button on page

thank you

No fullscreen control available

Hi,
I am using this component svelte-kit. (new to the whole thing)

Whenever I try to import this component, I get ReferenceError : window is not defined which mostly comes from screenfull.js

Post that I tried to import the component dynamically (as shown below) ,

  onMount(async () =>{
      VideoPlayer = (await import('svelte-video-player')).default;
 
  })

now the component is renderinh successfully but the full screen control still doesn't show up, I also tried below but this didn't work either.

  onMount(async () =>{
    if(typeof window !== 'undefined' && typeof window.document !== 'undefined' ){
      VideoPlayer = (await import('svelte-video-player')).default;
    }
  })

Not sure what exactly is the issue. Can you help?
Screenshot 2021-08-14 at 6 13 17 PM

SSR failure

Hello, I'm trying to use svelte video on a skeleton sveltekit project with SSR enabled. During dev, it returns the following at the first page hit:

ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:154:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:186:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
3:40:24 PM [vite] Error when evaluating SSR module /node_modules/svelte-video-player/src/FullscreenManager.svelte:
ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:152:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:184:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
3:40:24 PM [vite] Error when evaluating SSR module /node_modules/svelte-video-player/src/VideoPlayerClient.svelte:
ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:150:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:182:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
3:40:24 PM [vite] Error when evaluating SSR module /node_modules/svelte-video-player/src/VideoPlayer.svelte:
ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:150:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:182:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
3:40:24 PM [vite] Error when evaluating SSR module /node_modules/svelte-video-player/src/index.js:
ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:150:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:182:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
3:40:24 PM [vite] Error when evaluating SSR module /src/routes/index.svelte:
ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:150:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:182:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
500
window is not defined
ReferenceError: window is not defined
    at /node_modules/svelte-video-player/src/libs/screenfull.js:150:7
    at /node_modules/svelte-video-player/src/libs/screenfull.js:182:3
    at instantiateModule (/home/michael/websites/mymy/node_modules/vite/dist/node/chunks/dep-63d4bd14.js:75119:15)
<script>
	import { browser } from '$app/env';
	import VideoPlayer from 'svelte-video-player';

	const poster = 'https://www.server.com/poster.jpg';
	const source = [
		'https://www.server.com/video.webm',
		'https://www.server.com/video.mp4',
		'https://www.server.com/video.ogv'
	];
</script>

<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

{#if browser}
	<VideoPlayer {poster} {source} />
{/if}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.