Cannot play local video in iOS

4 posts, 0 answers
  1. Luka
    Luka avatar
    7 posts
    Member since:
    Oct 2014

    Posted 28 Aug 2015 Link to this post

    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 ?​

     

     

     

     

  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 02 Sep 2015 Link to this post

    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.

     
  3. Luka
    Luka avatar
    7 posts
    Member since:
    Oct 2014

    Posted 02 Sep 2015 Link to this post

    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
  4. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 07 Sep 2015 Link to this post

    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.

     
Back to Top