Skip to content

Video files to be stream instead of downloading and than playing #592

Closed

Description

@supportreq

Hi,

Is it possible for the video files [mp4 h264] which are stored on owncloud, to be streamed directly, instead of them being downloaded and than played.

Using Android 4.4.4 Nexus 5 android app 1.5.8


PENDING TASKS:

  • [GIT] Create branch in Android repo
  • Use ExoPlayer library instead of VideoView because it was not possible to set headers for the authentication in < Lollipop devices.
  • Create custom http data source for setting authentication headers (ExoPlayer doesn't implement it).
  • Add full screen mode manually (ExoPlayer doesn't implement it).
  • Important: This full screen mode is different to the one we previously had in the app. To go into full screen mode there is a new button in the playback controls and to exit the full screen mode, there is other button in the same place when full screen mode is enabled.
  • Handle full screen modes. Two full screen modes to implement depending on the Android versions:
  • < 4.4 KitKat: Full screen with a limitation, the least user interaction will cause navigation controls to reappear immediately. Once the navigation controls have reappeared, they are not hidden again, even if the user clicks in the view.
  • >= 4.4 KitKat: App goes truly full screen using immersive mode, system bars are automatically hidden. User swipes to display the system bars.
  • Options in menu. Remove options not necessary to stream
  • If the file is being downloaded you can not stream it, and if the user taps over the file a progress bar will be shown
  • If new version is available it should works as always. Update the current file while play it.
  • Detect SSL certificate to choose between download/stream. In this case, when the certificate is untrusted, an specific error message is shown to the user and after that, the streaming view is closed and the download starts automatically.
  • Improve full screen button behaviour, avoiding show it till the player is ready to reproduce the video
  • Hide unnecessary options to stream in tablets [FIXED] @davigonz , @jesmrec
  • Video playback state and autoplay are missed while rotating the screen in preview mode, not in full screen mode [FIXED] @davigonz @jesmrec
  • Video playback state and autoplay are missed while changing from preview mode to full screen mode and vice versa [FIXED] @davigonz @jesmrec
  • [QA] Design test plan @jesmrec
  • [QA] Validate test plan [WIP] @jesmrec
  • [GIT] Merge branch in Android repo

BUGS & IMPROVEMENTS

Activity

  1. davivel commented on Aug 28, 2014

    @davivel
    Contributor

    Sure, that would be awesome.

    Contributions are welcome!! :)

  2. xylo commented on Sep 30, 2015

    @xylo

    What about an option "stream with" below the option "open with" in the context menu?

  3. tobiasKaminsky commented on Sep 30, 2015

    @tobiasKaminsky
    Contributor

    @DeepDiver1975 Can you give us an hint, if and how streaming is possible via webdav?

  4. supportreq commented on Oct 21, 2015

    @supportreq
    Author

    @AndyScherzinger can we have this?? Its the need of the hour as most cloud solutions have streaming of videos, mp3 instead of downloading...

  5. AndyScherzinger commented on Oct 21, 2015

    @AndyScherzinger
    Contributor

    That is rather a question for @tobiasKaminsky, @DeepDiver1975 and other server side colleagues since I am rather a UI guy than a media streaming expert.

  6. tobiasKaminsky commented on Oct 21, 2015

    @tobiasKaminsky
    Contributor

    owncloud/core#19958
    So this is nearly a 10liner to create.
    And then it will also work for audio :)
    I will do it in the next time

  7. AndyScherzinger commented on Oct 21, 2015

    @AndyScherzinger
    Contributor

    Sounds awesome!!!

  8. supportreq commented on Oct 22, 2015

    @supportreq
    Author

    This would be awesome.. Can we not implement streaming inside the android app itself cause we already have a video and audio player.. This will be an awesome and a long due feature..

  9. tobiasKaminsky commented on Oct 22, 2015

    @tobiasKaminsky
    Contributor

    No.
    I tried it since 3 hours... The internal player is...awful.
    I tried to play several downloaded files to just prove it is working before trying to stream them.
    But none of the videos is being played.

    So. I will just send the generated link via intent to all capable audio/video apps.

    Supporting/enhancing the internal player is something, someone else can do :/

  10. supportreq commented on Oct 23, 2015

    @supportreq
    Author

    I think the native player requires videos having native codec like h264, mp3 for it to work..

    I guess what we can do is if it opens in the native player great else an option to open in another app.. what say?

  11. tobiasKaminsky commented on Oct 23, 2015

    @tobiasKaminsky
    Contributor

    Yes. I have convinced myself to give the internal player a second chance... ;)
    The current state is:

    • Passing the streaming url to the internal player
    • If this does not work:
      • Show warning that password can be exposed, then dialog yes/no, after that send url to vlc (later this will be a chooseable dialog)

    The url has to include the password in cleartext, so a warning is necessary.

  12. tobiasKaminsky commented on Oct 24, 2015

    @tobiasKaminsky
    Contributor

    @ALL: Can someone please provide me a video sample that is working with the internal player? I am using a Nexus 4.

  13. 65 remaining items

  14. jesmrec commented on Mar 17, 2017

    @jesmrec
    Member

    Bug

    Steps

    1. In Device with 4.0.3 (API 15), tap on a video
    2. Error is displayed and video starts to download

    Current behaviour

    After downloading, the app crashes

    Expected behaviour

    The app not crashes.

    Stack trace

    03-17 10:24:26.099 2272-2272/com.owncloud.android W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa000f180)
    03-17 10:24:26.099 2272-2272/com.owncloud.android E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: Error receiving broadcast Intent { act=com.owncloud.android.files.services.FileDownloaderDOWNLOAD_FINISH flg=0x10 (has extras) } in com.owncloud.android.ui.activity.FileDisplayActivity$DownloadBroadcastReceiver@a18a24e8
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:737)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4424)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.NullPointerException
    at com.owncloud.android.ui.preview.PreviewVideoFragment.onFileContentChanged(PreviewVideoFragment.java:587)
    at com.owncloud.android.ui.fragment.FileFragment.onSyncEvent(FileFragment.java:117)
    at com.owncloud.android.ui.activity.FileDisplayActivity$DownloadBroadcastReceiver.refreshSecondFragment(FileDisplayActivity.java:1249)
    at com.owncloud.android.ui.activity.FileDisplayActivity$DownloadBroadcastReceiver.onReceive(FileDisplayActivity.java:1161)
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
    at android.os.Handler.handleCallback(Handler.java:605) 
    at android.os.Handler.dispatchMessage(Handler.java:92) 
    at android.os.Looper.loop(Looper.java:137) 
    at android.app.ActivityThread.main(ActivityThread.java:4424) 
    at java.lang.reflect.Method.invokeNative(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:511) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 
    at dalvik.system.NativeStart.main(Native Method) 

    Tested with Nexus 5 v4.0.3 (simulator)

  15. jesmrec commented on Mar 17, 2017

    @jesmrec
    Member

    Bug

    Steps

    1. In Device with 4.0.3 (API 15), tap on a video
    2. Error is displayed and video starts to download
    3. While it is downloading, change orientation

    Current behaviour

    After downloading, the app crashes

    Expected behaviour

    The app not crashes.

    Stack trace

    03-17 12:32:36.983 23472-23472/com.owncloud.android E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.NullPointerException
    at com.owncloud.android.ui.preview.PreviewVideoFragment$1.onClick(PreviewVideoFragment.java:518)
    at android.support.v7.app.AlertController$ButtonHandler.handleMessage(AlertController.java:157)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4424)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)

  16. jesmrec commented on Mar 20, 2017

    @jesmrec
    Member

    Bug

    Steps (only iPad in landscape)

    1. Set a video as available offline
    2. When it is downloading, cancel the download
    3. Tap on the video (streaming starts)
    4. Pull down in files view

    Current behaviour

    video streams and downloads at the same time

    Expected behaviour

    video is donwloaded

    CC @davigonz

  17. jesmrec commented on Mar 20, 2017

    @jesmrec
    Member

    Bug

    1. Open a server with 302 redirection and non-trusted certificate
    2. Try to stream a video

    Current behaviour

    Error message: Response code: 302

    Expected behaviour

    A clearer error message

    CC @davigonz

  18. jesmrec commented on Mar 20, 2017

    @jesmrec
    Member

    Bug

    1. In app, download a video
    2. In server, upload a new version of the file

    Current behaviour

    File is downloaded and streamed

    Expected behaviour

    File is downloaded

    Tested with Galaxy Note4 v6 and Galaxy Tab v5

  19. davivel commented on Mar 20, 2017

    @davivel
    Contributor

    About error message in redirections, #592 (comment)

    Straight redirections are followed, that was not the problem.

    Crossed redirections are not allowed in streaming, that was resulting in the ugly error message. I updated it.

  20. davivel commented on Mar 20, 2017

    @davivel
    Contributor

    About the bug of streaming instead of downloading (#592 (comment))

    the behaviour is correct. The remote video is not being streamed, the local one is being played while the remote one is downloaded; this is consistent with the rest of the previews and the sync-on-click behaviour: the local copy of the file is shown while the remote one is downloaded. IMHO this is "won't fix".

  21. jesmrec commented on Mar 21, 2017

    @jesmrec
    Member

    Bug

    1. In a SAML server, start the streaming when the session is close to expire
    2. When the session has expired (streaming keeps on), move forward the point in the progress bar to a place where the vide was not downloaded.

    Current behaviour

    Bad error message: EOF Exception

    Expected behaviour

    Appropiate error message

    Tested with Galaxy Nexus v4.1.2

  22. jesmrec commented on Mar 21, 2017

    @jesmrec
    Member

    Improvement

    When a SAML session expires, the video starts to download and fails (notification bar). The error is not real, so the video does not have to download. The user sees an error that is the expected behaviour

  23. davivel commented on Mar 21, 2017

    @davivel
    Contributor

    @jesmrec , bug #592 (comment) is ready to test.

    About the improvement #592 (comment) , to improve this behaviour we would need to make several important changes. This will delay us. I would discourage it.

  24. jesmrec commented on Mar 21, 2017

    @jesmrec
    Member

    All bugs fixed. Approved.

  25. davivel commented on Mar 21, 2017

    @davivel
    Contributor

    DONE; will be released in version 2.4.0, still no release date.

  26. davivel commented on Mar 21, 2017

    @davivel
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions