You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm making an app that both works online and offline. When there's no connection, it should play the local file (let's just assume for a moment that the user has that file on his phone/tablet). When there is a connection, it should play the video on youtube. I gave it a go, but maybe you can give me some directions?
function showVideo() {
db.transaction(function (tx) {
tx.executeSql('SELECT * FROM ARTIST WHERE VIDEO="yes"', [], function (tx, results) {
var networkState = navigator.network.connection.type;
var len = results.rows.length, i;
for (i = 0; i < len; i++){
if (networkState == Connection.NONE){
window.plugins.videoPlayer.play("'+results.rows.item(i).video_off+'");
}
else{
window.plugins.videoPlayer.play("'+results.rows.item(i).video_on+'");
}
}
document.getElementById("video").innerHTML = home;
}, null);
});
}
The text was updated successfully, but these errors were encountered:
So I'm making an app that both works online and offline. When there's no connection, it should play the local file (let's just assume for a moment that the user has that file on his phone/tablet). When there is a connection, it should play the video on youtube. I gave it a go, but maybe you can give me some directions?
function showVideo() {
db.transaction(function (tx) {
tx.executeSql('SELECT * FROM ARTIST WHERE VIDEO="yes"', [], function (tx, results) {
var networkState = navigator.network.connection.type;
var len = results.rows.length, i;
for (i = 0; i < len; i++){
if (networkState == Connection.NONE){
window.plugins.videoPlayer.play("'+results.rows.item(i).video_off+'");
}
else{
window.plugins.videoPlayer.play("'+results.rows.item(i).video_on+'");
}
}
document.getElementById("video").innerHTML = home;
}, null);
});
}
The text was updated successfully, but these errors were encountered: