HTML5 video player support time mark up and jumping programmatically - html5-video

I'm looking for a HTML5 video player that allows:
(i) (programmatically) making marks of the interesting segments on the time bar, so the users can quickly jump into that part. Something like YouTube's. Something looks like the following, where # is the interesting parts of the video.
-------#######---------##-------------##----------------
(ii) (programmatically) plays the video at a given time. So javascript:play(5) will skip to the 5th minute of the video.
Is there any such thing for free?
Thanks

Code cue points in this player will be useful. http://knowledge.kaltura.com/javascript-api-kaltura-media-players#HandlingCodeCuePoints
Also check the comparison of the players http://html5video.org/wiki/HTML5_Video_Player_Comparison

Related

Accessibility rules for generic lifestyle background video with no audio as it relates to WCAG 1.2.5 Audio Description (Prerecorded)

I think I understand the WCAG 1.2.5 Audio Description (Prerecorded) rule, but what I can't find a straight answer on is if what if the per-recorded background video provides no real value, like if it's just a short video of someone walking on a loop with no talking/audio. Does this rule still apply?
Short Answer
Assuming the video serves no purpose other than decoration then you are safe to hide it with aria-hidden="true".
Longer Answer
While the above is perfectly valid for accessibility, there are other considerations from an accessibility perspective.
Do you provide a way to pause the video? If someone has an anxiety disorder then the video can be distracting so you must provide a way to pause the video. (or you could use the Prefers Reduced Motion media query and use that to stop the video auto playing, however the support is not fantastic at 80%.)
You should also add the muted attribute to indicate that the video has no sound to screen readers.
If the video does provide a purpose (i.e. it emphasises what the company does) then you should add a description to the video using aria-describedby and pointing that to a hidden <div> with a description of the video contents as a minimum.
Final Thoughts
If the video is purely decorative, has no meaning within the page and is there just to 'look cool' perhaps consider replacing it with an image. It will massively help your page load times and so can only help with conversions, video backgrounds hurt more than they help as they take focus away from your call to action.

How to hear sound from mpmovieplayer at a specific time using UISlider?

I'm working on an iOS movie editor project. For this editor, i use MPMoviePlayer to show the video file selected by the user.
I use custom controls, and I have a UISlider that enables the user to move the player's currentTime position. When the user touches the slider, movie is paused and its currentTime changes along with the UISlider's value.
Everything works perfectly, but now i need to let the user hear the sound at this currentTime position.
For those who know iMovie, when you move your mouse over a movie event, you see the image and hear the sound at this position, and that's what i'd like in my editor.
I've tried to call player's play method with à NSTimer to stop after 0.2 seconds, but the result is kind of messy.
Has anyone already achieved to do something like this ?
Thanks !
Best regards.
Seeking takes time; that's why you've ended up using a timer. The real problem here is that MPMoviePlayerController, while convenient because it gives you controls, is a blunt instrument; it's just a massive simplified convenience built on top of AVFoundation. But you don't need the built-in controls, so I would suggest throwing away your entire implementation and getting down to the real stuff, using AVFoundation instead (AVPlayer etc). Now you have a coherent way to seek and get a notification when the seek has completed (seekToTime:completionHandler:), so you'll be able to start playing as soon as possible. Plus, AVFoundation is the level where you'll be doing all your "editing" anyway.

Show subtitles with an AVFoundation AVPlayer on OS X

I'm trying to display subtitles when playing video using AVFoundation on OS X.
I've looked through the documentation and I can't find a way to enable a subtitle track. The API contains multiple references to subtitle tracks, which leads me to believe that it's supported.
On iOS the method -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] is used to enable subtitle tracks. This method isn't available in the 10.7 SDK. Is there another way to show subtitles?
EDIT:
Quicktime Player X has subtitle support, for example on opening this movie the subtitle submenu appears to offer a choice of language, and will display them when English is chosen. This leads me to believe that they're included in the API...
I ran into this same issue myself. I found that unfortunately the only way to do it, other than switching to QTKit, is to make a separate subtitles layer (a CATextLayer) and position it appropriately as a sublayer to the player layer. The idea is that you set up a periodic time observer to trigger every second or so and update the subtitles, along with (and this is optional) some UI element you might have that shows what the elapsed time is in the video.
I created a basic SubRip (.srt) file parser class; you can find it here: https://github.com/sstigler/SubRip-for-Mac . Be sure to check the wiki for documentation. The class is available under the terms of the BSD license.
Another challenge you might run into is how to dynamically adjust the height of the CATextLayer to account for varying lengths of subtitles, and varying widths of the containing view (if you choose to make it user-resizable). I found a great CALayoutManager subclass that does this, and made some revisions to it in order to get it to work for what I was trying to do: https://github.com/sstigler/height-for-width .
I hope this helps.
The way to add the subtitle file is by adding scc subtitle as AVMediaTypeClosedCaption track to the AVPlayer using AVMutableCompositionTrack and the player will control it I tried it and it worked or by adding a text file with the quick time text or any text as AVMediaTypeText track and the player will show the subtitle I don't know why this AVMediaTypeSubtitle track what subtitle file is supported for it

IOS Segemnting a video

I want to segment a video into 9 sections jumble the sections about and then play them together. I am currently trying to use AVPlayer to do this. I can get the sections to load on the simulator but only the first 4 will load on the actual phone. I guess the resources are topping out.
My question is: Is AVPlayer the best framework to use for this (as it seems a waste to create a player item, player and playerlayer for each segment(Which I think is why the resources are topping out)) or is there a lower framework I can use to load one video and display certain segments of it on certain sreas of the screen?
Thanks

creating fade between 2 videos in winforms

i have a media player in vb form...with 2 files in a listbox as a playlist
now i want to create a fade between changing these files as a transition how can i do that...
You can't do this with the MediaPlayer control, unless you "fake" it by merging the two videos into one (handling the overlap transition from the first to the second in your code) and then playing the single merged video.
DirectShow can do this in theory, but programming DirectShow is difficult (all the more so from .Net) and it's obscure enough now that you won't find many people to help you. Also, from my experiments into this area (I was trying to use DirectShow to transition from one video w/sound to the next without any interruption or slight pausing), it appears that DirectShow can play one video at a time with no problems at all, but on some systems (including mine) it can't handle playing two at once. To do a cross-fade transition, you need to have both graphs running during the overlap time, which my computer at least was never able to handle.
I would check out WPF and see if its controls can do this. I'm not sure they can but it's possible.