problems with bootstrap modal and playing video

565 views
Skip to first unread message

Jalex

unread,
Jun 17, 2015, 4:44:16 AM6/17/15
to chromi...@chromium.org
Hello everyone,
I'm having trouble with my chrome app.

My intention is show a video by using a modal.When I run the window.html directly there's no problem. When I run the app it launch but when I try the modal just doesn't work

Here's my code

windows.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>K-system</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript">
          document.createElement('video');document.createElement('audio');document.createElement('track');
    </script>
    </head>
    <body>

      <div class="list-group">
         <a href="#" class="list-group-item active">My list</a>
         <a href="#" class="list-group-item" data-toggle="modal" data-target="#myModal1">modal_1</a>
      </div>


      <!-- Modal HTML -->
      <div id="myModal1" class="modal fade">
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Video test</h4>
            </div>
            <div class="modal-body">

              <div class="embed-responsive embed-responsive-16by9">
                <video id="example_video_1" class="video-js vjs-default-skin"
                  controls preload="auto" width="640" height="264"
                  data-setup='{"example_option":true}'>
                  <source src="C:\VideoOutput\cap2.mp4" type='video/mp4' />
                </video>
              </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
            </div>
         </div>
      </div>
    </div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>


manifest.json

{
  "name": "K-system",
  "description": "Chrome App.",
  "version": "0.1",
  "manifest_version": 2,
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  }
}

Thanks for the help.


Reilly Grant

unread,
Jun 17, 2015, 11:24:12 AM6/17/15
to Jalex, chromi...@chromium.org

Inline JavaScript is not allowed in Chrome Apps.

https://developer.chrome.com/extensions/contentSecurityPolicy


--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Jalex

unread,
Jun 24, 2015, 1:01:35 PM6/24/15
to chromi...@chromium.org, j.or...@gmail.com
Thanks for the observation. I changed that and now it works but I still have problems on playing the video.

some help?
Reply all
Reply to author
Forward
0 new messages