correct url not showing up in iframe copied from embed button
Asked Answered
E

2

7

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.com/players/dalet_clips/35472P.mp4-88sIiZig.html" width="640" height="360" frameborder="0" scrolling="auto"></iframe>

enter image description here


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

"sharing": {
    "code": "%3Ciframe%20src%3D%22http%3A//content.jwplatform.com/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.com/previews/MEDIAID-6gKQPrHW"
},

Problem Statement:

Inside iframe src, I am getting the following code //content.jwplatform.com/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 complete video url inside iframe src.

Elohist answered 9/2, 2019 at 23:37 Comment(7)
What is the proper video URL?Hylotheism
The proper video url starts with http://www Sorry, I can't share the complete url.Elohist
Well, I have made an example for you, please see here-jsfiddle.net/rakibh/acw2qxdfHylotheism
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?Foxworth
The version of JWplayer which we are using is 8.7.5. I am not using any wordpress plugins. I am using Javascript code.Elohist
@SallyCJ Do you have any idea how the box picture which I have pasted in the question above is getting created ? I looked into my JS code and I am not able to find anything.Elohist
@Elohist Check this - I used JW player version 8.7.5 and a (dummy) video that's hosted on jwplatform.com.Foxworth
C
4

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.com/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.com/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.

Cosecant answered 17/2, 2019 at 7:52 Comment(0)
A
3

Probably you are making a mistake when you say that:

  • //example.com 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.com if you dont want to share it).

Asgard answered 18/2, 2019 at 8:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.