title: How to get the URL source code part of a jwplayer
body: <p>Good day friends...</p>
  
  <p>How to get the URL source code part of a jwplayer, I mean the mp4 part, and I found what I'm looking for here <a href="https://stackoverflow.com/questions/50185549/grab-scrap-the-source-file-of-a-web-pagejwplayer-source">the source</a></p>
  
  <p>I try to used it but I can't do it right, sorry for my bad english, can someone take a look at my php code below....I want to grab the link <a href="http://localhost/srt/43534234/viral022018SD.MP4" rel="nofollow noreferrer">http://localhost/srt/43534234/viral022018SD.MP4</a> and <a href="http://localhost/srt/43534234/viral022018HD.MP4" rel="nofollow noreferrer">http://localhost/srt/43534234/viral022018HD.MP4</a> or all mp4 URL inside it in the viral022018.html</p>
  
  <p>Thank you hope someone help me...thank you</p>
  
  <p>This is my php code</p>
  
  <pre><code>&lt;?php
  $html = file_get_contents('https://localhost/video/viral022018.html');
  //$dom-&gt;loadHtml('', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
  $dom = new DOMDocument();
  $dom-&gt;loadHTML($html);
  
  $xpath = new DOMXPath($dom);
  
  $sources = [];
  foreach ($xpath-&gt;query("//script[@type=\"text/javascript\"]") as $script) {
      if (stristr($script-&gt;nodeValue, 'playerInstance') !== false) {
          preg_match_all('#file: \"(.+)\"#', $script-&gt;nodeValue, $match);
          $sources = $match[1];
      }
  }
  
  print_r($sources);
  ?&gt;
  </code></pre>
  
  <p>This is the viral022018.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /&gt;
  &lt;link href='https://fonts.googleapis.com/css?family=Hanuman' rel='stylesheet' type='text/css'&gt;
  &lt;link href="https://fonts.googleapis.com/css?family=Scada" rel="stylesheet"&gt;
  &lt;link href="jwplayer-7.12.8/skins/prime.min2.css" rel="stylesheet" type="text/css" /&gt;
  &lt;script type="text/javascript" src="jwplayer-7.12.8/jwplayer.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;jwplayer.key="I9HOJrL1NmqruQ60as34wt34/23422dsdrwer==";&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="picasa" class="picasa"&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
      var playerInstance = jwplayer("picasa");
          playerInstance.setup({
          id:'picasa',
          controls: true,
          displaytitle: true,
  
          flashplayer: "//ssl.p.jwpcdn.com/player/v/7.12.5/jwplayer.flash.swf",
          width: "100%",
          height: "100%",
          aspectratio: "16:9",
          fullscreen: "true",
          provider: 'http',
          autostart: false,
          image:'http://localhost/viral/viralvideo.jpg',
              sources: [{file:"http://localhost/srt/43534234/viral022018SD.MP4",label:"SD",type: "video/mp4"},{file:"http://localhost/srt/43534234/viral022018HD.MP4",label:"HD",type: "video/mp4",default: true}],
              sharing:{
                  link: "",
                  code: "",
                  heading: "Share",
                  sites: ["facebook","twitter","tumblr","googleplus","reddit","linkedin","interest","email"],
              },
  sharing:{
                  link: "",
                  code: "",
                  heading: "Share",
                  sites: ["facebook","twitter","tumblr","googleplus","reddit","linkedin","interest","email"],
              },
  tracks: [{
              file: 'http://localhost/srt/viralvideo022018.srt',
              label: 'English',
              kind: 'captions',
              "default":true
  }],
  
       captions: {
          color: '#FFEB3B',
          fontSize: 14,
          fontFamily: 'Scada, Hanuman, sans-serif, Verdana, cursive',
          fontOpacity: 100,
          backgroundOpacity: 0,
  backgroundColor: '#000000',
          edgeStyle: 'raised',
          windowColor: '#000000',
          windowOpacity: 0
      },
  skin: {
          name: 'prime',
      },
  
  
  
  
            });
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>