4

I'm trying to play video that is packaged within the project but it does not work. However videos from the web work just fine.

This problem is android specific, works fine on iOS.

I've been searching, but mostly people have problems with older versions, where they can't play any of the video's, hence I made a new question which is not duplicate because, again, videos are working fine, only those who are packaged with the project itself does not.

Working example

<video autoplay controls width="1024" height="714" class="videoWrapper">
        <source src="http://web.com/vid.mp4"></source>
</video>

Not working example

<video autoplay controls width="1024" height="714" class="videoWrapper">
        <source src="vid.mp4"></source> <!-- also tried /vid.mp4 -->
</video>

Is the video file there? Yes it is, I can see it in build asset www as well as project size is appropriate, which makes me think that there is sure a video inside the *.apk file.

skmasq
  • 4,470
  • 6
  • 42
  • 77
Stan
  • 25,744
  • 53
  • 164
  • 242
  • Are you loading these dynamically? A suggestion would be to add a `src` attribute to the `video` tag rather than using it in the `source` tag. – whodeee Dec 19 '13 at 21:29
  • @whodeee `` didn't help, same thing. And no, everything is static. just an empty page with video. – Stan Dec 19 '13 at 21:35
  • Have you tried adding the entire path to the video using something like `FileEntry.fullPath` found [here](http://docs.phonegap.com/en/3.3.0/cordova_file_file.md.html#FileEntry)? – whodeee Dec 19 '13 at 21:48

1 Answers1

0

Whenever you want to access files inside the application, like the www folder, you have to first obtain the file system path and then append your file location and name. See here for how to achieve it.

Phonegap - How to access file in www-folder?

Community
  • 1
  • 1
VicM
  • 2,449
  • 1
  • 18
  • 20