html5-video

How to append videos and its description from Json to DOM elements in javascript?

余生长醉 提交于 2019-12-10 12:23:11
问题 I have a simple sidebar which I want to display multiple videos from json, for now, I want just to show title and video from json something like this below. Here is what I have so far. <ul class="sidebar"> <li> <h1 class="title"></h1> <video id="video_list" src=""></video> </li> </ul> Here is javascript $(function() { var movies = [{ "title": "travel", "left": 201, "top": 209, "movieid": "10", "movie_url": "http://techslides.com/demos/sample-videos/small.mp4", "buttons": [{ "left": 81, "top":

trying to add a multi source video player with more then one video?

痞子三分冷 提交于 2019-12-10 11:49:39
问题 Im trying to make a video player work in all browsers. There is more then one video and every time you click on demo reel it plays the video and if you click the video 1 the other video plays. How can i make them both work in all browsers? Here is my html and javascript html <video id="myVideo" controls autoplay></video> <div> <a href="#" onClick="changeVid1();">Demo Reel</a></div> <a href="#" onClick="changeVid2();">video 1</a></div> </div> javascript function changeVid1() { var changeStuff

How to make custom video player applicable to multiple videos?

梦想与她 提交于 2019-12-10 11:36:55
问题 I have multiple HTML videos on my page, and want to apply this custom video player to them. The thing is, this only works for the first video, and not for the second, third and fourth. I have no idea where to start. I made a fiddle of the current state: JSFiddle My Javascript /* Get Our Elements */ const player = document.querySelector('.player'); const video = player.querySelector('.viewer'); const progress = player.querySelector('.progress'); const progressBar = player.querySelector('

iOS 10 video tag with “autoplay muted playsinline” stops background music (spotify)

风流意气都作罢 提交于 2019-12-10 10:27:53
问题 I am trying to keep playing background music like Spotify playing with playing a inline video with attributs: "autoplay muted playsinline". <video id="video" muted="muted" autoplay loop muted playsinline > <source src="video.mp4" type="video/mp4"> </video> <script> window.onload = function () { var element = document.getElementById('video'); element.muted = "muted"; } </script> But when I run this the video is plays inline and autoplaying. But as soon as the video start the background music

Detect aspect ratio - HTML5 video

浪尽此生 提交于 2019-12-10 08:25:55
问题 Is it possible to detect the aspect ratio of an HTML5 video element? I know the video will just shrink to fit in the <video> element's dimensions, but I want to detect the aspect ratio of the source video. That way you could remove any black bars. Sorry I don't see this answered anywhere else. 回答1: Pasting from another StackOverflow answer: https://stackoverflow.com/a/4129189/1353189 <video id="foo" src="foo.mp4"></video> var vid = document.getElementById("foo"); vid.videoHeight; // returns

Mobile Safari HTML5 video - event listener 'ended' does not fire the 2nd time

旧巷老猫 提交于 2019-12-10 04:26:53
问题 I am trying to add a button when pressed will play a video, and when the video ends an image is displayed. The problem is that the 2nd time i press the button, the video ends, and nothing happens as if the event listener does not get called. var video = document.getElementById("video"); function playVideo() { video.style.display="block"; //video.load() [adding this the 2nd time wont play] video.play(); video.addEventListener('ended', videoEnd, false); } function videoEnd() { video.style

navigator.getUserMedia alternative API for iOS safari mobile browser?

依然范特西╮ 提交于 2019-12-10 03:54:08
问题 I know with below code will capture a image from ios 6+ safari mobile browser <input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput"> Is there any other way of capturing a image from safari mobile browser using html5/JS? Is there any alternative for WebRTC MediaStream API in iOS safari mobile browser? 回答1: Safari does not support WebRTC yet. http://iswebrtcreadyyet.com/ To start with WebRTC on iOS, you may explore this demo https://github.com/ISBX/apprtc-ios.

How to prevent event bubbling when clicking on HTML5 video controls in Firefox

喜欢而已 提交于 2019-12-10 03:17:00
问题 In Firefox when a video tag is wrapped in an a tag, using the standard video controls also re-directs. How can I make it behave like the other browsers where for example clicking on pause only pauses the video and does NOT re-direct as well. This is what I need. Here is a simple demo: http://jsfiddle.net/me2loveit2/cSTGM/ <a href="http://www.google.com" target="_blank"> <video controls="" muted="" preload="auto" id="testid" width="500"> <source src="http://www.w3schools.com/html/mov_bbb.mp4"

SignalR WebRTC WebSocket is already in CLOSING or CLOSED state

独自空忆成欢 提交于 2019-12-10 03:09:14
问题 I wanted to take a test run of the simplest implementation of SignalR and WebRTC. I hosted the code in https://github.com/foyzulkarim/WebRtc I made two different files "index.html" and "index1.html". In index.html I broadcasted a video file through signalr and it went very well. But when I just replace existing video file with WebCam's feed, it started getting error. After running couple of second I start getting this error "WebSocket is already in CLOSING or CLOSED state." I tried to

Chrome not respecting video source inline media queries

只谈情不闲聊 提交于 2019-12-10 02:43:14
问题 Using the below, Chrome is not respecting the media queries to display the correct video source based on the device width. Chrome is just playing the first source it finds as you can see here: http://homeglobal.ch/. How can I fix this? <video id="intro-video" poster="img/poster.png" controls> <source src="videos/intro.mp4" type="video/mp4" media="all and (min-device-width:1600px)"> <source src="videos/intro.webm" type="video/webm" media="all and (min-device-width:1600px)"> <source src="videos