SimonIoa 63

Hello does anybody see any error in this?

[!] Unable to find the Xcode project /Users/macbookpro/Desktop/project/platforms/ios/C:\Users\Simos\project\platforms\ios\Project.xcodeproj for the target Pods-C:\Users\Simos\project\platforms\ios\Project.

I copied my project from my PC to my Mac in a usb drive. THERE IS NO C:\Users\Simos\ directory on mac. Why ai i getting this?

rick.darwin commented: Part of the problem no doubt is that you have mangled the MacOS and the PC filepaths together. +0

SimonIoa 63

Hello i want to show the full image in a specified height div like this

        <div style="width:400px"> <img class="images" src="someimage.jpg"> </div>

i tried this

    .images
    {
    width: 100%;
      height:auto;
    }

SimonIoa 63

The sound plays in autoplay when the page loads and i need a on/off button. I haven't created a on/off function

rproffitt commented: Check out the link. I see a button in the control to mute/unmute. +15

SimonIoa 63

I have three tables(table, table2,table3). From table1 i want to return three rows: Title, Desc,time,'products' AS type

From table2 i want to return three rows: group_title, group_desc, created,'groups' AS type

From table3 i want to return three rows: name, occupation,birth,'users' AS type

  $sql = "SELECT DISTINCT * 
    FROM
        (SELECT table1.title, table1.desc, table1.time,'products' AS type
        FROM table1 ORDER BY rand() LIMIT 5) AS T
     UNION ALL
        (SELECT table2.group_name,table2.group_desc,table2.created,'groups' AS type
        FROM tabl2 
        JOIN table1 ON table2.id = table1.id 
         ORDER BY rand() LIMIT 5)
    UNION ALL
        (SELECT table3.name,table3.occupation,table3.birth,'users' AS type
        FROM table3
        JOIN  table1 ON table3.id = table1.id
        ORDER BY rand() LIMIT 5)";

am using Ionic to push those three parameters of an Array to the next page so if i use AS and put the same name. I set a parameter AS type that i need so i can work different types. it has to be 'products' AS type for table1, 'groups' AS type for table2, users as type for table3 i want to separate the objects from each table.

It cant use AS the for the rest of the columns because i want to push the original columns
e.g.

 (SELECT table1.title AS title, table1.desc AS desc, table1.time AS time
    FROM table1 ORDER BY rand() LIMIT 5) AS T
 UNION ALL
    (SELECT table2.group_name AS title,table2.group_desc AS desc,table2.created AS time.....

If i do that it displays the object parameters ok e.g. {{item.title}}

but i can not push or navctrl the parameter as title it has to be group_name. I hope i made ...

SimonIoa 63

I already did that. I use Ionic 3 with Angular 4 for my project and i call these files for FontAwesome

@font-face {
  font-family: 'FontAwesome';
  src: url("../assets/fonts/font-awesome/fontawesome-webfont.eot");
  src: url("../assets/fonts/font-awesome/fontawesome-webfont.eot") format("embedded-opentype"), url("../assets/fonts/font-awesome/fontawesome-webfont.woff2") format("woff2"), url("../assets/fonts/font-awesome/fontawesome-webfont.woff}") format("woff"), url("../assets/fonts/font-awesome/fontawesome-webfont.ttf") format("truetype"), url("../assets/fonts/font-awesome/fontawesome-webfont.svg") format("svg");
  font-weight: normal;
  font-style: normal;
}

SimonIoa 63

Hello i want to add fa fa-users (the users icon from font awesome) but when i do i am not getting the icon, html displays the code of the font-f0c0 that is. Any guess why?

p.s. i am using other fonts just fine e.g. contact, search and so on

SimonIoa 63

Hello i want to create a script that allows the user to use the device mic and record audio, then display it using Typescript (.ts) file.
Here is what i have so far.

home.ts

import { Component, ViewChild } from "@angular/core";
import { NavController, App, AlertController, Platform } from "ionic-angular";
import { Common } from "../../providers/common";
import { Media, MediaObject } from '@ionic-native/media';
import { File } from '@ionic-native/file';

@Component({ selector: "page-home", templateUrl: "home.html" })
export class HomePage {

  recording: boolean = false;
  filePath: string;
  fileName: string;
  audio: MediaObject;
  audioList: any[] = [];

  getAudioList() {
      if (localStorage.getItem("audiolist")) {
          this.audioList = JSON.parse(localStorage.getItem("audiolist"));
          console.log(this.audioList);
      }
  }

  ionViewWillEnter() {
      this.getAudioList();
  }

  constructor(
    public common: Common,
    private alertCtrl: AlertController,
    private camera: Camera,
    public navCtrl: NavController,
    public app: App,
    private media: Media,
    private file: File,
    public platform: Platform
  ) {
  }

    startRecord() {
  if (this.platform.is('ios')) {
    this.fileName = 'record'+new Date().getDate()+new Date().getMonth()+new Date().getFullYear()+new Date().getHours()+new Date().getMinutes()+new Date().getSeconds()+'.3gp';
    this.filePath = this.file.documentsDirectory.replace(/file:\/\//g, '') + this.fileName;
    this.audio = this.media.create(this.filePath);
  } else if (this.platform.is('android')) {
    this.fileName = 'record'+new Date().getDate()+new Date().getMonth()+new Date().getFullYear()+new Date().getHours()+new Date().getMinutes()+new Date().getSeconds()+'.3gp';
    this.filePath = this.file.externalDataDirectory.replace(/file:\/\//g, '') + this.fileName;
    this.audio = this.media.create(this.filePath);
  }
  this.audio.startRecord();
  this.recording = true;
}

stopRecord() {
  this.audio.stopRecord();
  let data = { filename: this.fileName };
  this.audioList.push(data);
  localStorage.setItem("audiolist", JSON.stringify(this.audioList));
  this.recording = false;
  this.getAudioList();
}

playAudio(file,idx) {
  if (this.platform.is('ios')) {
    this.filePath = this.file.documentsDirectory.replace(/file:\/\//g, '') + file;
    this.audio = this.media.create(this.filePath);
  } else if (this.platform.is('android')) {
    this.filePath = this.file.externalDataDirectory.replace(/file:\/\//g, '') + file;
    this.audio = this.media.create(this.filePath);
  }
  this.audio.play();
  this.audio.setVolume(0.8);
}

home.html

<ion-card>
    <ion-card-content>
      <ion-card-title>
        <button ion-button primary (click)="stopRecord()" *ngIf="recording"><ion-icon name="mic-off"></ion-icon>&nbsp;&nbsp;Stop Record</button>
        <button ...

SimonIoa 63

OK Fixed it!!!

SimonIoa 63

OK i solved it thanks diafol. In my case i had to call session_start(); your post reminded me that.

For people who will see this in the future, this post is the answer if you want to use session or not to include files accordingly....

SimonIoa 63

I don't

rproffitt commented: Then games would not be the right choice for Category. +12

SimonIoa 63

i did this instead and worked!
formData.append('uploadUid', document.getElementById('uploadUid').value);

SimonIoa 63

i watched the video. Everyone should watch it. Especially on 15:30 about the triple equal operator. I saw a coder using a triple equal operator instead of double and said thats wrong! But it isn't

SimonIoa 63

Ineed some help with the this script. I dont want to press a button to upload the file to my server iwant it to be done as soon as the user presses Stop Recording. Can anyone help me?

Stop Recording script

 recordingDIV.querySelector('button').onclick = function() {
                var button = this;
                if(button.innerHTML === 'Stop Recording') {
                    button.disabled = true;
                    button.disableStateWaiting = true;
                    setTimeout(function() {
                        button.disabled = false;
                        button.disableStateWaiting = false;
                    }, 2 * 1000);
                    button.innerHTML = 'Start Recording';
                    function stopStream() {
                        if(button.stream && button.stream.stop) {
                            button.stream.stop();
                            button.stream = null;
                        }
                    }
                    if(button.recordRTC) {
                        if(button.recordRTC.length) {
                            button.recordRTC[0].stopRecording(function(url) {
                                if(!button.recordRTC[1]) {
                                    button.recordingEndedCallback(url);
                                    stopStream();
                                    saveToDiskOrOpenNewTab(button.recordRTC[0]);
                                    return;
                                }
                                button.recordRTC[1].stopRecording(function(url) {
                                    button.recordingEndedCallback(url);
                                    stopStream();
                                });
                            });
                        }
                        else {
                            button.recordRTC.stopRecording(function(url) {
                                button.recordingEndedCallback(url);
                                stopStream();
                                saveToDiskOrOpenNewTab(button.recordRTC);
                            });
                        }
                    }
                    return;
                }

Upload to Server script

recordingDIV.querySelector('#upload-to-server').disabled = false;
                    recordingDIV.querySelector('#upload-to-server').onclick = function() {
                        if(!recordRTC) return alert('No recording found.');
                        this.disabled = true;
                        var button = this;
                        uploadToServer(recordRTC, function(progress, fileURL) {
                            if(progress === 'ended') {
                                button.disabled = false;
                                button.innerHTML = 'Click to download from server';
                                button.onclick = function() {
                                    window.open(fileURL);
                                };
                                return;
                            }
                            button.innerHTML = progress;
                        });
                    };
                }
                var listOfFilesUploaded = [];
                function uploadToServer(recordRTC, callback) {
                    var blob = recordRTC instanceof Blob ? recordRTC : recordRTC.blob;
                    var fileType = blob.type.split('/')[0] || 'audio';
                    var fileName = (Math.random() * 1000).toString().replace('.', '');
                    if (fileType === 'audio') {
                        fileName += '.' + (!!navigator.mozGetUserMedia ? 'ogg' : 'wav');
                    } else {
                        fileName += '.webm';
                    }
                    // create FormData
                    var formData = new FormData();
                    formData.append(fileType + '-filename', fileName);
                    formData.append(fileType + '-blob', blob);
                    callback('Uploading ' + fileType + ...
info3 commented: How is the RTC Audio Script working for you? We just started using it. Where do you add the scripts in wp? Thank you for you assistance. +0

SimonIoa 63

This is the HTML

     <section class="experiment recordrtc">
            <h2 class="header">
                <select style="visibility:hidden" class="recording-media">
                    <option value="record-video">Video</option>
                </select>
                <select style="visibility:hidden" class="media-container-format">
                    <option disabled>WebM</option>
                    <option disabled>Mp4</option>
                    <option>WAV</option>
                    <option disabled>Ogg</option>
                    <option disabled>Gif</option>
                </select>

                <button>Start Recording</button>
            </h2>

            <div style="text-align: center; display: none;">
                <button id="save-to-disk">Save To Disk</button>
                <button id="open-new-tab">Open New Tab</button>
                <button id="upload-to-server">Upload To Server</button>
            </div>

            <br>

I put visibility:hidden because i dont want the user to have to choose if he wants audio or video or what type of file should he/she should upload I want by default to be webm for Video and ogg for audio but it stores webm

SimonIoa 63

Sorry for the delay i found a better script. https://github.com/muaz-khan/RecordRTC/tree/master/RecordRTC-to-PHP It works fine. Save up to server and stores the video/audio file to uplodas/ If anyone has any problem please post in this thread. But its better than the last one.

I want to make it store to database as soon as the user hits 'Stop Recording' and not to have to hit <button id="upload-to-server">Upload To Server</button>

js

 function saveToDiskOrOpenNewTab(recordRTC) {
                recordingDIV.querySelector('#save-to-disk').parentNode.style.display = 'block';
                recordingDIV.querySelector('#save-to-disk').onclick = function() {
                    if(!recordRTC) return alert('No recording found.');
                    recordRTC.save();
                };
                recordingDIV.querySelector('#open-new-tab').onclick = function() {
                    if(!recordRTC) return alert('No recording found.');
                    window.open(recordRTC.toURL());
                };
                recordingDIV.querySelector('#upload-to-server').disabled = false;
                recordingDIV.querySelector('#upload-to-server').onclick = function() {
                    if(!recordRTC) return alert('No recording found.');
                    this.disabled = true;
                    var button = this;
                    uploadToServer(recordRTC, function(progress, fileURL) {
                        if(progress === 'ended') {
                            button.disabled = false;
                            button.innerHTML = 'Click to download from server';
                            button.onclick = function() {
                                window.open(fileURL);
                            };
                            return;
                        }
                        button.innerHTML = progress;
                    });
                };
            }
            var listOfFilesUploaded = [];
            function uploadToServer(recordRTC, callback) {
                var blob = recordRTC instanceof Blob ? recordRTC : recordRTC.blob;
                var fileType = blob.type.split('/')[0] || 'audio';
                var fileName = (Math.random() * 1000).toString().replace('.', '');
                if (fileType === 'audio') {
                    fileName += '.' + (!!navigator.mozGetUserMedia ? 'ogg' : 'wav');
                } else {
                    fileName += '.webm';
                }
                // create FormData
                var formData = new FormData();
                formData.append(fileType + '-filename', fileName);
                formData.append(fileType + '-blob', blob);
                callback('Uploading ' + fileType + ' recording to server.');
                makeXMLHttpRequest('http://localhost/WallScript/save_audio.php', formData, function(progress) {
                    if (progress !== 'upload-ended') {
                        callback(progress);
                        return;
                    }
                    var initialURL = location.href.replace(location.href.split('/').pop(), '') + 'uploads/';
                    callback('ended', initialURL + fileName);
                    // to make ...

SimonIoa 63

OK now returns ok <?php $searchword= ($_GET['searchword']);?>

SimonIoa 63

Hello i ve got this message from a fellow programmer.

  • Directly you load your site from your server in to android or IOS like iframe, we have the option in mobile device webview you can directly load your site url into the mobile app*

and this

  • if you have public access just create the app in your server and put the files in your server give me the url of your site just i onfigure the app getting response from your website*

I already have a webiste written in php and i want to make it a native mobile app. Can anyone elaborate what he meant?

SimonIoa 63

i thought that was it but the video starts when page refresh

SimonIoa 63

ok i got it...

<iframe class="new" width="'.$w.'" height="'.$h.'" src="'.$this->data["iframe"].'?autoplay=1" frameborder="0" allowfullscreen>

SimonIoa 63

the solution is this

  echo '<a class="show-all-photo" href="#show-all-photo'.$messageid.'" style="cursor:pointer" id="show_all_photo">link</a>';

What i tried to do was to try and $_GET the message_id throught the url. I couldn't figure out how to do it and i put the colorbox html inside the while() so it returned ok.

If someone wants to get the parameters via url this is the best solution i find

http://stackoverflow.com/questions/7206931/pass-form-value-into-src-url-of-iframe-with-jquery

broj1 commented: Thnx for posting the solution +11

SimonIoa 63

i have downloaded zend server but i cant find the phpadmin as set on the example for Imti

iMadhusanka commented: If it is a problem with phpMyAdmin, try this.. http://files.zend.com/help/Zend-Server-6/content/installing_phpmyadmin.htm +0

SimonIoa 63

I viewed this online. So all i have to do is put this code on my config page?

http://www.phpfastcache.com/

diafol commented: Wow. Thanks for the link, Looks brilliant. Will be experiementing! +15

SimonIoa 63

OK i solved it. apparently chrome needs the author to specify the preload

<audio controls preload="none">

For any any users having the same problem just use the preload attribute (none/metadata/auto)

diafol commented: Thanks. WIll help others. +15

SimonIoa 63

nl2br()?