1) I would like to include a function that the reader can upload a photo/take a picture and show it on the storybook.
2) I created a smart object with the following code:
<p><input type="file" accept="image/*" name="image" id="file" onchange="loadFile(event)" style="display: none;"></input></p>
<p><label for="file" style="cursor: pointer;">Upload Image</label></p>
<p><img id="output" width="400"></img></p>
<script>
var loadFile = function(event) {
var image = document.getElementById('output');
image.src = URL.createObjectURL(event.target.files[0]);
};
</script>
3) It works well in xpub reader but disappears during Android testing as it requires user permission. (I haven't tried iOS yet....)
4) I checked some articles and it seems I have to add the permission in the manifest.xml file. How can we access it? Does this line work?
<uses-permission android:name="android.permission.CAMERA" />