Comments (7)
Play doesn't exists in QuoJS ;)
Enviado desde mi iPad
El 16/01/2012, a las 19:47, "César"
[email protected]
escribió:
Hi,
When I try to play an 'audio' element with QuoJS, nothing happens.
Here is the code I'm using: https://gist.github.com/1621963
If I click the 'play' link at chrome/safari it works fine. The audio plays and the duration is logged to the console.
If I try it in safari mobile, both iPhone Simulator or real iPad, the audio doesn't play and the console.log() writes 'NaN'I've the same issue with Lungo 1.0.4 but it works fine using zepto.js and without any library.
Best,
César.
Reply to this email directly or view it on GitHub:
#6
from quojs.
But .play() is a valid method of the audio element. I only use QuoJS to get the element.
I think is a QuoJS issue because it works fine with zepto, jquery, etc.
from quojs.
I don't know if helps, but if I use
$$(document).ready(function() {
btn = document.getElementById('pbutton');
btn.addEventListener('click', function(){
var s = $$('#snd').get(0);
console.log("Duration: " + s.duration);
s.play();
}, false);
});
instead of
$$(document).ready(function() {
$$('#pbutton').tap(function(){
var s = $$('#snd').get(0);
console.log("Duration: " + s.duration);
s.play();
});
});
it works fine! :)
from quojs.
I think the problem it's the delegate events, try this:
$$(document).ready(function() {
$$('#pbutton').bind('tap', function(){
var s = $$('#snd').get(0);
console.log("Duration: " + s.duration);
s.play();
});
});
from quojs.
I've tested it and, I don't know if it make sense to you, but with 'tap' doesn't work but changing it to 'click' works!
e.g:
$$(document).ready(function() {
$$('#pbutton').bind('click', function(){
var s = $$('#snd').get(0);
console.log("Duration: " + s.duration);
s.play();
});
});
I've also tested with 'swipe' event and fails. Could be a problem with 'touch' events?
The events are catched, but the audio element doesn't works as expected.
from quojs.
Tap, DoubleTap, LongTap and Swipe are a mobile environment events :)
from quojs.
Whatever :P
from quojs.
Related Issues (20)
- No conflict method HOT 6
- Browser Compatibility? HOT 1
- .off works only on events explicitly defined with .on HOT 2
- "hold" function won't show "currentTouch" object upon first hold
- Android 4 Bug HOT 3
- Is it the '2xFingers Tap' event was not implemented? HOT 1
- QUOJS Blocks jQuery Click Events on Mobile HOT 6
- Tap event not working HOT 3
- Please publish on npm HOT 6
- Site isn't useful without demo HOT 2
- QuoJs preventing click events in Android 5.0+ HOT 6
- why some android mobile phone can't use Swipe methods
- the checkbox and radio with label cannot be checked by click on the label HOT 1
- Multiple event .on() binding
- quojs and webpack HOT 2
- QouJS and Windows Phone HOT 7
- QuoJS file order HOT 1
- unable to preventdefault inside passive event listener invocation HOT 1
- How to actually link/install
- Expose duration and timeout configuration for gestures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quojs.