Skip to content

Commit

Permalink
feat(mute): mute videos on load
Browse files Browse the repository at this point in the history
Supposed to Fix #8

//TODO Follows Scene7 documented API and data is passed, but audio is present when playing
  • Loading branch information
amclin committed Jul 23, 2019
1 parent 4188a51 commit dc42de7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<li><a href="docs/api/">Read generated docs.</a></li>
</ul>

<script src="http://s7d1.scene7.com/s7sdk/3.0/js/s7sdk/utils/Utils.js"></script>
<script src="http://s7d1.scene7.com/s7sdk/3.1/js/s7sdk/utils/Utils.js"></script>
<script src="node_modules/video.js/dist/video.js"></script>
<script src="dist/videojs-scene7.js"></script>
<script>
Expand Down
10 changes: 10 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ class Scene7 extends Tech {
// Convert loop setting from boolean to numeric strings
params.loop = (this.options_.loop) ? '1' : '0';

// Convert mute settings to numeric string
// TODO #8 According to Scene7 documentation this should
// be muting videos (<video muted> but doesn't appear to
// work. The property does come through from VideoJS as
// 'muted' and Scene7's documentation claims that the
// property it accepts is 'mutedvolume' (even though that
// isn't present in the SDKs)
// https://marketing.adobe.com/resources/help/en_US/s7/viewers_ref/r_html5_aem_int_video_config_attrib_videoplayer_mutevolume.html
params.mutedvolume = (this.options_.muted) ? '1' : '0';

// Provide settings to Scene7 ParametersManager
for (const param in params) {
paramMgr.push(param, params[param]);
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>videojs-scene7 Unit Tests</title>
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
<link rel="stylesheet" href="../node_modules/video.js/dist/video-js.css">
<!-- <script src="http://s7d1.scene7.com/s7sdk/3.0/js/s7sdk/utils/Utils.js"></script> -->
<!-- <script src="http://s7d1.scene7.com/s7sdk/3.1/js/s7sdk/utils/Utils.js"></script> -->
</head>
<body>
<div id="qunit"></div>
Expand Down

0 comments on commit dc42de7

Please sign in to comment.