Option to auto-play? #839
-
Is there an API option to auto-play when the swf is ready? I don't see anything in the documentation or the code. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Not yet, but it's definitely something we will add! |
Beta Was this translation helpful? Give feedback.
-
this is the code you need: <script src="./ruffle/ruffle.js"></script>
<script>
window.RufflePlayer.config = {
autoplay: "auto"
};
</script> [Edited after realizing my previous answer was wrong.] |
Beta Was this translation helpful? Give feedback.
-
BTW, Best wishes for 2021 🎉! |
Beta Was this translation helpful? Give feedback.
-
@ousia I could not get your solution to work. Here is my code, did I do anything wrong? <!DOCTYPE html>
<html>
<head>
<script src="./ruffle.js"></script>
<script>
window.addEventListener("load", function(e) {
window.RufflePlayer = window.RufflePlayer || {};
window.RufflePlayer.config = {autoplay: "auto"};
const ruffle = window.RufflePlayer.newest();
var player = ruffle.createPlayer();
player.classList.add("gembed");
document.body.appendChild(player);
player.load({url: "./bulletbill.swf"});
}, false);
</script>
</head>
<body>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
@ibillwilson,
this is the code you need:
[Edited after realizing my previous answer was wrong.]