Code for downloading video files - php

I am working on a project and was wondering how the code for downloading video files is like. I have an idea but it is half of the bigger picture.I am coding in php and jquery.

Simply link to them in either PHP or jQuery and then visitor to the site can click to download them; this is complicated by the server/client model of served pages, in that you're trying to get the client to download the videos, not the server.
Also, if their default viewer is something like Windows Media Player, this will manage the downloading for you/them.
Unless you're talking about embedding the video into the page and streaming the content when the page loads, or an event is fired (jQuery, etc)?
Hope this helps.

Related

View Document Online from PHP server

I am currently tasked to make a website that allows a personnel of people to select possible candidates for a job.
From here, the candidate will upload their resume online to the PHP server. After which, the candidate will view the resume for review to see whether is the candidate suits for the job. I would like to know how is it possible to allow them to download the document from the server and/or view the documents online, probably in another browser page.
Thank you! :)
I would like to know how is it possible to allow them to download the document from the server and/or view the documents online, probably in another browser page.
After a file was moved from the temporary upload folder to your "uploads" folder, you are able to generate a download link to the file.
The file can be view "online", when the viewer opens the file in a new browser tab (by right-clicking the download link, then open in new tab) or you set target="_blank" on the link.
Most modern browsers have PDF support. I would only suggest to utilize a document viewer on server side, if the download links must be protected and the user-group is rather small, because this doesn't scale well.

Script downloading DI.FM list works only under Opera

Hello fellow stackoverflow'ers!
Today I was tired of old dead links to my fav internet radio, so I decided to make a downloader for all channels from di.fm. The idea was simple: download the page, get to the menu and parse it. After that create a playlist and make user download it.
So I created a PHP script as an API for my JS script. PHP functions were to download the page (JS cannot really do that), save playlist sent via POST in cookies and to provide it as a file. Cookies are supposed to be a communication channel between JS and PHP (with POST I cannot really make file download itself).
So far so good. Everything works like a charm under Opera. Things are getting complicated in Chrome and Firefox. Chrome reloads the page without a download dialog, Firefox works about the same, just sometimes lets me download the list... that is empty.
Any ideas how to solve it? Here is the code (feel free to use it yourself if you like it):
http://pastebin.com/dcEzxV9w
Thanks in advice,
Dracco

Having issuses with getting a flash video to play

I am building a site with a flash video embeded on the home page now.
It works fine on my local server using WAMP.
But when I upload it it seems to lose the div that I have embeded the video in altogether.
I have never had this problem before when i have used swf. now im using a .flv
So I have no idea really unless I have forgot to upload somthing.
You need to make sure the path is correct relative to the html document's locations that the flash file resides on

Unable to prompt to install plugin when loading page inside of an iframe

I'm working on a portal to a page where customers can see the streaming video of their security cams. I just currently have a page with our logo with an iframe containing the proper surveillance page. It works fine, except for one major problem. If the plugin isn't already installed, it will never prompt to load the H264 Streaming Viewer from AVTECH, as long as its being loaded through an iframe.
Is there anyway around this?
Do they have to be embedded via iframes? You may also consider injecting them via <object> or if they’re supposed to be iframe-dynamic consider using JavaScript to swap/navigate.
If iframe itself does not prompt, there’s no way around that wile using iframes.
You could however add a small or non-visible video to the page with the iframe, so users are asked (are they asked automatically or when starting the video?) when loading the parent page.

How to record voice files using PHP, FLASH

I am developing an application where I need to record voice(for those who does not have a webcam so they can use only microphone to record voice) or video(those who have a a webcam - like laptop or external) files and save them on server, thereafter save the file name and logged in users id on database for later access.
I know I need to use some sort of flash app for this. But is there any free one which could server this purpose or even if there are paid ones which could serve this purpose that would be great. I tried google but may be I was not being able to go after the proper term or something, I could not succeed finding a proper solution for this.
Please, help me out!
You can do that simply using jRecorder, a jQuery plugin. You don't even need a Flash Media Server or RED server. JRecorder is same as jPlayer, you can use jQuery and HTML to design your recorder and you don't even need Flash or Action script knowledge for this.
jRecorder uses 1 pix hidden swf file which manages all the recording / previewing and sending the file data (wav file) to a URL you defined (Where you can write code in PHP or Java to receive a POST file)
It is quite simple and tidy.
You can download this Plugin from:
http://www.sajithmr.me/jrecorder-jquery
I have same feature in our latest project, the client want to have video recording from webcam and the video appear in the user's profile page.
For the server, we implement the RED5 server. It need a Java virtual machine in your hosting. You can read the detail requirement and installation instruction in the website.
To handle recording, we develop our own flash application, because the client request a custom interface to match with the overall website interface. I don't know the detail, since we outsource it to a fellow flash developer. Maybe you can see follow this thread, the development of flash recording by JeroenW.
To play recorded video, you can use any flash video player that support playing rtmp video source. You cannot play the recorded flv file in RED5 directly, since the file lack of metadata required by the player. Serving the recorded file as rtmp is done by RED5.
In addition to red5 there is Adobe's own Flash Media server that allows you to record audio/video straight to the server.
Or if you feel geeky you might be able to put together your own solution for this using a socket connection to the server and decoding the stream yourself on the server side. You should be able capture the audio/video locally into memory and then feed the byte stream up to your own server application.
There are Open Source solutions but you will need an own server to run them.
There is no way to run these things from shared hosting except if your provider is really nice, and ready to install the necessary software.
I asked the same question a few weeks back, check out the answers.
This question when googling "How to record audio php" comes up first so here for anyone from the future.
A simple way to record audio with flash and save it with PHP:
https://github.com/clouddueling/SimpleRecorder
Record audio, post audio data to your choice of url.
You could try recordmp3online.com which has an SDK. The nice thing about this one, is that it doesn't need a third party server(ala Red5), and supports mobile devices that don't have flash installed.

Categories