html5 player

Hello…

i want to make all my videos source to be in one file like this

<video oncontextmenu="return false;" id="tvseason1" controls> <source id="epsideo1" src="https://domain.com/video1.mp4" type="video/mp4"> <source id="epsideo2" src="https://domain.com/video2.mp4" type="video/mp4"> <source id="epsideo3" src="https://domain.com/video3.mp4" type="video/mp4"> <source id="epsideo4" src="https://domain.com/video4.mp4" type="video/mp4"> <source id="epsideo5" src="https://domain.com/video5.mp4" type="video/mp4"> <source id="epsideo6" src="https://domain.com/video6.mp4" type="video/mp4"> Your browser does not support the video. </video>

and in episode post to get something like this

<?php include("videos1e1.php+(id=from player)+(id=from source)"); is possible??

Not in that fashion.
The source tags in the video element are for fallback options.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video

Some Options:

http://demosthenes.info/blog/792/Create-A-Simple-HTML5-Video-Playlist
http://jsfiddle.net/Barzi/Jzs6B/9/

i want a file is not matter if is php or javascript just one place to put all my 2000++ source videos and to post in all my post by the id from javascript…
(my sources is not stable and my website is wordpress site is not so easy to edit 1000 post)

It seems like the easiest solution would be a prebuilt plug in.
https://wordpress.org/plugins/html5-video-player-with-playlist/

i dont want a play list i have 2000 videos and 2000 post every source is for one post… example source with id test1 will be only in post test1…

pull the info from the database

sql select blah blah…
so you end up with an array - whether that be $row, $array, whatever that’s up to you
then just loop through the array.
[php]

<?php for($i=0;$i<sizeof($array);$i++) { echo ''; } ?>

Your browser does not support the video.

[/php]

Make sense?

Red :wink:

anyway i find a way (just testing some javascript) and is working but i want to add in javascript multiple source with id and in html to call the id player and the source how to do that?? this is my code now

[code]

[/code]

and the js

[code]var video = document.getElementById(‘video’);
var source = document.createElement(‘source’);

source.setAttribute(‘src’, ‘https://video.mp4’);
video.appendChild(source);[/code]

In PHP you can just do something like - crude but will work (you can use javascript or jquery but it depends what you are doing):

[php]

<?php $video_url = $_GET['url']; ?> [/php]

i say what i want check all my previous reply one place to put 2000 video links and every link to have a specific id ex: testvideo200.mp4 or testevideo1999.mp4

Well if im hearing this right - you are wanting a video to be selectable via a button / link?

If so… you could do something like.

[php]

<?php $video_url = $_GET['url']; ?> <?php echo ' 1 2 3 4 '; ?>

[/php]

You could use an array and loop through the buttons or something…
[php]

<?php $page_array = ('2000','2001','2002','2003','2004','2005'); $page_length = count($page_array); for($i=0; $i < $page_length; $i++){ echo ''.$i.''; } ?>

[/php]

[php]$page_array = (‘2000’,‘2001’,‘2002’,‘2003’,‘2004’,‘2005’);
$page_length = count($page_array);
for($i=0; $i < $page_length; $i++){
echo ‘’.$i.’’;
}[/php]

I’d probably swap the above for something like this:
[php]foreach (range(2000, 2014) as $number) {
echo ‘’.$number.’’;
}[/php]

Red :wink:

guys i don’t understand all this php.

example what i want::

first file javascript or php is not relevant

[code]<video id=“video” “player” controls>

[/code] and all the links i have..

in every page i want to echo only one from id not all like

<?php echo $001; ?>

or

<?php echo $055; ?>

and to show this

<video id="video" "player" controls>
<source type="video/mp4" src="www.video.com/movies.mp4">
</video>

Q1: Where are all your links stored?

Q2: do you really want 2000+ pages with one link in each page?

Q3: will clicking the link play the video?

Sorry about all the questions but there seems to be some confusion going on here, if the answers to the above questions are as follows:
Q1: database.
Q2: no.
Q3: yes.

Then the solution to your problem lies in the first answer i posted. If this is not what you wanted to happen, please answer questions 1-3 below and we’ll take another look.

Red :wink:

  1. no is google drive hosted (the links is like https://googledrive.com/host/id/id)

  2. i have 2000 page and because my links i changed or i want to change something from player i need to edit 2000 post (wordpress)

  3. no i don’t want to be clickable video default

2000 posts is a lot of work, would you not be better adding a rule to your .htaccess file pointing from the old location to the new? That would be less work (a single line of code) and next time the links change you could just edit this instead?

redirect 301 /oldfolder/oldpage.htm http://www.yourdomain.com/newpage.htm

Red.

Well i still don’t understand it propperly so im out of here. Although the $ variables were to store the url which is stored in the database, then it will parse out the url of the requested id lol.

And Red, trying to 1 up me are you? lol. I’m trying to program collision algorithms & detection in C++ for our rendering engine atm lol so im half-awake, so its wasn’t aiming at code efficiency, more… trying to understand the question as im totally lost with this one lol.

what is this??? i dont want to change my site my video player is the problem

Not at all. :wink:

Me too! :-\

Who said change your site?

Nope, the links are the problem (if i understood correctly)
I, along with other people have posted solutions that all work.

This line that i posted:

redirect 301 /oldfolder/oldpage.htm http://www.yourdomain.com/newpage.htm

means

redirect 301 /PUT_THE_OLD_PATH/TO_THE_FILE_HERE.htm PUT_THE_NEW_PATH_TO_THE_FILE_HERE

Viola! New links and no new site required at all :wink:

Your browser does not support the video.

Try that… works… haha. The issue is here, the other videos wont play as these are only FALL BACK files…, which if they cant load an mp4, chance is you will need another version like ogg to fall back on.

With playing different files you can do this…

Your browser does not support the video. Your browser does not support the video. Your browser does not support the video.

Just use different files lol

what links??? check my post omg i dont have problem with my link just i want to make i new player and to edit all my previous post with one id and to get the player/video source from file with all sources and player

Sponsor our Newsletter | Privacy Policy | Terms of Service