0

My project includes two modules, one main module with all the XML, Kotlin files, and images, and another with all the video files. I had to do this because my app has like 20 videos and it exceeds that 150 MB cap that is put on the app bundles. Anyway, I have am trying to play a video through a video view, and it worked before by just finding the filepath. Now, I'm not sure how to access the video in another module, and when I try to get the filepath it can't find it. I've already set up the dependencies, so I don't know what the issue is.

Here is an example of what I had before I moved the videos into the new module, and this worked:

val intent = Intent(requireActivity(), WatchActivity::class.java)
intent.putExtra("filePath", "android.resource://${requireActivity().packageName}/${R.raw.addeventvideo}")
requireActivity().startActivity(intent)

If you're wondering, that code is inside of an onClickListener for a button so that it opens a new activity with a videoview that plays the video with the filepath I pass into the intent. Thanks for any help with this.

  • What code would you like? It's just a question about file pathing for a video I don't see why full code would be necessary. – RagingGoat Oct 17 '22 at 05:29
  • I have made the change – RagingGoat Oct 26 '22 at 23:39
  • There is no code that tries to access that resource. – blackapps Oct 27 '22 at 06:06
  • So what code would I need to access it? – RagingGoat Nov 07 '22 at 04:12
  • You did not tell what you consider to be a module. You did not tell where you put your files in the module. You are talking about a filepath but you are using a resource identifier. And we do not know how you use that identifier. – blackapps Nov 07 '22 at 06:50
  • The modules in Android Studio are just ways to store data in other parts of a project. I am doing it because I cannot upload the project in one module due to it being too large. As for the filepath, all the videos are in the raw folder in res in the secondary module. how would I reference that within the other module? – RagingGoat Nov 11 '22 at 06:42

0 Answers0