- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经为此寻找了很长时间,但似乎找不到任何解决方案!
我试图在用户单击我的 Android PhoneGap 应用程序中的 div 时打开 MP4 视频,但经过进一步研究后,我发现不支持 HTML5 视频标签,并被告知从此处下载名为 VideoPlayer 的插件。
https://github.com/macdonst/VideoPlayer
当我运行这个插件时,我收到与 VideoPlayer.java 文件的几个部分相关的错误。
我已经尝试调整一些插件代码,但仍然没有出现任何视频。
此插件是否与最新版本的 PhoneGap 不兼容?如果不兼容,是否有任何 Java 专家可以帮助我弄清楚如何让它在 Phonegap 下本地运行?
我收到两个主要错误和一些警告,如下所示:
错误似乎与这一行有关:
URLConnection con = new URL(url).openConnection();
我试图删除那段代码(因为我不想从 YT 加载视频,而是从我的本地 Assets 加载视频),但仍然无法播放视频。
config.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<cordova>
<!--
access elements control the Android whitelist.
Domains are assumed blocked unless set otherwise
-->
<access origin="http://127.0.0.1*"/> <!-- allow local pages -->
<!-- <access origin="https://example.com" /> allow any secure requests to example.com -->
<!-- <access origin="https://example.com" subdomains="true" /> such as above, but including subdomains, such as www -->
<access origin=".*"/>
<log level="DEBUG"/>
<preference name="useBrowserHistory" value="true" />
<preference name="exit-on-suspend" value="false" />
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
<plugin name="Echo" value="org.apache.cordova.Echo" />
<plugin name="Globalization" value="org.apache.cordova.Globalization"/>
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>
</plugins>
</cordova>
最佳答案
不要删除任何代码块。
我尝试使用相同的插件代码,它对我有用。
保留 VideoPlayer.java
文件,因为它是与插件一起下载的,只需按 ctr+shift+O
这将导入此插件文件所需的相关包。
然后更改您的视频通话命令,
window.plugins.videoPlayer.play("file:///android_asset/www/res/videos/1.mp4");
对于 Cordova 2.2,第 3 步指令将更改为,
[3] In your res/xml/config.xml file add the following line:
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>
这对我有用。
如果您仍然面临问题,请告诉我。
谢谢。
关于java - Cordova Phonegap 2.2.0 VideoPlayer 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14136327/
我想使用以下 load()接受五个参数的方法,以便我可以从较大的视频加载一个小的“摘录”: http://help.adobe.com/en_US/FlashPlatform/reference/ac
我对 SwiftUI 还很陌生,我不太确定如何在 iOS 14 上使用 VideoPlayer 循环播放视频,而且我发现的相关文档很少。我发现的大多数解决方案在很多方面都非常复杂和令人困惑。如果有人能
在这篇文章中说明了Using new Unity VideoPlayer and VideoClip API to play video可以“根据需要检索每一帧的纹理” 请问将当前帧作为 Textur
我有一个 MovieController 类来管理我项目中的视频。我正在使用 Unity 5.6 中引入的新视频播放器组件。 我想在电影播放完毕后调用一个方法。到目前为止,这个方法只是一个Debug.
Android VideoPlayer 支持哪些文件格式? 以及Android中VideoView和VideoPlayer的区别。 我正在寻找教程、视频、论坛答案等。 任何与此相关的... 最佳答案
我有以下代码,它在我手机的 SD 卡上的文本文件中搜索网络服务器上歌曲的 url。 我可以通过转动手机来改变方向来随机播放歌曲,但我不明白这种逻辑是从哪里来的。这是视频播放器的默认行为吗,因为我在我的
我正在使用 Exoplayer 在我的 Android 应用中播放视频。我想将播放/暂停按钮放在视频播放器 View 的中间(如下图所示)。如何实现这一目标 我只是用一个新的布局来代替 Android
您好,我面临与添加 subview 相关的问题;我遵循代码: NSString *urlStr = [NSString stringWithFormat:@"http:x/ipho
我是最近来自 Flex/Actionscript 星球的难民,仍在摸索基础知识,所以这可能是一个非常简单的问题。我对下面的行感到困惑: videojs("videoPlayer", {}, funct
我在 cmd 提示符下尝试了以下插件,但它们不起作用:cordova插件添加com.moust.cordova.videoplayer cordova 插件添加 org.apache.cordova.
我刚开始使用 Kivy,所以如果我做错了什么请指出。我正在尝试使用视频播放器。也就是说,我似乎无法让它识别任何“选项”,而且我真的很想要一种隐藏控件的方法(以防止用户在电影播放时停止/暂停/更改音量/
我搜索了 XNA Media.VideoPlayer 库。它没有设置时间的直接方法,但是 MediaPlayer 有一个 Position 来设置播放位置。 有什么间接的方法来设置时间吗? 最佳答案
我是 Unity 的新手,正在尝试通过我的脚本更新 VideoPlayer。我已确认代码使用预设值工作,但当我运行 videoPlayer.url = "new video url" 时,它不会播放。
我正在尝试在 flutter web 上播放本地视频文件,但在选择视频后卡住了。根据这篇 github 帖子,可以通过将视频的 uint8list 转换为 blob 然后使用 videoControl
当我放 VideoPlayer 时出现问题查看内部 NavigationView的父 View 或 subview 。在这个例子中, subview 将显示导航栏: struct ParentView
可能相关:Plugin videoPlayer PhoneGap not working 我正在尝试从适用于 Android 的 PhoneGap 3.0 应用程序播放 youtube 视频,但遇到了
我正在尝试为我的视频播放器设置音量控制 slider ,但很难弄清楚如何控制 Unity Video Player 中视频剪辑的音量。我似乎无法将音频源链接到视频剪辑,因此我可以控制音量。我对单个 m
我想在 Android 上的 Unity 虚拟现实中播放立体 360 度视频。到目前为止,我一直在做一些研究,我有两个摄像头用于右眼和左眼,每个摄像头周围都有一个球体。我还需要一个自定义着色器来使图像
我被 GrindPlayer 的代码困住了。我正在尝试使用链接上给出的说明在我的计算机上构建它: https://github.com/kutu/GrindPlayer 但它没有在构建文件夹中形成 s
我想以自定义大小显示 .mov 文件。我的 Controller 有一个 xib 文件。 顶 View 是 UIView 的子类。我想在此 View 中显示视频。有我创建视频 View 的代码。但是我
我是一名优秀的程序员,十分优秀!