Software Archive
Read-only legacy content
17061 Discussions

HTML5 video tag doesn't work locally.

CyBoRg1
Beginner
889 Views

No matter what I do, I can't play local video files in a XDK Cordova build for IOS.
I've tried countless times but the simulator won't play any video (locally) when using the <video> tag.
Everything is perfect on Android with Crosswalk,the limit the sky (I've even set up captions through webVTT,flawlessly) but with Cordova all I have done looks like time wasted.
I had to hardcode captions on the videos and I've tried searching for a plugin to use but there isn't a single video-player plugin for iOS in the plugin-repo of Apache Cordova (or maybe I'm just blind).

Permissions have been set, autoplay disabled and so on...

I've tried many of the countless suggestions on stackoverflow but I failed miserably and the only possibility left is to go native (fragmentation,here I come) unless there's a gentle soul with a solution over here.


Hoping for the best,
Best Regards.

P.s. : I'm on a Mac with the latest XDK (downloaded two days ago).

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
889 Views

The Emulate tab in the XDK does not simulate a real device. In particular, the <video> and <audio> tags do not represent the behavior you will see on a real device. Please use the Debug tab and the Test tab to test those elements on a REAL device. The Emulate tab will not help you with those items.

See these doc pages for additional help and info:

View solution in original post

0 Kudos
4 Replies
PaulF_IntelCorp
Employee
890 Views

The Emulate tab in the XDK does not simulate a real device. In particular, the <video> and <audio> tags do not represent the behavior you will see on a real device. Please use the Debug tab and the Test tab to test those elements on a REAL device. The Emulate tab will not help you with those items.

See these doc pages for additional help and info:

0 Kudos
CyBoRg1
Beginner
889 Views

Paul F. (Intel) wrote:

The Emulate tab in the XDK does not simulate a real device. In particular, the <video> and <audio> tags do not represent the behavior you will see on a real device. Please use the Debug tab and the Test tab to test those elements on a REAL device. The Emulate tab will not help you with those items.



Thanks for the answer. I've actually discovered it the hard way by trying those out in a UIWebView in XCode by using the iOS Simulator, which works instead.

By the way, couldn't you integrate the iOS Simulator as a testing platform for XDK projects ?
What's the purpose of having a partial emulation/simulation ?
Not everyone can afford overpriced hardware under the name of i-phones... :P
I've tried Crosswalk by virtualizing Android in VirtualBox and it's almost flawless.
I was expecting the XDK emulation to be almost the same as the aforementioned.

0 Kudos
PaulF_IntelCorp
Employee
889 Views

By the way, couldn't you integrate the iOS Simulator as a testing platform for XDK projects ?

The iOS simulator only runs on "overpriced hardware under the name of" Apple... We're trying to make the XDK accessible to developers on the most popular platforms: Windows, Mac and Linux. Additionally, the iOS simulator requires a specially built version of your app to run, you can't just load an IPA onto it for simulation.

What's the purpose of having a partial emulation/simulation ?

There's no purpose behind it, it's simply difficult to emulate/simulate every feature and quirk of every device.

Not everyone can afford overpriced hardware under the name of i-phones... :P

You can buy a used iPod and that works quite well for testing iOS apps. Of course, the screen is smaller and there is no compass or phone feature, but just about everything else works. If you need to do a lot of iOS testing it is worth the investment (this is what I generally use for my iOS testing). A new iPod costs $200 in the US. Used ones should cost less than that. Make sure you get one that can run iOS 8.

I've tried Crosswalk by virtualizing Android in VirtualBox and it's almost flawless.

When you run the Android emulator you are also running on a fictitious device, but it is a better emulation than what you get with the iOS simulator and the Intel XDK "emulator." The Crosswalk webview further abstracts the system so you get a very good simulation of a real device. However, considering how inexpensive and easy Android devices are to obtain, I highly recommend you use a real device (with the Debug tab), it will be much faster and even more accurate than using the Android emulator.

I was expecting the XDK emulation to be almost the same as the aforementioned

Nope, it's a Chromium browser, so what you get is the behavior inside that Chromium browser along with some conveniences that make it appear to be a hybrid device. It's poorly named as an emulator, but that was the name given to it by the original Ripple Emulator project. What it is most useful for is simulating most of the core Cordova APIs and basic application logic. After that, it's best to start using real devices with the Debug tab.

0 Kudos
CyBoRg1
Beginner
889 Views

 The iOS simulator only runs on "overpriced hardware under the name of" Apple... We're trying to make the XDK accessible to developers on the most popular platforms: Windows, Mac and Linux.

Even though it's "somewhat painful",many devs are virtualizing OS-X (hopefully with original copies of the operating system).
Having the option to use the iOS simulator is a plus.

...considering how inexpensive and easy Android devices are to obtain, I highly recommend you use a real device (with the Debug tab), it will be much faster and even more accurate than using the Android emulator.

But I use real devices... :P
I'm only missing an iOS device at the moment.

...it's best to start using real devices with the Debug tab.

I'll do that, thanks for the suggestion. You're very kind... :P

0 Kudos
Reply