Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Audio mode
HTTP player
Local asset player
);
}
}
async componentWillMount() {
this._isMounted = true;
await Asset.fromModule(require('../assets/banner-image.png')).downloadAsync();
}
addDetectionImageAsync = async (resource, width = 0.254) => {
let asset = Asset.fromModule(resource);
await asset.downloadAsync();
await AR.setDetectionImagesAsync({
icon: {
uri: asset.localUri,
name: asset.name,
width,
},
});
};
public static downloadAsync(): Array> {
return [
Asset.fromModule(Images.login).downloadAsync(),
Asset.fromModule(Images.signUp).downloadAsync(),
Asset.fromModule(Images.drawer).downloadAsync(),
Asset.fromModule(Images.home).downloadAsync(),
Asset.fromModule(Images.lists).downloadAsync(),
Asset.fromModule(Images.timeline).downloadAsync(),
Asset.fromModule(Images.defaultAvatar).downloadAsync(),
Asset.fromModule(Images.avatar1).downloadAsync(),
Asset.fromModule(Images.avatar2).downloadAsync(),
Asset.fromModule(Images.avatar3).downloadAsync(),
Asset.fromModule(Images.foodGroup).downloadAsync(),
Asset.fromModule(Images.workGroup).downloadAsync(),
Asset.fromModule(Images.vacationGroup).downloadAsync(),
Asset.fromModule(Images.citiesGroup).downloadAsync(),
];
return images.map(image => {
if (typeof image === "string") {
return Image.prefetch(image);
} else {
return Asset.fromModule(image).downloadAsync();
}
});
}
public static downloadAsync(): Array> {
return [
Asset.fromModule(Images.login).downloadAsync(),
Asset.fromModule(Images.signUp).downloadAsync(),
Asset.fromModule(Images.drawer).downloadAsync(),
Asset.fromModule(Images.home).downloadAsync(),
Asset.fromModule(Images.lists).downloadAsync(),
Asset.fromModule(Images.timeline).downloadAsync(),
Asset.fromModule(Images.defaultAvatar).downloadAsync(),
Asset.fromModule(Images.avatar1).downloadAsync(),
Asset.fromModule(Images.avatar2).downloadAsync(),
Asset.fromModule(Images.avatar3).downloadAsync(),
Asset.fromModule(Images.foodGroup).downloadAsync(),
Asset.fromModule(Images.workGroup).downloadAsync(),
Asset.fromModule(Images.vacationGroup).downloadAsync(),
Asset.fromModule(Images.citiesGroup).downloadAsync(),
];
}
}
public static downloadAsync(): Array> {
return [
Asset.fromModule(Images.login).downloadAsync(),
Asset.fromModule(Images.signUp).downloadAsync(),
Asset.fromModule(Images.drawer).downloadAsync(),
Asset.fromModule(Images.home).downloadAsync(),
Asset.fromModule(Images.lists).downloadAsync(),
Asset.fromModule(Images.timeline).downloadAsync(),
Asset.fromModule(Images.defaultAvatar).downloadAsync(),
Asset.fromModule(Images.avatar1).downloadAsync(),
Asset.fromModule(Images.avatar2).downloadAsync(),
Asset.fromModule(Images.avatar3).downloadAsync(),
Asset.fromModule(Images.foodGroup).downloadAsync(),
Asset.fromModule(Images.workGroup).downloadAsync(),
Asset.fromModule(Images.vacationGroup).downloadAsync(),
Asset.fromModule(Images.citiesGroup).downloadAsync(),
];
}
}
Asset.fromModule(Images.login).downloadAsync(),
Asset.fromModule(Images.signUp).downloadAsync(),
Asset.fromModule(Images.drawer).downloadAsync(),
Asset.fromModule(Images.home).downloadAsync(),
Asset.fromModule(Images.lists).downloadAsync(),
Asset.fromModule(Images.timeline).downloadAsync(),
Asset.fromModule(Images.defaultAvatar).downloadAsync(),
Asset.fromModule(Images.avatar1).downloadAsync(),
Asset.fromModule(Images.avatar2).downloadAsync(),
Asset.fromModule(Images.avatar3).downloadAsync(),
Asset.fromModule(Images.foodGroup).downloadAsync(),
Asset.fromModule(Images.workGroup).downloadAsync(),
Asset.fromModule(Images.vacationGroup).downloadAsync(),
Asset.fromModule(Images.citiesGroup).downloadAsync(),
];
}
}
public static downloadAsync(): Array> {
return [
Asset.fromModule(Images.login).downloadAsync(),
Asset.fromModule(Images.signUp).downloadAsync(),
Asset.fromModule(Images.drawer).downloadAsync(),
Asset.fromModule(Images.home).downloadAsync(),
Asset.fromModule(Images.lists).downloadAsync(),
Asset.fromModule(Images.timeline).downloadAsync(),
Asset.fromModule(Images.defaultAvatar).downloadAsync(),
Asset.fromModule(Images.avatar1).downloadAsync(),
Asset.fromModule(Images.avatar2).downloadAsync(),
Asset.fromModule(Images.avatar3).downloadAsync(),
Asset.fromModule(Images.foodGroup).downloadAsync(),
Asset.fromModule(Images.workGroup).downloadAsync(),
Asset.fromModule(Images.vacationGroup).downloadAsync(),
Asset.fromModule(Images.citiesGroup).downloadAsync(),
];
}
}
imageAssets.map(image => Asset.fromModule(image).downloadAsync()),
);