question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I use dynamic videos/images and package in production?

See original GitHub issue

I added videos, images to resource but it only show in dev, not in production when run package. Example: I have a list images, videos and I want to show its to user. The user can choice an item to set background application after they restart app.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
SyedAmancommented, Apr 30, 2019

any solutions to this?

@kimthangatm has encountered a similar problem as me. How do you use images dynamically if you can’t require or import dynamically?

None of these work. I’ve tried other ways too, but I haven’t figured out how to dynamically import images.

render() {
     return fileNames.map(fileName => <img src={require(`${app.getAppPath()}/assets/fileName`)} />)
}
render() {
     return fileNames.map(fileName => <img src={`${app.getAppPath()}/fileName`} />)
}
render() {
     return fileNames.map(fileName => <img src={`${app.getAppPath()}/assets/fileName`} />)
}
0reactions
kimthangatmcommented, Feb 2, 2018

Hi @amilajack, My question is How can I use dynamic videos/images and package in production.

And in previous comment

For the images and videos, I only want it put on a folder, not combine, compress in app.asar. Because if I use import videos or images, webpack will package it like demo.mp4 to 674f50d287a8c48dc19ba404d20fe713.mp4

Im my case: I have a database of images, videos and all of them in a folders. And I cannot use import to import static videos or images.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How (and When) to Use Dynamic Transitions in Your Videos
It's time to check out this 1000+ transitions pack, what's cool about it, and what is the best way to import and use...
Read more >
What are The Benefits of Dynamically Generated Creatives?
Learn more about the benefits of using dynamically generated creatives, and how they can help you achieve your marketing goals.
Read more >
What is User-Generated Content? And Why is it Important?
User-generated content (UGC) is any content—text, videos, images, reviews, etc.—created by people, rather than brands.
Read more >
Using web parts on SharePoint pages - Microsoft Support
The Highlighted content web part dynamically displays content based on content type (documents, pages, news, videos, images, etc), filtering, or a search ...
Read more >
Dynamic Transitions Pack - After Effects Templates
This template contains 100 uniquely designed and stylishly animated transitioning effects. Simply style them to your desired preferences, using the full color ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found