zoukankan      html  css  js  c++  java
  • Atitit.android播放smb 网络邻居视频文件解决方案

    Atitit.android播放smb 网络邻居视频文件解决方案

     

    Android4.4

     

    1.1. Android4视频播放器不能直接地支持smb协议..子好先转换成个http

     

    1.2. ES文件浏览器播放局域网视频的方式也是smb2http

    据分析播放器的播放历史记录分析,ES文件浏览器播放局域网视频时 将局域网中 /192.168.1.168/SharedDocs/huantaihu.mp4视频文件的地址转换为标准HTTP数据流格式 "http://127.0.0.1:59767/smb/192.168.1.168/SharedDocs/huantaihu.mp4";; 

    然后就可以通过intent直接调用本地播放器程序来播放了 

    Intent intent = new Intent(); 

    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 

    intent.setAction(android.content.Intent.ACTION_VIEW); 

    strSMBURLPath="http://127.0.0.1:59767/smb/192.168.1.168/SharedDocs/huantaihu.mp4";;

    intent.setDataAndType(Uri.parse(strSMBURLPath), "video/*"); 

    startActivity(intent); 

     

    据反编译ES文件管理器源码,除了用到jcifs.jarSMB库(SMB相关功能已基本实现),可能还用到apacheHTTP服务器相关内容

    作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

    转载请注明来源: http://blog.csdn.net/attilax

     

    2. 解决方案::smb2http stream convert

    Buildg个嵌入式web服务器..+smbFileok..

     

     package com.attilax.util;

     

    import java.io.IOException;

    import java.io.InputStream;

    import java.io.OutputStream;

     

    public class StreamUtil {

    byte[] buffer = new byte[524288];

    public   void convertStream(InputStream in, OutputStream out) {

    // InputStream in = new FileInputStream(srcFile);

    // out = new FileOutputStream(destFile);

     

    int byteread;

     

    byteread = read(in);

     

    while (byteread != -1) {

    if (byteread != 0) {

    try {

    out.write(buffer, 0, byteread);

    System.out.println("---out.write.."+byteread);

    //out.flush();

    } catch (Exception e) {

    e.printStackTrace();

    throw new RuntimeException(e);

    }

    }

    byteread = read(in);

     

    }

     

     

    try {

    in.close();

    } catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    try {

    out.close();

    } catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

     

    private   int read(InputStream in ) {

    int byteread;

    try {

    byteread = in.read(buffer,0,524288);

    } catch (Exception e) {

    e.printStackTrace();

    byteread = 0;

    }

    return byteread;

    }

     

    }

     

    3. 瑞福

    android通过SMB访问局域网PC中的共享视频文件,如何在android上搭建个媒体服务器 以便通过HTTP形式访问_百度知道.html

     

     

  • 相关阅读:
    页面可视化搭建 整理
    单页面应用(SPA)重新部署后,正在浏览的页面如何更新缓存?
    vim 使用
    浏览器缓存 知识点
    http 2.0 新特性
    GoJS 在 vue 项目中的使用
    详解Vue中watch的高级用法
    什么是 PWA?
    代码风格统一工具:EditorConfig 和 静态代码检查工具:ESLint
    vue-cli 3.x 使用
  • 原文地址:https://www.cnblogs.com/attilax/p/15198648.html
Copyright © 2011-2022 走看看