How do I play videos in my website?r - codeigniter

The videos I want to play are in my computer. I have read the forums and guides and I only found guides that lets you play videos uploaded in a video hosting site like JW player and Kaltura. Is there a way to play videos coming directly from my computer? For example by using the path of the file not the link of the uploaded file in the video hosting site. Btw I'm making a youtube like website.
This is my view:
<body>
<div id="container">
<h1>Welcome</h1>
<div id="body">
<div id="div2">
<a href='<?php echo base_url()."main/search"; ?>'>Search!</a>
<br>
<a href='<?php echo base_url()."main/upload"; ?>'>Upload!</a>
<?php echo "<br>"; ?>
<a href='<?php echo base_url()."main/myAccount"; ?>'>Edit my Account!</a>
<?php echo "<br>"; ?>
<a href='<?php echo base_url()."main/logout" ?>'>Logout</a>
</div>
<div id ="searchBox">
<video width="320" height="240" controls >
<source src="videos\53e38a25e298a.mp4" type="video/mp4">
<source src="video\videos\53e38a25e298a.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</div>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
</div>
</body>
I'm trying to play a video (specific location for now) from my computer. But it won't play and it just show the player and play button and progress bar.
Update: I'm currently using xampp and codeigniter as the framework.
I tried creating a single webpage placed in my Desktop using the code above and placed the video in my Desktop and it worked. But when I am using codeigniter it does not play. I've tried putting the video clips inside my view folder but still it won't work.

Have a look into HTML5 Video, you can play videos in a similar way to how you would usually add an image from your computer into a website.
http://www.w3schools.com/html/html5_video.asp

I've solved the problem, it seems that the path is indeed incorrect. The correct path is localhost/video/videos/53e38a25e298a.mp4

Related

HLS stream not playing with Videojs on Mobile Firefox

I have a problem playing HLS (m3u8).
I have a System with some Live streams. To play these streams I wrote a Webpage using Videojs.
This runs smoothly on Desktop with Chrome, Firefox and even Edge.
But with Mobile the Firefox wont play it anymore.
The Firefox Browser gets the playlist, shows the first frame and gets stuck. It then shows the following error:
A network error caused the media download to fail partway.
the code Iam using looks like this
<div>
<video
id="my-video"
class="video-js vjs-big-play-centered"
controls
<?php if(isset($_GET["autoplay"])) echo "autoplay"; ?>
preload="auto"
width="1920"
height="1080"
poster="pic/Video_Hintergrund.png"
data-setup='{"fluid": true}'
onplay="onVideoStartPlaying();"
onpause="onVideoStopPlaying();"
>
<source src="[...]/index.m3u8" type="application/x-mpegURL" />
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank"
>supports HTML5 video</a
>
</p>
</video>
</div>
The Webpage and the Stream are located on the same Server.
Does anyone have some tips what I can try?

Displaying video file on webpage with laravel

I have a video in the database and also the directory folder. I am trying to display the video on the webpage but I dont see it. Can you help me? heres my code:
<div class="" style="border:1px solid blue;"><video height="300" autoplay controls><source alt="video not playing" src="{{asset ('introvideos/' .Auth::user()->intro_video) }}">
</source>
</video>
</div>

how to change profile picture on yii2 backend advanced

I am using yii2 advanced app . In that we have static profile pic in backend side. how to change that pic dynamically?? just like we change our profile pic in facebook and other social media. can we do this?
backend\views\layouts\left.php
<div class="pull-left image">
<img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
</div>
how to change this image dynamically?

Site looks good locally in Firefox 29.0.1 but not remotely

A site I am working on: http://ninthmind.com, looks good remotely in all browsers except Firefox 29.0.1. I have cleared my cached and searched for syntax errors. The weird thing is it looks as expected locally on my machine in the same Firefox browser.
There is a video element within the site that is also not appearing (only remotely in firefox) despite having both mp4 and webm sources. In the code below the class "invis" changes the mask's and the video's display to none for mobile devices.
<div class="header">
<img class="invis" id="mask" src="images/mask.png">
<video class="invis" id="brain" autoplay loop>
<source src="video/brain.mp4" type="video/mp4">
<source src="video/brain.webm" type="video/webm">
</video>
<div class="welcome">
<h1>Welcome to</h1>
<img id="logo" src="images/logo.png" alt="Logo">
<h3>subheading</h3>
</div>
</div>
That webm file is being served with the wrong mime type. It should be "video/webm" but it's being served as "text/plain". You probably have this set up correctly on your local machine (or you're using "file://") but not the remote server.
These instructions should help you:
http://voice.firefallpro.com/2012/03/html5-audio-video-mime-types.html

No way to open local htm file in php?

Need to open an htm page that is located on my local disk.
I'm running an application using php and xampp server.
I've tried in every way and not make it.
My application path is C:\xampp\htdocs\portal
My htm file path is C:\sistemas\test.htm
I can't move my test file and put it into portal folder.
when I click on the link just nothing happens.
here's my code
<li>
<a target="_new" href="file:///C:/SISTEMAS/test.htm">
<span class="ui-icon ui-icon-suitcase"> </span> Test
</a>
</li>
I've tried in Firefox 25 and IE10. Same result.
You cannot actually do like this but I guess your requirement is just including the content of test.htm. Using php your code can go something like this.
<li>
<a target="_new" href="test.php">
<span class="ui-icon ui-icon-suitcase"> </span> Test
</a>
</li>
and test.php would be including the content of test.htm
<?php require('../../sistemas/test.htm'); ?>

Resources