Crawl embeded Flash video and render Javascript to obtain final GUI - php

Now, I am encountering some difficulties when I have to scan or crawl a video URL link. This web page is using the Flash-based technology to embed the video and stream video.
In order to understand more clearly, this is a link example:
http://vnexpress.net/gl/the-gioi/tu-lieu/2012/11/bai-phat-bieu-thua-nhan-that-bai-cua-romney/
The above link has below content (HTML code for Flash embedded video):
<div id="flashContent" style="text-align:center;width:100%;">
<span id="FlashPlayer79237" class="Normal" align="center">Bạn cần cài Flash Player để xem được Clip này.</span>
</div>
In this above article, there is a above video. However, when I tried to scan or crawl the content, the video could not run properly (because it could not load correct video link) and only show Install Flash Player plugin words (Certainly, the real web page needs to run some Javascript script or Flash script to obtain the real video link and stream this video for users)
Therefore, how can I render Flash and Javascript script through PHP or ASP.NET or Java? How can I get the correct video link when I crawl the web page? In this case, how can I obtain the correct Flash embedded video (HTML code)?
Thank you so much.

Before I answer, I want to make a note that if you need this information to do anything shady... please don't.
Disclaimer aside, for that particular site it is relatively easy.
The flashvars param (which is probably put there by Javascript) contains a value called xmlPath, which is a url encoded path (relative to their domain name). If you grab that and decode it, you get something like:
/Service/FlashVideo/PlayListVideoPage.asp?id=79237&f=108&t=1
which points to
http://vnexpress.net/Service/FlashVideo/PlayListVideoPage.asp?id=79237&f=108&t=1
If you read that, it's an XML file which contains the URL of the actual video.
I'm not quite sure where that value is generated from. If you needed to do this fully server-side, you could use a headless browser to process it.

Related

php play video anchor links in new tab of browser only if its in the session

I am new to php. I am having anchor links each will play a video in new tab after clicking on it.
So the problem is: If anyone knows the exact url of video, they can paste that url in browser and can watch the video, which should not happen. But currently this is the issue I am having.
I knew that we can do this by checking with sessions, but not understanding in a programmatic approach. I tried in other way using html5 video links too, but has no luck that way either.
Kindly provide me some great solution for my above issue.
Below are the video anchor links :
MyVideo1
MyVideo2
MyVideo3
Some time ago I programmed a webpage which can stream videos for logged in users. I didn't made a direct link reference to the video file, I put the video files in a private directory not accessible via browser which is readable by the PHP files. Then the links to the video files were all looking like this: <a href='stream.php?id=[id]'>Video</a> where the id is a randomly generated string which is saved and valid for a limited time. So when someone has this link to the stream.php script he cannot use it as the id will be invalid at a later time. And the php script just takes the mp4 file out of the private directory and puts it to output. It's also possible to make the stream.php script able to handle jumps during watching the video.

Embedding Video Stream into webpage

This is a progress after the question Embedding Image/Video Stream into webpage that was answered for the picture only using curl, video is still an open issue.
Resuming, I need to avoid that the visitor of a web page see the real source of an image streming. So I want to embed the video a some wrapper php page that doesnt use any userid/password but is under my control. Embedding the video stream into any HTML page it's really easy:
<img src="http://5.246.77.89:8090/videostream.cgi?user=stack&pwd=overflow&resolution=32&rate=15" alt="">
For some time I'll give you the opportunity to test the source of the video streaming that I want to hide here
http://93.58.198.189:8090/videostream.cgi?user=stack&pwd=overflow&resolution=32&rate=15
Now all I need is a simple web page let say video.php that is able to stream the video without asking credentials and hiding the original source IP, something like
<img src='my.php'>
How can I obtain this behavior?
Note that despite the source is a video stream, the header is image/jpeg as you can see by yourself and it works with any browser. I've tried to use
<?php
header("content-type:image/jpeg");
passthru("http://93.58.198.189:8090/videostream.cgi?user=stack&pwd=overflow&resolution=32&rate=15");
?>
but for some reason doesn't work. Any idea?
Good question, i was also had a same problem.
Now its solved for me. just you can go to you tube video url where your video is stored and below the video there is share ad embed, you go to embed and there you will get a url which can be embeded to your video.php. it works.

trigger audio .wav using php

Need advice, guidance on triggering a .wav file to play when a web page loads content and a specific keyword is within body of that content.
The content is being pulled from a Yammer network thru a custom app I created to look for certain hashtag messages using PHP. Now, I'd like to have a sound play (like a bell) when a specific hashtag has a new message. The bell would not ring a second time, just on the intial display.
Suggestions (using PHP)?
To play music in your site, place, <embed src="yourfile.wav"></embed> anywhere in page and checkout.
You can make it dynamic by using php in src.

Retrieve a thumbnail of any video in an iFrame?

I have various video hosts that I like to use on my website. I am trying to code a way to retrieve their video thumbnails.
Most of these video hosts actually have a frame of the video on display before the video starts to play. If it's possible to even get that frame as the thumbnail, that would be great. Most if not all of these video hosts use iframes for embedding.
I am looking for a fairly generic way of retrieving thumbnails for all video hosts that display some type of frame from the video once the video is embedded. If that frame can somehow be retrieved and then turned into an image that can be used that would be amazing. However, I am not exactly sure how to go about doing that.
You'd have to have the actual binary file data. If you have that access, install ffmpeg-php on your server and use this question for further direction: ffmpeg to get screenshot
Depends on the site.
For example, if you have a youtube video
http://www.youtube.com/watch?v=AC2FKbyC28k
then its thumbnail is at
http://i2.ytimg.com/vi/AC2FKbyC28k/mqdefault.jpg
I found this out by right clicking the image thumbnail, opening it in a tab and inspecting the url, so I'm sure you can do this exhaustively for every site ;)
It sounds like what you want is oEmbed, which is supported by most popular video hosting sites (Youtube, Vimeo, ...). There are several PHP oEmbed libraries, which come preconfigured with oEmbed endpoints.
What oEmbed allows you to do is to make a request to the provider (Youtube for example) with the video URL. It will return a JSON response with information about the video. Both Youtube and Vimeo return a thumbnail_url element in the JSON.

sending information from scripting side to flash video player

I don't know how to ask this, but the thing is that i was thinking that how does youtube or videofy.me like video blogs send the video path & all info to a flash video player i mean when e click on any video link how does it sets up everything and displays the chosen video, because actually i've created one but in that i had to set up the whole page via flash so that it can manipulate the information like path & name of the video, and cannot use html links, php and all.. so can u people tell me how do i start up & how this process is done & what i need to do & other important things on this.. i mean sending any info to a flash player via any scripting or server side language. Thank you..
There are several ways:
you can "hijack" clicks on links via JavaScript and JavaScript can communicate with flash (e.g. via ExternalInterface)
or you can change/add hash to the current page and Flash can be listening to such changes - this is how you could implement also flash deep linking for example
another option would be use javascript to remove the old video element from the page, and inject a new video (flash) element with the correct flashVars so the chosen video will play ...

Categories