Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playlists (Audio & Video) #3

Open
espoal opened this issue Feb 23, 2015 · 28 comments
Open

Playlists (Audio & Video) #3

espoal opened this issue Feb 23, 2015 · 28 comments
Assignees
Labels
Milestone

Comments

@espoal
Copy link

espoal commented Feb 23, 2015

Great player guys!

Since I work with browser video, having tried most of the players around, one thing that is consistently missing is support for native playlist.

Let's make an example: I split a 60 minutes long video in 6 videos of 10 minutes, to reduce load on server AND client. I want to automatically play one video after the other, without the user noticing that they are multiple videos.

Now the de facto solution is to use html5 media events, but if you want it to be seamless you have to use some html/css hacks. And it is fugly.

If you could solve this natively (and naively 😄 : ), I'm sure it would boost your popularity.

@sampotts
Copy link
Owner

Great idea. I'll look at this as soon as I can.

@sampotts sampotts self-assigned this Feb 24, 2015
@joesepi
Copy link

joesepi commented Feb 25, 2015

And perhaps related: audio playlist

@tomByrer
Copy link

Issues I'm worried about:

  • not enough memory/cache to hold 2 videos in a row, so has to flush &/or download
  • browser can't or CPU not strong enough to switch out at 30FPS

Might be a reason why video players with years of development aren't seemless.

@sampotts
Copy link
Owner

Hey Joe, I'd probably look at the two as one ticket item.

Hey Tom, very good points. My original thoughts were to use the preload attribute on the element to prefetch some of the next media. That way it would play instantly. That would mean two video/audio elements on the page though. It needs some more thought...

@espoal
Copy link
Author

espoal commented Feb 26, 2015

it is quite the opposite, if used well it will reduce ram and cpu,
especially for long videos.

Hold on, tonight (8 hours from now) I will post you some benchmark, because
we tested some at work to evaluate different options.

Quite smart on the preload thing, we need to check about screen resizing in a liquid layout on different browser ( that's what drove me crazy :P )

@sampotts how can I send you a private message?

On Thu, Feb 26, 2015 at 10:42 AM, Sam Potts notifications@github.com
wrote:

Hey Joe, I'd probably look at the two as one ticket item.

Hey Tom, very good points. My original thoughts were to use the preload
attribute on the element to prefetch some of the next media. That way it
would play instantly. That would mean two video/audio elements on the page
though. It needs some more thought...


Reply to this email directly or view it on GitHub
#3 (comment).

@sampotts
Copy link
Owner

That would be good to see @servermeta !

@sampotts sampotts changed the title Seamless playlists Playlists (Audio & Video) Mar 2, 2015
@sampotts sampotts mentioned this issue Mar 2, 2015
@sampotts
Copy link
Owner

sampotts commented Mar 8, 2015

Sorry @servermeta , I missed your message about a PM. Twitter is fine or me@sampotts.me

I'll be looking at playlists next since I've added .source() and .poster() API methods now.

@nickdesaulniers
Copy link

Self plug: https://github.com/nickdesaulniers/javascript-playlist-parser

I recommend sending an xhr to a url, then aborting if the MIME type is a media stream and using audio tags, else parse xhr.response based on MIME type. 😉

@sampotts
Copy link
Owner

sampotts commented Mar 9, 2015

Thanks @nickdesaulniers , I'll take a look 👍

@espoal
Copy link
Author

espoal commented Jun 26, 2015

sorry for taking so long to reply, but I got scolded at work because I officially can't divulge the data that was under NDA. It was under NDA because we were using some proprietary Nvidia api (NVIFR) which just recently got divulged to the public.

The basic idea is: if I have a 100 mb video, I will use AT LEAST (insert buffer size) mb of memory to hold it, up to 100 + n mb. More often than not I will load useless data, because I will not watch the full video.

Splitting the video in 10 chunks of 10 mb, means that i will load up to 10 + n mb of memory, which is usually less than the default buffer size. The server has saved on bandwidth, you have saved on memory, everybody is happy.

You think it might not matter much when you are seeing 1 video, but the more concurrent videos you add up, the more resource saving it becomes.

@tachyon-ops
Copy link

Hi @sampotts so... what work have you done to address this?
I've been thinking that it wouldn't be that hard to make a super simple script to use the instances example you have on codepen and have some buttons to go next, go previous and thus having some sort of playlist. We would be just switching between instances, the thing is I have not dived into your whole library (always time constrains) to understand if we could swap the source or something...

Do you have the UI separated from a model? I would love to talk with you about this. For now, I'll just stop and hide players from instances.

Regards mate!

@sampotts
Copy link
Owner

sampotts commented Sep 7, 2017

Hey,

Not a lot to be honest. I'm currently finishing up what's left to get v3 out the door (working on it now). After that I'm keen to convert to ES6 with modules so that people can build their own version which what they need - e.g. no Vimeo, YouTube or no controls if they use their own. I have someone who's offered help there. I don't think this would be too hard to do - the work to change sources is there int he API already but passing the playlist to setup would be tricky with the current setup. It's not something I've looked at yet in detail.

@tachyon-ops
Copy link

@sampotts I see. I do not have the time to help you out, but perhaps it's better to get a view at your development on v3 to check it out instead of trying to work on v2. Also, you should have a 'playing' attribute on the instance (true/false) to easily check instance state. I'm having problems with stop(), it's not triggering pause event, and thus I cannot change the state of the instance attribute I've created upon stop(). Any ideas?
Guess I can avoid stopping() and use just play/pause. My playlist with your player is almost finished :) hehe

@sampotts
Copy link
Owner

sampotts commented Sep 7, 2017

v3 is currently in the develop branch but it still has bugs (hence not being in master) and is currently undocumented. I can add a boolean for that sure.

@Uranbold
Copy link

Please +1

@ARehmanMahi
Copy link

Please sensei , Playlist please....................

@friday friday mentioned this issue May 25, 2018
2 tasks
@friday friday added this to the v4 milestone Jun 8, 2018
@markhillard
Copy link

@sampotts, I came across this issue recently and just figured I'd mention that I got Plyr to work on top of my existing audio playlist at https://codepen.io/markhillard/pen/Hjcwu. It's certainly not "integrated" with Plyr, but it has no problem loading up tracks and moving through them.

@JasperTerra
Copy link

@markhillard Nice example! If I use your code locally however the control bar is no longer inline and displays massive icons. Also playlist is shifted right a bit. Would you know what might be causing this? Could it be some css postprocessor?

@markhillard
Copy link

@JasperTerra thanks! I'm guessing, but it sounds like a dependency isn't loading. I do use the Prefixfree setting in that pen so I don't have to write vendor prefixes, so that might be part of the problem.

There is a note about local XHR at https://leaverou.github.io/prefixfree/#faq that describes how to run this plugin locally, depending on your browser.

@micker
Copy link

micker commented Jan 24, 2019

@markhillard great exemple .... any chance to add this in core ?

@sampotts sampotts mentioned this issue Jan 24, 2019
@Carmichaeldb
Copy link

@sampotts I sent you an email ref this topic with the email provided earlier in this discussion. I hope that is ok.

@ridrud
Copy link

ridrud commented May 22, 2019

https://codecanyon.net/item/clean-html-audio-player-with-playlist/11959891
someone did it?

@burakozturk16
Copy link

this is useful https://codepen.io/onigetoc/pen/veWNbP

tylerrowsell added a commit to tylerrowsell/plyr that referenced this issue Oct 3, 2019
@coltenkrauter
Copy link

@sampotts Love what you guys are doing here. Any update on an audio playlist?

@Ashesh3
Copy link

Ashesh3 commented Jun 2, 2020

Any updates on this?

@TobiasKrais
Copy link

I came across this issue recently and just figured I'd mention that I got Plyr to work on top of my existing audio playlist at https://codepen.io/markhillard/pen/Hjcwu. It's certainly not "integrated" with Plyr, but it has no problem loading up tracks and moving through them.

Has anybody example code for mp4 video playlist like the audio playlist mentioned above?

@zwiebus
Copy link

zwiebus commented Nov 25, 2020

This works for me with a local playlist
Thanks to "Gino" and "Dudley Storey"

<head>
   <link rel="stylesheet" href="plyr-master/dist/plyr.css" />

<!-- / own css file based on Gino's playlist  - but you can use the origin one as it is 
          https://codepen.io/onigetoc/pen/veWNbP   /-->
   <link rel="stylesheet" href="plyr-master/dist/playlist.css" />

 <head/>
  <body>
 <div id="player">
  <div id="video_player">
   <video id="video" playsinline controls data-poster="pic1.png" style="--plyr-color-main: #C00040; max-height:360px;">
    <source src="video1.mp4" type="video/mp4" />
   </video>
    <div class="plyr-playlist-wrapper">
     <ul class="plyr-playlist">
      <li class="plyr-playlist"><a class="plyr-playlist" href="video1.mp4"><img src="pic1.png" class="plyr-miniposter">video1</a></li>
      <li class="plyr-playlist"><a class="plyr-playlist" href="video2.mp4"><img src="pic2.png" class="plyr-miniposter">video2</a></li>
      <li class="plyr-playlist"><a class="plyr-playlist" href="video3.mp4"><img src="pic3.png" class="plyr-miniposter">video3</a></li>
     </ul>
   </div>
  </div>
 </div>
<script src="plyr-master/dist/plyr.min.js"></script>
<script>
  const player = new Plyr('#video', {
  controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'settings'],
  blankVideo: 'blank.mp4',
  fullscreen: {enabled: false},
  hideControls: true,
  keyboard: {focused: true, global: false},
  storage: {enabled: false}
  seekTime: 10,
  resetOnEnd: true
  });

<!--/ found here: http://thenewcode.com/792/Create-A-Simple-HTML5-Video-Playlist
      many thanks to Dudley Storey for this nice code /-->

var video_player = document.getElementById("video_player"),
links = video_player.getElementsByTagName('a');
for (var i=0; i<links.length; i++) {
        links[i].onclick = handler;
}
function handler(e) {
        e.preventDefault();
        videotarget = this.getAttribute("href");
        filename = videotarget.substr(0, videotarget.lastIndexOf('.')) || videotarget;
        video = document.querySelector("#video_player video");
        video.removeAttribute("poster");
        source = document.querySelectorAll("#video_player video source");
        source[0].src = filename + ".mp4";
        video.load();
        video.play();
}
</script>
</body>

@appsource-ug
Copy link

Any update on this issue??

i.e Native playlists with NEXT/PREVIOUS buttons @sampotts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests