extension: Add autostart to toggle splashScreen/autoplay/unmuteOverlay
This commit is contained in:
parent
debb45706a
commit
ddb45f2cc2
|
@ -11,6 +11,9 @@
|
|||
"settings_show_swf_download": {
|
||||
"message": "Show SWF download in context menu"
|
||||
},
|
||||
"settings_autostart": {
|
||||
"message": "Play automatically without splash screen (then click to unmute)"
|
||||
},
|
||||
"settings_warn_on_unsupported_content": {
|
||||
"message": "Warn on unsupported content"
|
||||
},
|
||||
|
|
|
@ -43,6 +43,10 @@
|
|||
<input type="checkbox" id="show_swf_download" />
|
||||
<label for="show_swf_download">Show SWF download in context menu</label>
|
||||
</div>
|
||||
<div class="option checkbox">
|
||||
<input type="checkbox" id="autostart" />
|
||||
<label for="autostart">Play automatically without splash screen (then click to unmute)</label>
|
||||
</div>
|
||||
</div>
|
||||
<script src="dist/options.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
<input type="checkbox" id="show_swf_download" />
|
||||
<label for="show_swf_download">Show SWF download in context menu</label>
|
||||
</div>
|
||||
<div class="option checkbox">
|
||||
<input type="checkbox" id="autostart" />
|
||||
<label for="autostart">Disable splash screen and autoplay (click to unmute)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="version-text">Ruffle extension</div>
|
||||
<button id="options-button">Settings</button>
|
||||
|
|
|
@ -7,6 +7,7 @@ export interface Options {
|
|||
warnOnUnsupportedContent: boolean;
|
||||
logLevel: LogLevel;
|
||||
showSwfDownload: boolean;
|
||||
autostart: boolean;
|
||||
}
|
||||
|
||||
interface OptionElement<T> {
|
||||
|
|
|
@ -173,6 +173,9 @@ function isXMLDocument(): boolean {
|
|||
warnOnUnsupportedContent: options.warnOnUnsupportedContent,
|
||||
logLevel: options.logLevel,
|
||||
showSwfDownload: options.showSwfDownload,
|
||||
autoplay: options.autostart ? "on" : "auto",
|
||||
unmuteOverlay: options.autostart ? "hidden" : "visible",
|
||||
splashScreen: !options.autostart,
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -7,6 +7,7 @@ const DEFAULT_OPTIONS: Options = {
|
|||
warnOnUnsupportedContent: true,
|
||||
logLevel: "error" as LogLevel,
|
||||
showSwfDownload: false,
|
||||
autostart: false,
|
||||
};
|
||||
|
||||
export let i18n: {
|
||||
|
|
Loading…
Reference in New Issue