iOS Question no sound on web page

Discussion in 'iOS Questions' started by John Woodsmall, Jan 28, 2015.

  1. John Woodsmall

    John Woodsmall Active Member Licensed User

    I open a web page with

    Page3

    .Title = "Page3"

    Page3.RootPanel.Color = Colors.White

    Page3.RootPanel.LoadLayout("page3")

    NavControl.ShowPage(Page3)


    target3
    ="http://www.astromatch.net/cgi-bin/click.exe?ad=2"

    WebView3.LoadUrl(target3)

    It opens ok, normally it plays a sound. But here it does not play the sound???
     
  2. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    maybe the volume is low :)
     
  3. John Woodsmall

    John Woodsmall Active Member Licensed User

    the sound plays on other functions on the app, but how do i turn the sound volume up?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You need to set the audio session before you load the layout:
    Code:
    Private Sub Application_Start (Nav As NavigationController)
       NavControl = Nav
       
    Dim jo As NativeObject = Me
       jo.RunMethod(
    "setAudioSession"Null)
       Page1.Initialize(
    "Page1")
       Page1.RootPanel.LoadLayout(
    "1")
       NavControl.ShowPage(Page1)
    End Sub


    #If OBJC
    #import <AVFoundation/AVFoundation.h>
    - (void) setAudioSession {
    AVAudioSession *audioSession = [AVAudioSession sharedInstance];
    BOOL ok;
    NSError *setCategoryError = nil;
    ok = [audioSession setCategory:AVAudioSessionCategoryPlayback
      error:&setCategoryError];
    if (!ok) {
      NSLog(@"%s setCategoryError=%@", __PRETTY_FUNCTION__, setCategoryError);
    }
    }
    #end if
    I tried it with your website and it didn't seem to work. Maybe they are not including the music in the device version.
    It did work with a different site I tried.
     
  5. John Woodsmall

    John Woodsmall Active Member Licensed User

    thanks for this, but:
    how do I put the #if OBJC into the app program that I have now?
    I tried to insert it at the top or the bottom and it would not compile?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. John Woodsmall

    John Woodsmall Active Member Licensed User

    I place the above object C code below the last line of my app:
    and I get the following error.
    End Sub
    expected identifier or '('
    Out: Build settings from command line:
    ARCHS = armv7 arm64
    CODE_SIGN_IDENTITY = iPhone
    CONFIGURATION_BUILD_DIR = /Users/user1/Downloads/macserver-aa-5/UploadedProjects/b4i_default/Payload
    OTHER_CODE_SIGN_FLAGS = --keychain b4i_default
    PRODUCT_NAME = AstroMatch_Store
    PROVISIONING_PROFILE = 571eeb78-44ce-4e92-8315-4aa50d95eb7e
    === BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===
    Check dependencies
    ...alot more errors below this.
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Are you using B4i v1.80?
     
  9. John Woodsmall

    John Woodsmall Active Member Licensed User

    help say: B4i v1.180 BETA

    is that the correct version?
     
  10. John Woodsmall

    John Woodsmall Active Member Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    You should use V1.80. If you didn't receive the mail with the link then please contact support@basic4ppc.com.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice