Coder Social home page Coder Social logo

Comments (3)

Japegrape avatar Japegrape commented on June 9, 2024

In my very brief experimentation, videos do auto-play on Desktop. Getting videos to play on Mobile is an entirely different beast, as it needs to be tied to a user action directly, or else the browsers ignore it.

from panolens.js.

baseline-s avatar baseline-s commented on June 9, 2024

The videos only autoplay on desktop if I modify your library to set the autoplay parameter. I am aware of the issues on a mobile and have not found a way to prevent the user action, but the control widget satisfies this requirement for me.

I added autoplay to the options parameter in your VideoPanorama constructor as can be seen below to ensure that the videos autoplay on a browser, but would like this added to your original code if possible.

PANOLENS.VideoPanorama.prototype.load = function ( src, options ) {
......
this.videoElement.muted = options.muted || false;
this.videoElement.loop = ( options.loop !== undefined ) ? options.loop : true;
this.videoElement.autoplay = ( options.autoplay !== undefined ) ? options.autoplay : true;
this.videoElement.src = src;
this.videoElement.load();
....
}

from panolens.js.

pchen66 avatar pchen66 commented on June 9, 2024

Good catch! Autoplay option was initially missing because it needs additional event dispatching handler to the control widget. I've added the autoplay support in v2-dev (f285e77) and (f315aee)

from panolens.js.

Related Issues (20)

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.