Android Question wrap video intent to a panel

Discussion in 'Android Questions' started by a2stepper, Jun 1, 2015.

  1. a2stepper

    a2stepper Member Licensed User

    i'm playing a video using intent/video and works good but is there a way i can put
    that into a panel or put a background or image behind it?

    thanks.
    Paul
     
  2. DonManfred

    DonManfred Expert Licensed User

    Who is the destination of the intent? Is it your app or another app which runs then?
    Usually a intent calls another app. Your app is in the background (your activity is paused)

    What do you want to show in a paused activity?
     
  3. a2stepper

    a2stepper Member Licensed User

    Dim i As Intent
    i.Initialize(i.ACTION_VIEW, "http://www.site.com/video.mp4")
    i.SetType("video/*")
    StartActivity(i)

    this is code i'm using to play video.
    paul
     
  4. DonManfred

    DonManfred Expert Licensed User

    So android will use a suiteable app and start it. Can you confirm that your activity is being paused after you start the intent? Put a log command in activity_pause to log it
    I would guess YES; another app is running to show the video.

    You can use the mediaplayer i believe to show the video in your app
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    You can use VideoView from the Audio library to play video files.
     
  6. a2stepper

    a2stepper Member Licensed User

    ok thanks but where to find the videoview library? can't find it. for b4a
    paul
     
  7. NJDude

    NJDude Expert Licensed User

    The AUDIO library.
     
    lemonisdead and DonManfred like this.
  8. a2stepper

    a2stepper Member Licensed User

    yes thanks, i did download library but not working, i've tried every example in the forum and nothing works.
    thanks anyway..
    paul
     
  9. NJDude

    NJDude Expert Licensed User

    The Audio library is part of the B4A distribution, no need to download it.

    Can you elaborate what you mean by "nothing works"?, no code = no clue.
     
    DonManfred and lemonisdead like this.
  10. a2stepper

    a2stepper Member Licensed User

    java.lang.RuntimeException: Object should first be initialized (VideoView). this is the error i always get on different examples.

    code:

    Sub Globals
    Dim vv As VideoView
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout ("1")
    vv.Initialize("vv")
    Activity.AddView(vv, 10dip, 10dip, 250dip, 250dip)

    vv.loadvideo("http","http://videoservice.us/mobile/photo/photo.mp4")

    vv.Play

    End Sub


    Sub vv_Complete
    Log("Playing completed")
    End Sub
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    This code as is works fine here. Can you upload the project that fails?
     
Loading...