javascript - correct url not showing up in iframe copied from embed button - Stack Overflow

I am working on a website in which proper url doesn't show up after copying from the embed button.

I am working on a website in which proper url doesn't show up after copying from the embed button.

On clicking embed button(as shown below in an image), I am getting the following code inside iframe in which the value of src is not correct. It should be a proper video url.

<iframe src="//content.jwplatform/players/dalet_clips/35472P.mp4-88sIiZig.html" width="640" height="360" frameborder="0" scrolling="auto"></iframe>


The snippets of code which I am using inside jwplatform.js is:

"sharing": {
    "code": "%3Ciframe%20src%3D%22http%3A//content.jwplatform/players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E",
    "link": ""
},

Problem Statement:

Inside iframe src, I am getting the following code //content.jwplatform/players/dalet_clips/35472P.mp4-88sIiZig.html which is not correct. It should be proper url of the video. I am wondering what changes I need to do so that I get the plete video url inside iframe src.

I am working on a website in which proper url doesn't show up after copying from the embed button.

On clicking embed button(as shown below in an image), I am getting the following code inside iframe in which the value of src is not correct. It should be a proper video url.

<iframe src="//content.jwplatform./players/dalet_clips/35472P.mp4-88sIiZig.html" width="640" height="360" frameborder="0" scrolling="auto"></iframe>


The snippets of code which I am using inside jwplatform.js is:

"sharing": {
    "code": "%3Ciframe%20src%3D%22http%3A//content.jwplatform./players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E",
    "link": "http://content.jwplatform./previews/MEDIAID-6gKQPrHW"
},

Problem Statement:

Inside iframe src, I am getting the following code //content.jwplatform./players/dalet_clips/35472P.mp4-88sIiZig.html which is not correct. It should be proper url of the video. I am wondering what changes I need to do so that I get the plete video url inside iframe src.

Share Improve this question edited Feb 12, 2019 at 17:17 flash asked Feb 9, 2019 at 23:37 flashflash 1,51913 gold badges73 silver badges160 bronze badges 7
  • What is the proper video URL? – Rakib Commented Feb 12, 2019 at 16:53
  • The proper video url starts with http://www Sorry, I can't share the plete url. – flash Commented Feb 12, 2019 at 17:15
  • Well, I have made an example for you, please see here-jsfiddle/rakibh/acw2qxdf – Rakib Commented Feb 12, 2019 at 17:36
  • 1 Which version of JW player you are using - 7 or 8? What is your full JS code and where did you place it - in the document head or body? Do you use any relevant WordPress plugins? – Sally CJ Commented Feb 12, 2019 at 23:33
  • The version of JWplayer which we are using is 8.7.5. I am not using any wordpress plugins. I am using Javascript code. – flash Commented Feb 13, 2019 at 2:31
 |  Show 2 more ments

2 Answers 2

Reset to default 4 +25

Try changing the code property in the sharing option in jwplatform.js to encodeURIComponent of whatever you want to be the exact iframe content

Example: now you have the code as %3Ciframe%20src%3D%22http%3A//content.jwplatform./players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E

Now try to decode this with decodeURIComponent(code) which evaluates to :

<iframe src="http://content.jwplatform./players/MEDIAID-6gKQPrHW.html" width="480" height="270" frameborder="0" scrolling="auto"></iframe>

You should try changing both code and link to your actual video link and code. just encode whatever content you want to be as code with encodeURIComponent or test the current one with decodeURIComponent, also keep the correct link in the link property.

Probably you are making a mistake when you say that:

  • //example. it is not a valid url... - Nope. It's absolutely valid url. Even, it's better type of url (called schemeless url, without http: prefixing).

  • ...there should be video url (mp4) inside SRC... - No again. iframes are for web-pages (including .html pages), or not files (like .mp4 or other file extensions), so that is the correct form of url.

I think your problem is something different:. Maybe that video file is deleted from server? Or something doesn't actually work on that destionation url? Check problems there.

p.s. you should have posted an example url which works (just change domain to example. if you dont want to share it).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745173000a4615039.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信