I'm using the videojs currentTime() function to jump to a specific time in the video. I have it working in Chrome, but Firefox (16) doesn't seem to respond (other api functions like play/pause do work in FF).
Videojs api docs: https://github.com/zencoder/video-js/blob/master/docs/api.md#currenttimeseconds--type-integer-or-float
_V_("video").ready(function(){
var vidplayer = this;
});
$(function() {
$('#time').click(function() {
seconds = $(this).text();
vidplayer.currentTime(seconds);
vidplayer.play();
});
});
Related
I am creating a website on Webflow, and I have no experience in codes. I added a basic setup of Scrollify, but I want it to work only on pc. On mobile, I want a basic scroll.
<script>
$(function() {
$.scrollify({
section : ".scrollsection",
});
});
</script>
It's working perfectly on pc, but on the phone, it brakes the website. I want to disable it on mobile and get the normal touch scroll back.
Tried to brake Scrollify with no existing section name:
<script>
$(function() {
var windowWidth = $(window).width();
if(windowWidth > 768){
$.scrollify({ section:".scrollsection"}); }
else{
$.scrollify({ section:".not-existing-section" }); } });
</script>
It stops whole scrolling on mobile. (But if I zoom in on the website on my phone, I can scroll normally.)
Is there a way to stop scrollify.js on mobile without blocking the whole scroll?
I saw the topic:
How to disable scrollify.js on mobile
but there is no answer.
I have an AngularJS front-end that opens a Bootstrap Modal that has a button on it. When this button is clicked it calls a Web API method on the server that generates an OPEN XML Word Document as a stream and returns the file to the client. I have several files downloading successfully in IE where I see this:
However, for the file I'm trying to download with the open Modal I never see the above image. It's not the file itself because it downloads successfully when I try it without the open Modal. Also, I don't see any errors reported in IE Dev Tools. I don't think it's the code that generates the streams because the same code generates other files successfully. I also tried closing the Modal before downloading but that didn't work either. It's almost like the Modal is "blocking" the download.
Here is the Modal definition:
var isOUOModal;
var isSubmitItem = false;
var openSignificanceModal = function () {
return $modal.open({
scope: $scope,
templateUrl: './app/oa/significance_modal.html',
controller: SignificanceModalCtrl,
keyboard: false,
backdrop: 'static',
resolve: {
item: function () {
return $scope.item;
}
}
});
};
var SignificanceModalCtrl = function ($scope, $modalInstance, item, $window) {
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
I seem to be out of ideas at the moment so any assistance is much appreciated.
Thanks,
Pete
I was able to determine the cause of the problem here. It had to do with the way I was calling the Web API Method. I was using an AJAX JQuery GET call. Instead I had to do something like this:
var url = url;
window.location.href = url;
When I changed the way I was calling the Web API method I saw the stream returned to the client as expected.
I have a Mac OS X application and am using a WebView (webkit) to embed a YouTube iframe.
For some reason it keeps pausing on certain videos after a few seconds. It will just get stuck loading.
Flash NPAPI Plug-in version 18.0.0.160 is installed.
Xcode is also throwing an Error: Ignoring controlTimebase set by client because AVSampleBufferDisplayLayer was added to a synchronizer
Here is my code for the iFrame embed, the same one as YouTube provides.
<div id="ytplayer"></div>
<script>
document.body.setAttribute("style", "margin-left:0px;margin-top:0px;background-color:#000000");
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('ytplayer', {
height: '200',
width: '300',
videoId: '%#',
playerVars: {
'controls': 0,
'html5': 1,
'autoplay': 1
}
});
}
</script>
It was working fine until a couple days ago. I believe YouTube might have updated something, which could just mean the error is on their end.
I need to change the directory in the URL each time I'm loading a new page with AJAX. Right now it's working in Chrome & FF but not in IE.
$('a[data-link="inner"]').live('click', function (e) {
pageToLoad = $(this).attr('href');
loadContent(pageToLoad);
window.history.pushState("","" , pageToLoad);
e.preventDefault();
}
var loadContent = function (url) {
$('.content').load(url + '.html');
};
Does anyone know how to get this working in IE 9,8,7 ?
I have a YouTube video embedded on my site using an iFrame. I want to use the API to pause the video, but in Chrome I get an error:
Unsafe JavaScript attempt to access frame with URL http://subdomain.example.com/ from frame with URL http://www.youtube.com/embed/KmtzQCSh6xk?enablejsapi=1&origin=http://subdomain.example.com. Domains, protocols and ports must match.
In Firefox (3.6) I get this error:
Permission denied for <http://www.youtube.com> to call method Location.toString on <http://subdomain.example.com>.
I've tried putting the iFrame in myself or adding it with the API. Either way the player gets in, but I have no API control over it.
Here's the relevant part of my code:
<div id="player"></div>
<script type="text/javascript">
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
height: '433',
width: '731',
videoId: 'KmtzQCSh6xk'
});
}
$("#pause_button").click(function(){
alert("Pausing " + player);//is undefined :(
player.pauseVideo();
});
</script>
How do I get browsers to allow the YouTube iFrame to access my page's main frame?
Thanks!
Ignore those warnings. The player should still work fine regardless.
Use the recently-introduced JavaScript Player API for iframe embeds.