Jump to content

Loading video.ts javascript?


LDDG

Recommended Posts

Posted

Hello all,

I created a test PHP file with the following contents and uploaded it to my root folder:

<head>
  <link href="http://vjs.zencdn.net/5.18.4/video-js.css" rel="stylesheet">

  <!-- If you'd like to support IE8 -->
  <script src="http://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
</head>

<body>
  <video id="my-video" class="video-js" controls preload="auto" width="640" height="264"
  poster="MY_VIDEO_POSTER.jpg" data-setup="{}">
    <source src="https://www.losdurosdelgenero.com/applications/core/interface/file/attachment.php?id=3241" type='video/mp4'>
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a web browser that
      <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
    </p>
  </video>

  <script src="http://vjs.zencdn.net/5.18.4/video.js"></script>
</body>

I ran the file and the video played without a hitch both on my desktop's Chrome, FireFox and IE browsers, as well as their mobile counterparts on my iPhone. The video played great.

 

Ok, now I want to be able to use this within IPS and of course, it is not working.

What I did was take:

  <link href="http://vjs.zencdn.net/5.18.4/video-js.css" rel="stylesheet">

  <!-- If you'd like to support IE8 -->
  <script src="http://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>

and place it inside the <HEAD> section within globalTemplate.

 

Then I took:

  <script src="http://vjs.zencdn.net/5.18.4/video.js"></script>

and placed it just before the </body> tag within globalTemplate.

 

I then created a test article with IP.Pages and in the body input box, I switched to source and pasted this:

  <video id="my-video" class="video-js" controls preload="auto" width="640" height="264"
  poster="MY_VIDEO_POSTER.jpg" data-setup="{}">
    <source src="https://www.losdurosdelgenero.com/applications/core/interface/file/attachment.php?id=3241" type='video/mp4'>
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a web browser that
      <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
    </p>
  </video>

And of course, after publishing the article, the video would not play. I would get an error saying that the javascript needed is not being loaded or that I need a HTML5 compatible browser.

Ironically, when I pasted the above code into the input box and switched back to Visual Editor, the video appeared and I was able to play it. It is when the article is published that the video stops playing and I get the javascript error.

Any ideas? I would really appreciate it.

Posted

Or do I need to download the javascript files, upload them to my sercer and call them locally instead of using their CDN files? *scratches head*

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...