1. Download our Official Android App: Forums for Android!

Apps Modding MediaPlayer Encrypted Stream

Discussion in 'Android Development' started by ArthurGray, Aug 31, 2017.

  1. ArthurGray

    ArthurGray Newbie
    Thread Starter
    Rank:
     #873
    Points:
    15
    Posts:
    13
    Joined:
    Aug 31, 2017

    Aug 31, 2017
    13
    0
    15
    Hello everyone, I'm new here!

    I'm writing an application for personal use which streams data from my own server, where i would like to keep some encrypted media files, e.g. by a simple xor password, and let the app decrypt the data while remotely streamed.
    I figured out the quickest way to achieve this would be to mod an existing player with remote stream capability, as to decrypt the received data before sending it to playback.
    Now, Since i'm quite a newbie I'd like to ask you which would be my best choice here:
    do you think it's possible to access and change the code of a class in the sdk like MediaPlayer or it would be best to find a good third party embeddable media player, add it to my app and mod that one? If so, do you know a good one to work with?

    Thanks in advance

     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,417
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,417
    10,688
    1,988
    Male
    Software developer
    South West of England
    Hi. Welcome to Android Forums.
    Wouldn't it be easier for your code to receive the encrypted data stream, decrypt it, then send it to the MediaPlayer?
     
  3. ArthurGray

    ArthurGray Newbie
    Thread Starter
    Rank:
     #873
    Points:
    15
    Posts:
    13
    Joined:
    Aug 31, 2017

    Aug 31, 2017
    13
    0
    15
    Hi, thank you for your quick answer.
    Provided one can find the right spot in the code of a media player, the job would be done just by adding a few lines there, that's why i thought this would be the easyest way, at least for me, with experience in programming but not android.
    Could you provide some keywords so that I can do further research?
    Maybe some class that handles download streams and how to feed MediaPlayer with a local stream?
    Thank you very much!
     
  4. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,417
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,417
    10,688
    1,988
    Male
    Software developer
    South West of England
  5. ArthurGray

    ArthurGray Newbie
    Thread Starter
    Rank:
     #873
    Points:
    15
    Posts:
    13
    Joined:
    Aug 31, 2017

    Aug 31, 2017
    13
    0
    15
    So you are suggesting to start a download process in background which saves decrypted data to a local file and start MediaPlayer in the meantime using that file as source. Are you sure it is possible to play from the same file which is being written to by the process?
     
  6. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,417
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,417
    10,688
    1,988
    Male
    Software developer
    South West of England
    No. You would download the file, decrypt it, then start the MediaPlayer.
     
  7. ArthurGray

    ArthurGray Newbie
    Thread Starter
    Rank:
     #873
    Points:
    15
    Posts:
    13
    Joined:
    Aug 31, 2017

    Aug 31, 2017
    13
    0
    15
    Then that's no good, I need to preserve the real time streaming.
    Maybe if I'm able to pause/resume the buffering of the MediaPlayer (not the video playback), I might be able to alternate the download process and the video buffering in a non overlapping fashion.
    Or I could just pause/resume the download process, hoping the MediaPlayer doesen't crash while the file is locked.
    I'll do some tests
     
  8. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,417
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,417
    10,688
    1,988
    Male
    Software developer
    South West of England
    ArthurGray likes this.
  9. ArthurGray

    ArthurGray Newbie
    Thread Starter
    Rank:
     #873
    Points:
    15
    Posts:
    13
    Joined:
    Aug 31, 2017

    Aug 31, 2017
    13
    0
    15
    Wow, that seems exactly what i need, I'll try that, thank you!
     

Share This Page

Loading...