Scope of window.URL.createObjectURL (html5) - html

I'm building an html5 application and I'm struggling with the scope of the createObjectURL method.
To give you some information on my application to help you understand my issue:
- page 1: the user submits his video and I'm fetching info about his video (IMDB info mainly)
- page 2: this is the page where the video is actually played.
Now my question: when the user submits his video on page 1, can I create the blob url (createObjectURL method) and pass it to page 2 to play the video or is it out of scope?
The explanation is rather ambiguous on this page: "Blob URLs are unique and last for the lifetime of your application (e.g. until the document is unloaded)": page 1 and page 2 are in the same application but the document will be unloaded between those two pages right?
Thanks

So it seems that indeed blob URLs in html5 have only the page as a scope!
The two solutions that I found to tackle the problem described above are:
1. Put everything in the same page (you can modify the page with js for example)
2. Or use an iframe to load the second page "in" the first one.
Hope that can help someone out there.

Related

as3 check if youtube link exists

I want to give users of an app the possibilty to post a video from youtube by entering an url in a textfield. To ensure that the link exists, I want to check the url.
I only found examples to check if an external file exists but not how to check a simple www link. How can I check this?
Youtube doesn't really have a 404 page, so you'll always end up loading a page...
I don't know how you'll be loading the page...whether javascript will come into play once the page is loaded and take the argument of the video id...
But if all that goes through.... You'd want to look for this sniped of data in this div to determine whether or not the video exists.

Insert external link to swf (using a wysiwyg editor)

I have developed a website for a friend, which has to include some swf files. Those files come from his customers who want to get advertised at his site, and therefore cannot be edited.
The site is made with the use of Joomla 2.5.
My problem is that some of the swf files, do not have the target URL as part of them, and I'm trying to add it using the WYSIWYG editor that Joomla administrator panel provides.
I have tried various things reading different opinions in forums, but nothing works.
And another weird thing, is that when I click one of those, it takes me to a blank page, with the url "http://www.mysite.com/_level0.clickTAG" (where http://www.mysite.com is the name of my friend's site)
Is there a way of inserting a link externally to a swf file, or this is something that cannot be done?
Thank you in advance for your time.
Edit 1:
I have modified my html into
<p><object width="300" height="240" data="images/BANNERS_2014/bannername.swf?clickTAG=http:/www.customersite.com" type="application/x-shockwave-flash"><param name="src" value="images/BANNERS_2014/bannername.swf?clickTAG=http:/www.customersite.gr" /></object></p>
and now then I click on the banner, it takes me to http://www.mysite.com/www.customersite.com
instead of http://www.customersite.com
any ideas?
You need to pass the clickTAG as a parameter when you are embedding your SWF. I would have two fields on Joomla. One for the SWF and one for the destination URL. Then you can compose your embed code combining both. Read the article below and pay close attention to the bottom of the page:
http://www.adobe.com/resources/richmedia/tracking/designers_guide/
You can also have a similar set up as the one I outlined above and overlay a div on top of your SWF with the click event on it and the destination URL. You should have more control that way in the event that the SWFs you are getting are not formatted correctly.

Displaying any point in youtube iframe initially

I know that I can use embed parameters such as &start=10, but I would like to know if there is an option that could load the iframe showing a different time in the video for image purpose, and possibly still start at the beginning.
YouTube doesn't allow you to set custom frames as stills - I think it gives you some options to choose from when you upload your video, see more info here: http://www.squidoo.com/youtubeframe

HTML5: Offline Cache is ignored if loading different page under the same URL

I have a web application that has a constant URL and internal state machine. The states are changed via posts. I know it is a bad design and I should use the rest approach. But given this I have a following problem.
I use HTML5 offline cache (the manifest attribute in HTML tag). For the first page it is parsed and cached as I would expect (login page). But for the second page (main menu) the manifest included there is not parsed. No events are shown inside Chrome browser. If I change the URL a little by including a parameter then the manifest is parsed, but not before.
Event if I include everything in the login page manifest the second page downloads the same files again. Event if they are specified in the manifest for the first page.
Why this behaviour?
To answer it myself. It was looking so odd, simply because the cache is only parsed on GET calls and ignored on POST calls. Event if post loads another HTML page. To me this is a little bit silly but it seems that is how it works.
Now it finally works as it is supposed to.

How to detect whether an HTML page contains a video?

I would like to know whether it a possible to detect whether a HTML page contains a video.
I know that one possible way is to look for ".swf" in the HTML source code. But most of the pages do not contain the file name.
For example, given following URL and possibly its source code, is it possible to find out whether it contains a video:
http://www.cnn.com/video/
There are many ways to embed Video into a HTML page - as Flash Video or instances of Platform-Specific players through <object> and <embed> tags (but not every one of those tags is a video! The same holds true for .swf - it's just the file extension of Flash files, Video or not), the new HTML 5 <video> tag... They are not impossible to find out but it's a lot of work to catch all possible player types, formats and embed codes, and will result in a lot of false positives / negatives.
Then, there are JavaScript libraries that initialize players after the containing page has loaded - those are almost impossible to detect.
It's still a very complex issue to get video into a web page reliably, and subsequently, it's even more complex to find it out. Depending on what you are trying to achieve, I would consider dropping it.
For your case (CNN site) you can parse Open Graph micro-markup for a video information.
Meta tags such as og:video:type, og:image will help you.
Video hosting services usually support micro-markup, e.g. open graph or scheme.org.
So you can parse these markups.
Check if an <object> tag exists in the DOM and check its content type and parameters. You will find the pattern by yourself.
You can also search for .flv, or .mp4 in the source code.