Video PHP scripts for every video site - embed

This is frustrating...
Right now I just have the following:
$regexes = array();
//youtube regex, will go to matches[1]
$regexes[] = '(?:https?:\/\/(?:(?:.+\.(?:youtube\.com|ytimg\.com))|(?:youtu\.be\/))(?:.*?)(?:\??vi?[\/\=]{1}|embed\/)([A-Za-z0-9\-_]{11}))';
//vimeo regex, will go to matches[2]
$regexes[] = '(?:https?:\/\/(?:.+\.)vimeo.com(?:\/video\/|(?:.+clip_id=))([a-z0-9-]+))';
That´s just Youtube and Vimeo. But what I want is Youtube, Vimeo, Dailymotion... and every other site in existence.
The idea is that I have a website that allows users to embed videos from other sites. Kinda like tumbler I guess. I have about a hundred sites in mind. But I don't know where to begin looking for a complete list of code for these sites.

It's difficult to maintain a database with all video websites. I think you can get the URL content and search for the video tag. Unfortunately this will work only for sites which render the video using html5(not flash).

Related

Embedding YouTube thumbnails

I have a question about embedding YouTube videos on a new website I'm working on.
It is a collection of livesets from different festivals around the world. Each embedded video has its own page, but on the overview pages I use the thumbnails mqdefault.jpg/hqdefault.jpg,etc of the different videos. If you click on them you navigate to the page where the video is embedded. Is embedding the thumbnails this way allowed (directly linking to YouTube)? Embedding the video is ok if embedding is enabled, but I can't find anything about the thumbnails. I can retrieve the url with the YouTube API (or just guess it) so I presume it is not a problem.
You are dependent on static url scraping are not supported. They can get changed and you may need to change your application at everytime.
For this you should use Data API v3. You should go with a videos->list request with id=videoId and part=snippet. In the response you will check snippet.thumbnails.['high'].url
Upload Thumbnail example also lists the thumbnails. However, I use static url from google. I use
https://ytimg.googleusercontent.com/vi/<insert-youtube-video-id-here>/default.jpg
It work as same as othet static url. But if you don't want to change url of thumbnail every time static url change you can go with that. I use youtube for example very limited time and only for teaching how its work. But for your site you should use api. Hope it helps you.

How to handle URL changes and keep SoundManager2 playing on background?

I am developing a web application, where a mp3 player is present and user can play the music. Issue that i am facing is how to keep the music playing (and the player untouched) even when I change the URL - go to a different page? The same thing as Deezer or SoundCloud do. You can browse the web and listen to the music meanwhile. Please point me a direction how to implement it. Thank you all!
On soundcloud they don't actually change the page they just change some of the body content with javascript. You can simply do the same, by adding a hidden div for the music, and a div for the content, which calls an api (recommend jquery.ajax) to fetch the content relative to the url in the address bar.
With rewriterules inside the .htaccess file, you can make it so it ignores all query strings etc. So it will always load the index.php file.
In short, this is no rocket science, has nothing to do with html5 nor soundmanager2. For more info you should use the .htaccess and jquery tag.

Creating client video review pages in WordPress

We are looking for an easy way to share our work in progress videos with our clients - for feedback.
We are using WordPress.
We want to avoid email/ftp/youtube/vimeo etc... And simply have our clients access a link to our site that we give them.
Is there a way that I can get the following:
create a directory "client_0001" on our webserver
upload our client's videos to the directory
send the link to the server "http://mysite.com/client_0001" to our client
when the clients accesses the link they will be presented with our wordpress site, but not some post/page but rather a template of the site with html5video/mp4 players in the page for each video that we uploaded?
There's no real reason to do this using Wordpress. In fact, it would certainly be more work doing it in Wordpress. A decent way to do this would perhaps create a php page with your template/html5 player, and having this page parse a GET variable to display the video. That way you can send your clients links like http://mysite.com/video_preview.php?videofile=somevideofile.mp4
For example:
Directory Structure:
example.com/
previews/
video_preview.php
someVideo.mp4
Then in video_preview.php, you can parse a GET variable and display any page you want. Here's a rough example.
<?php $video = $_GET['videofile'] ?>
<html>
// The HTML you want to use for the template. All CSS/JS, etc, etc...make it look pretty. (or dow't)
// Then you'd call your video player, however you want to do that. Basically, you just dynamically choose the video file based on the URL your client clicks.
<player src=<?php echo $video ?>
</html>
I wish I had WordPress ten years ago when I was hand crafting all those client pages in Dreamweaver...
The only caveat right now is the file size that can be uploaded directly in WP. But this can be solved uploading via FTP to a custom folder and doing a video player Shortcode to render player+posterframe:
[vplay file="http://example.com/custom/video.mp4" poster="http://example.com/wp-content/uploads/picture.jpg"]
A custom page template, for example, with customized header and footer, that after page creation would have a URL like: http://example.com/clients/project-name/.
Password protected for the client's convenience, or some membership in the site for restricted content. Comments form enabled for internal communication. Image gallery if necessary. Among other goodies.
What's good about YouTube and Vimeo are the privacy options and doing the web-format rendering for you. In this WordPress Answers, Video tutorials in dashboard, I write about the options.

Is there a tool for a web page to allow users create an animation from them uploaded photos with soundtrack?

Can anyone help with this issue?
We need some free tool (or maybe some technology) to use it on HTML page. Our site users have photo albums.. Something like gallery. It's already uploaded.
And the main purpose is to let the users create some animation or even movie from these photos and add there some soundtrack..
Sountrack could be uploaded directly into this tool.
We thought about html5, Js but it's not reliable and not covertible (we also want this animation be convertible to some video format).
Help! Thanx...

HTML object tag to embed a web page

We have a feature in our application which allows users to select a set of assets (images, videos etc.) and generate an embed code for those, which can be embedded in another web page. As of now we use iframes to implement in the embed code where page pointed by src attribute of iframe spits out HTML to embed.
For some security reasons we want to get rid of iframes and replace that with something else like an object tag, script tag etc.
My question is about object tag. Primary use of object tag seems to be to embed a video, a pdf etc. I know it can be used to embed an entire webpage just like what we want. But my question is - is that recommended? The webpage we want to embed will have a set of assets with options to sort, download, share, preview those assets.
So will it be a good practice to use object tag for embedding such a complex web page? Or is it meant for minimal usage like embedding a video clip, a slideshow etc.?
Depending on the type of technology you are using, you can do something similar.
With your request you are getting into the portlet/web part discussion, where you want to embed portlets (mini apps). There is no object tag you can use (to my knowledge its only image, applet and iframe I think) from the client side, but you might be able to pre-load the parts before you send the user the final page (say, like wordpress widgets in php).
Otherwise you need to go the Javascript route, and do some kind of lazy loading of your 'widget/applications' as needed.