LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-29-2016, 09:34 AM   #1
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Rep: Reputation: Disabled
how to play videos on apache server


hi all,

i have made a LAMP server on a centos machine, i know you put any files you want to publish here -

/var/www/html/

but what about if you copy a video file to that location, how do you play it back on the browser?

many thanks,

rob
 
Old 11-29-2016, 11:51 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,722

Rep: Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916
You need to create a web page that "points" to the video. That can be done several ways and the video needs to be in a format that supports the method.

http://www.computerhope.com/issues/ch000591.htm
http://www.w3schools.com/TAgs/att_video_src.asp
 
Old 11-29-2016, 01:05 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
On my local network I just point my Apache server to the files then they play, in VLC, when opened with my browser.
You may need to describe the situation more clearly?
 
Old 11-30-2016, 05:58 AM   #4
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Original Poster
Rep: Reputation: Disabled
i have it working by typing out the full path ie -

http://host-ip/directory-where-video-is/video-file.mp4

this plays as an embedded video on firefox and chrome but IE it asks me whether i want to open it or save it and when i choose open it opens up my default video player VLC

how can i play it embedded in IE
 
Old 11-30-2016, 06:43 AM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,651

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
About your title: You cannot actually play videos in apache server: Web servers just send files and data to your browser. It is the browser that can actually play or render things or call 'helper' programs to do that.

A video is just a file. Make an HTML or XHTML properly formatted page that the browser can use to download your video and it will attempt then to render it. If it can, you are golden; if it cannot you may need to configure something (vlc?) to 'help' it with that final step or choose a different browser.
 
Old 11-30-2016, 01:29 PM   #6
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Perhaps you're referring to the ability of HTML5 to embed video? In which case you need suitably encoded files and an HTML5 page for each file with (I'm going from memory here) something like a video canvas or video object embedded.
 
Old 12-01-2016, 06:00 AM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,651

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Quote:
Originally Posted by 273 View Post
Perhaps you're referring to the ability of HTML5 to embed video? In which case you need suitably encoded files and an HTML5 page for each file with (I'm going from memory here) something like a video canvas or video object embedded.
Actually, no, I was just referring to the older way of providing a file using a link and trust the browser to manage it on the client end. The HTML5 media extensions are nice, but not globally supported. Yet.
Frankly I had not thought of using the media extensions in HTML5, and that might be a good thing to try!
 
Old 12-01-2016, 01:25 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by wpeckham View Post
Actually, no, I was just referring to the older way of providing a file using a link and trust the browser to manage it on the client end. The HTML5 media extensions are nice, but not globally supported. Yet.
Frankly I had not thought of using the media extensions in HTML5, and that might be a good thing to try!
My apologies, my reply was to the OP rather than you but I am glad if it gave you some ideas to play with.
The behavior described by the OP seems to be IE specific so it's either a client problem for all clients using IE and the IE clients need a group policy applying or, if they're not under control of the page writer, they need nudging by something like HTML5 tags.
 
Old 12-01-2016, 01:39 PM   #9
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
As others have pointed out, Apache doesn't "play" video; it serves a file. If a browser isn't "smart" enough to play the file, then the user ought to use an application that is meant to play that file type (such as vlc, which can play local or remote video quite happily).

If you want to use HTML5 magic, then something like this ought to do:

Code:
<video class="motionpicture" width="720" height="480" autobuffer
controls preload="auto">

<source src="/path/to/vid.webm" />
Your browser does not appear to support HTML5 media. Try updating
your browser or (if you are not already) using an open source
browser like Firefox." </video>
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using httpd/apache to play audio on server. snowkitty Linux - Server 3 10-05-2014 05:35 PM
Videos don't play over network, wireless or wired, using sftp but will play locally rrrssssss Gentoo 5 12-30-2010 12:19 PM
Not able to play videos dpsh Slackware 6 07-12-2009 12:52 AM
how can I play .rm videos rob33n Debian 2 03-01-2008 11:13 AM
Can't play videos macvag Linux - Newbie 7 03-10-2005 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration