Autoplaying a video. | Community
Skip to main content
ahalberkam
New Participant
August 1, 2018
Solved

Autoplaying a video.

  • August 1, 2018
  • 9 replies
  • 3797 views

Hello,

I want to embed a video using the scene7 video player in my webpage, which starts automatically when the page is loaded. For doing this I have set the flag "autoplay" to "1"  like:

var s7_videoview = new s7viewers.VideoViewer({

    "containerId" : "s7_videoview_small",

        "params" : {

        "asset" : "XXX/180726_XXX_HW18_Making-of_Start_short",

        "serverurl" : "https://XXX.scene7.com/is/image/",

        "contenturl": "https://XXXscene7.com/skins/",

        "config": "Scene7SharedAssets/Universal_HTML5_Video",

        "emailurl": "https://coeur.scene7.com/s7/emailFriend",

        "videoserverurl": "https://coeur.scene7.com/is/content/",

        "autoplay": "1",

        "ssl": "on",

        "playback": "progessive",

        "loop": "1"}}).init();

But when I open the page, the video doesn`t start automatically. But when I open the chrome console, to investigate this problem, the video starts automatically.

So can you give me a hint how to make autoplay working ?

Thanks a lot

Andi

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by hidden_la

thanks gauravb!

This hacky version worked for me on chrome (i am also using jquery):

"handlers" : {

        "initComplete":function() {

          console.log("init complete");

          $("#my-video_videoPlayer video").prop('muted', true);

          $("#my-video_videoPlayer video")[0].play();

        }

      }

9 replies

Keerthi0555
New Participant
January 15, 2024

why playback:progressive what impact it gives to the video?

hidden_la
hidden_laAccepted solution
New Participant
January 31, 2019

thanks gauravb!

This hacky version worked for me on chrome (i am also using jquery):

"handlers" : {

        "initComplete":function() {

          console.log("init complete");

          $("#my-video_videoPlayer video").prop('muted', true);

          $("#my-video_videoPlayer video")[0].play();

        }

      }

Gaurav-Behl
New Participant
January 31, 2019

I don't think so because that line of code simply sets the volume to zero rather than muting it which may be a problem. I know 'muted' property works fine but I couldn't find the same in its handler.

That's the reason I asked to test and see how each browser reacts to it. Would be good to know if browsers support this trick or not.

New Participant
January 31, 2019

Thanks gauravb10066713 and smacdonald2008​.  Is this initialization compatible with the policies set out by by google and apple/webkit?

"By default, WebKit will have the following policies:

<video muted> elements will also be allowed to autoplay without a user gesture."

https://webkit.org/blog/6784/new-video-policies-for-ios/

"Chrome's autoplay policies are simple:

Muted autoplay is always allowed."

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

smacdonald2008
New Participant
January 31, 2019

Checking with the team.

Gaurav-Behl
New Participant
January 31, 2019

Not sure if this would work but you may try --

"handlers":{

  "initComplete":function() {

  videoViewer.getComponent("mutableVolume").setPosition(0);

  videoViewer.getComponent("mutableVolume").deactivate();

  }

  }

Source:  Mutable volume

New Participant
January 31, 2019

Adobe any answer on this?

ahalberkam
New Participant
August 3, 2018

Hi Albin,

thanks for your a nswer! Base on this answer, I assume, that the "autoplay" only work when I mute the video... But the I didn`t find any possibilty to mute the "Scene7 video player". Do you know, how I can mute the video player?

Best regards

Andi

New Participant
August 1, 2018

I guess this issue may be related to recent Chrome policy change - Autoplay Policy Changes  |  Web  |  Google Developers

Regards

Albin I

www.albinsblog.com

Keerthi0555
New Participant
January 15, 2024

If we want audio also to play along with autoplaying video with scene7