HTML Web Audio, Video AutoPlay, Mute and AudioWorklets - html5-video

Objective: Display HTML 5 Video with VU Meters, (no audio to speakers) on page load without user interaction.
I'll need to use an AudioWorklet to meter the audio from the HTML5 Video object.
AIUI, Video won't autoplay unless the "muted" flag is set, (because the user hasn't interacted with the page). If "muted" is set, will my AudioWorklet actually receive samples from the Video object?
Apologies for not showing any code or actually trying this yet, but there's a steep learning curve for me here and I'm reluctant to go down this path if I'll hit a brick wall.

Related

Facebook Cover Video in vue.js

Facebook's functionality which needs to be recreated is described really well in this video: https://youtu.be/CMKJoK3DI50?t=128
Our stack is Laravel + Vue.js 2 on a LAMP server.
the ability to upload the video, and after the video is uploaded, the ability to move the video behind the player so that it is "cropped" (see youtube video above, #2:20) - i am not sure if facebook actually crops their videos or simply leaves it whole and changes the placement of the video behind the viewable player so that a certain area of the video is shown, but the entire video is playing behind the "mask".
Any pointers on the best way to get this done in vue.js? And is the video actually cropped, or just "masked".
thanks, Sebastian

Change Playback Quality of YTPlayerView

I am having a problem with quality for embedded YouTube videos in my app. I am using YTPlayerView to embed videos from YouTube. My app has 2 options: option 1 is the user can watch video with 360p quality and option 2 is 720p quality. Are these two options possible? If yes, can I customize the video playback quality of the YTPlayerView?
I tried to change the quality this way, but it does not appear to work:
[self.playerView setPlaybackQuality:kYTPlaybackQualitySmall];
I assume you are using YouTube's youtube-ios-player-helper for iOS.
Unfortunately, due the to the nature of the iFrame API, it is not possible to force a quality playback with this library. The player will load the video in the closest resolution to your YTPlayerView's size. If you change the size of your YTPlayerView programmatically, the view will reload the video to fit your new frame.
See this GitHub issue on the project page. Unfortunately, this is the expected behavior of the class.

Playing a muted video without interrupting background music

My design calls for a video playing in the background of my login screen, exactly like 6snap has.
I would like to avoid the default behavior of stopping the user's music when the video starts to play. My video does not have sound.
I'm using:
<MediaElement Source="MyVideo.mp4" />
I tried setting IsMuted=true which didn't help. Does anyone have an idea how 6snap managed it?
Edit: currently trying the animated gif route. Using the ImageTools 3rd party library and having converted my MP4, it works fine. My 9 second 640x1136 3MB video became a 41MB GIF, so I have to reduce the quality drastically. Still trying to find a better way if possible.
You won't be able to do that with Background Audio and MediaElement, hence as MSDN says:
When a MediaElement control plays audio or video content, any background sounds or media already playing are halted. The app launches the playback experience when the user taps the control. Only one MediaElement control can operate at a time.
It's no matter you have no sound - when you start to play all background sounds/media are halted.
I'm not sure how the App you have mentioned achieved that, but maybe you can try with DirectX/XNA - thought I've not tried this and don't know if that would help.

HTML5 Video - Auto select correct resolution

I'm working on a page that has a list of houses for sale. Each listing has a short video with the option of watching in the page or full screen.
I'm struggling a little with having the videos on the page at one resolution and the fullscreen at a higher resolution - this is needed especially for devices that automatically go fullscreen when the play icon is pressed.
I've had good results with video.js (http://www.videojs.com/) for the page resolution but it doesn't appear to support resolution change on fullscreen. I found this thread with comments about the HTML spec and changing resolution mid-stream: https://github.com/videojs/video.js/pull/233.
I'm told the embedded Youtube player selects the correct resolution automatically but the branded player makes this a non-starter.
Also I've found that in IE10 without Flash that the embedded Vimeo player doesn't function and in Chrome without Flash the Vimeo and Youtube players fail as well... so much for HTML5!
So anyone have a solution for showing video at the correct resolution (low/high) for the state of the player (contained/fullscreen)?
Your question answered a query of mine. It looks like auto switching resolution is still not implemented in videoJS other than for YouTube videos. There is a demo at videoJS Resolution Switcher and you can see in the console that changing window resolution to full screen has no effect.
I've been using the JWPlayer for several years with no problems at all. It reliably supports auto switching has many features and very good support.

Play Video on Mobile Safari for iPod touch

I have a web site that opens iframe for video on page, page uses ajax to pull in videos from selected menu. As expected and understood, on iPod touch after selecting video it shows a play button, which brings up video in another screen. However, when the video completes, it returns browser to page prior to one where video was played from. Sequence:
open Page1
go to Page2 which offers videos to play, in iframe
play video
video completes, returns to Page1, not Page2!!
Only happens on iPod touch, so must be issue with how control is returned on video completion.
Any suggestions? If this is not a known problem, I can work up example (currently, need account on site).
Of course, because the browser returns the URL of the page that was displayed before the video was played back. It won't remember the URL of the IFRAME, that had already changed in the process of selecting a video, if I don't get you wrong.
That's a common problem with frames/iframes and one reason why you shouldn't use them.
The solution could be to place your video selection menu in your actual page and not in an IFRAME. This could be achieved by loading in into a DIV via Ajax for example.
Figured this out, sort of. Got it to go back to the right place, but I do believe that it is easy to confuse the iTouch quicktime player and Safari about where to return to.