This is a migrated thread and some comments may be shown as answers.

Cannot play local video in iOS

3 Answers 35 Views
Apple iOS
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Luka
Top achievements
Rank 1
Luka asked on 28 Aug 2015, 03:46 PM

Hello,

I have tried to play video in my iOS app, but with no luck. As I understand, only thing I have to do is add HTML 5 video tag:

 

<video controls="controls">
            <source src="testvideo.mp4" type="video/mp4" />
 </video>​

 

And I have tired to  put my video file in various locations inside project (such as root, App_Resources, App_Resources/iOS etc.), but I had no luck in playing video, also, I've created folder video in root of the project and added file there, and changed path to video/testvideo.mp4, but no luck.

Also, I'm sure video is OK, because I have managed to play it by setting ​src to web location of video. And in iOS config file I have this line of code (I've ​read somewhere that I have to have this line):

 

 <preference name="AllowInlineMediaPlayback" value="true" />

 

So what am I doing wrong ?​

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 02 Sep 2015, 09:58 AM
Hello Luka,

Indeed, the code you supplied should work with a testvideo.mp4 file located at the root of the project's structure.

The issue you experienced, however, might be connected to the encoding of the file because iOS devices does not support the entire mp4 variety. On this matter you may need to consult the official Apple documentation for your device and make sure that the used format is supported in this device.

Usually experimenting with the codec and size of the video file (or with other video files) should solve the issue.

Let me know if you have questions.

Regards,
Anton Dobrev
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Luka
Top achievements
Rank 1
answered on 02 Sep 2015, 10:46 AM

Hey,

There wasn't any problem with the video file, I've managed to find solution as described in my Stack Overflow poost:

http://stackoverflow.com/a/32329596/1284262
0
Anton Dobrev
Telerik team
answered on 07 Sep 2015, 09:38 AM
Hello Luca,

Thanks for sharing this.

Let us know if further questions arise.

Regards,
Anton Dobrev
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apple iOS
Asked by
Luka
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Luka
Top achievements
Rank 1
Share this question
or