I'm using a simple audio player in Flex 3 that plays a given mp3 from a given url.
My swf is intended to be embeded in Facebook walls.
<meta property="og:video"
content="http://url/of/my/Player.swf?file=url_of_my_file" />
The player works fine, as I'm getting my parameters from the url:
http://url/of/my/Player.swf?file=url_of_my_file
using
var _queryStringFromUrl:String =
ExternalInterface.call("window.location.search.substring", 1);
My problem is that when the swf is embedded in the facebook wall, the ExternalInterface is disabled, so I can't get my url variables.
Is there an alternative for getting a parameter inside my swf player?
How does youtue handle that in the following url?
<meta property="og:video"
content="http://www.youtube.com/v/dQw4w9WgXcQ?version=3&autohide=1">
Please note that the swf is not embedded in a html page.
EDIT:
It seems that youtube compiles a new swf for every video, with the parameters inside. Can someone confirm?
Thank you
Maybe you can try to use flashvars for this problem? It initialized and passed on swf init. Parse URL-params by JS and add them to flashvars.
Related
I am trying to scrape a video from a page using a package called icrawler, but that video is not rendered instantly when a page loads, so when I get the html code of that page, the video tag doesn't exist but it does if I open the page in the browser and inspect.
How do i wait for the page to load the video before crawling it ?
The page most likely loads the video using javascript so, you would need library capable of rendering/executing HTML and javascript.
I took a quick look at icrawler and according to the doc it uses Cheerio which quoting from its doc "does not produce a visual rendering, apply CSS, load external resources, or execute JavaScript".
The same docs mention that you could use something like PhahomJS (seems to be abandoned) or JSDom. Another alternative is to use Selenium.
Hi All,
I took a blank WinJS Store app and placed the below code in default.html file
<iframe src="http://www.google.com" height="400" width="400"></iframe>
But the iframe is not loading the google home page. The page is left blank. While if I replace the src value to "http://www.palermo4.com" its working fine. Why is this strange behavior. Do we need to acquire any other permissions kind of thing for some urls? Kindly help me out.
Thanks in Advance
You can't load ooogle in iframe,since they are blocking this facility.
You can use Iframe for some other sites,but you won't get full controll of their JS[Loading sites] ,may have to face some breaking point in such sites.
if you really want to load google try this,.
1. Make your default browser as IE10.
2. trigger an event.
function openYourLink(){
var url = new Windows.Foundation.Uri("http://www.google.com")
Windows.System.Launcher.launchUriAsync(url);
}
In Windows 8.1 you'll also be able to use the webview control which is not sensitive to frame-busting code that sites like Google use.
I'm trying to embed a video on my page, depending on which one the user selects after being presented with a list.
On my page I have:
<div id="vidContent" style="text-align:left">
<object width="550px" height="350px" >
<asp:Literal ID="ltlVideo" runat="server"></asp:Literal>
</object>
</div>
And in the code behind I have:
Dim strVidPath As String = "http://www.youtube.com/v/" & strVidID
ltlVideo.Text = "<embed src='" & strVidPath & "' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' height='350' width='470'></embed>
phVideoBanner.Visible = True
..
which works ok...if the you have the "strVidID"
It only seems to display and play if you have the strVidPath = www.youtube.com/v/_O7iUiftbKU
but not play if strVidPath = www.youtube.com/watch?v=_O7iUiftbKU ....which seems to be the normal URL in the address bar when watching a youtube video.
I want the user to be able to add a video to the page and I was thinking it would be easier if the paste in the URL of the video but now it seems I'll have to get them to paste in the videoID instead as it only seems to play when I use www.youtube.com/v/_O7iUiftbKU
Anyone know why this is?
Rather than trying to parse a YouTube watch page URL and construct an embed code yourself, you can use the oEmbed service to do it for you.
If you need to get back legacy embed codes rather than iframe embed codes, you'd need to pass iframe=0 as one of the URL parameters to the oEmbed service, like: http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch%3Fv%3DbDOYN-6gdRE&format=json&iframe=0
The URL structure with the word "watch" in it is, as you point out, Youtube's public facing web page, which includes a lot more than the video ... it includes all the other content you see on the page as well. In essence, it's a pointer that resolves to an HTML page, and you can't have an HTML page as the source of an embed element.
The URL structure that is proper (i.e. the one that works) is not a pointer to an HTML page but a pointer that resolves directly to the player itself, and thus can serve as the source of an embed element.
Here's a link to a Stack Overflow question whose answer includes a C# code block that takes a regular YouTube URL (in any of its forms) as an input, does a regex match, and returns just the Youtube ID -- should be pretty simple to modify it for your needs ... thus you can still continue to have your users paste in the whole video URL:
C# regex to get video id from youtube and vimeo by url
I want to send an email with attachments using CDONTS. But, here is what i am using:
CDO_MAIL.AttachFile "http://SampleWebSite.com/Sample.asp?COMMAND=6"
In JavaScript we are doing:
image1.src = "http://SampleWebSite.com/Sample.asp?COMMAND=6"
The problem is - I do not have the exact image name. The above URL returns me an image. Can you please let me know how to resolve this ?
Thanks
Diodeus is correct. However, another way to "solve" this is to download the file so you have it locally and then attach it. Embedding in the HTML, as suggested by Diodeus, will cause most mail clients to block the image and require user interaction to download the image. It's better to do it attach it and reference it by CID.
CDO does not support HTTP. It's expecting a local file reference (C:....).
You can embed the image in the message body though, using simple HTML:
<img src="http://SampleWebSite.com/Sample.asp?COMMAND=6" />
I want to stop a .mp4 file in an iframe from autoplaying.
The code is simple:
var siteVidUrl = document.createElement("iframe"); // create iframe
siteVidUrl.src = Obj.URL + "?autoplay=0"; // create src attribute for iframe
link_col.appendChild(siteVidUrl); // append to DOM
An example of Obj.URL would be
media.website.com/theVideo.mp4
The video contines to autoplay, despite my best attempts. As you can see, I am appending "?autoplay=0", to the end of the src attribute URL, but no luck there. I have read a bit about the video HTML5 tag, but no luck there either...
The majority of the videos are .mp4 files.
Can anyone point me in the right direction?
Is it necessary to use an iframe for this? If not have look at the HTML5 video-tag: https://www.w3schools.com/htmL/html5_video.asp
If the iframe is needed (for any reason), you could set the src to a page which receives the URL of the video as a parameter and just produces the HTML containing a simple video-tag in it. This way you'll be able to control the video playback and disable autoplay.