mirror of
https://github.com/mue/mue.git
synced 2026-07-15 13:03:55 +02:00
Add WIP custom background video feature
This commit is contained in:
@@ -67,6 +67,7 @@ export default class Background extends React.PureComponent {
|
||||
const customBackgroundColour = localStorage.getItem('customBackgroundColour');
|
||||
const customBackground = localStorage.getItem('customBackground');
|
||||
const favourited = JSON.parse(localStorage.getItem('favourite'));
|
||||
const customBackgroundVideo = localStorage.getItem('customBackgroundVideo');
|
||||
|
||||
if (favourited) {
|
||||
if (offlineMode === 'true') return this.doOffline();
|
||||
@@ -83,6 +84,12 @@ export default class Background extends React.PureComponent {
|
||||
this.setBackground(null, customBackgroundColour, 'false');
|
||||
} else if (customBackground !== '') { // Local
|
||||
this.setBackground(customBackground, null, 'false');
|
||||
} else if (customBackgroundVideo) {
|
||||
document.getElementById('backgroundImage').innerHTML = `
|
||||
<video autoplay muted loop id="backgroundVideo">
|
||||
<source src="${customBackgroundVideo}"/>
|
||||
</video>`;
|
||||
document.querySelector('.photoInformation').style.display = 'none'; // Hide the credit
|
||||
} else { // Online
|
||||
if (offlineMode === 'true') return this.doOffline();
|
||||
try { // First we try and get an image from the API...
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class Notes extends React.PureComponent {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
this.state = {
|
||||
notes: localStorage.getItem('notes') || ""
|
||||
notes: localStorage.getItem('notes') || ''
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user