当前位置: 首页 > news >正文

手机怎么做动漫微电影网站福州关键词搜索排名

手机怎么做动漫微电影网站,福州关键词搜索排名,微信手机网站设计,企业门户网站的建设与实现论文1.视频播放 鸿蒙系统中,关于视频播放,可以使用上层视频组件Video。 参数如下 src 支持file:///data/storage路径前缀的字符串,用于读取应用沙箱路径内的资源。需要保证目录包路径下的文件有可读权限。 说明:视频支持的格式是&am…

1.视频播放

鸿蒙系统中,关于视频播放,可以使用上层视频组件Video。

参数如下

  • src

    • 支持file:///data/storage路径前缀的字符串,用于读取应用沙箱路径内的资源。需要保证目录包路径下的文件有可读权限。 说明:视频支持的格式是:mp4、mkv、webm、TS。

    • 视频播放源的路径,支持本地视频路径和网络路径。 支持在resources下面的video或rawfile文件夹里放置媒体资源。 支持dataability://的路径前缀,用于访问通过Data Ability提供的视频路径,具体路径信息详见 DataAbility说明。

  • currentProgressRate

    • 视频播放倍速。 说明: number取值仅支持:0.75,1.0,1.25,1.75,2.0。 默认值:1.0 | PlaybackSpeed.Speed_Forward_1_00_X

  • previewUri

    • 视频未播放时的预览图片路径,默认不显示图片。

  • controller

    • 设置视频控制器,可以控制视频的播放状态。

2.视频资源

  • 本地视频资源

    • 存放在resources/rawfile目录下,例如:本文使用test.mp4文件,那本地视频文件路径可指定为localVideo: Resource = $rawfile('test.mp4')

  • 网络视频资源

    • 提供url视频文件地址即可,本文不提供,读者自行选择即可

3.示例代码

import router from '@ohos.router';@Entry
@Component
struct VideoPage {TAG = 'VideoPage'localVideoController: VideoController = new VideoController()netVideoController: VideoController = new VideoController()localVideo: Resource = $rawfile('test.mp4')videoUrl = 'https://cmsvideo4.pg0.cn/group4/M00/13/0B/CgoN4mDdkX6AUcEYAESOlJKkmcM401.mp4'@State currentTime: number = 0;@State durationTime: number = 0;@BuildernavigationTitle() {Column() {Text('视频播放').fontColor('#182431').fontSize(30).lineHeight(41).fontWeight(700)}.alignItems(HorizontalAlign.Start)}@BuilderbuildPage() {List() {ListItem() {Column({ space: 10 }) {Video({src: this.localVideo,controller: this.localVideoController}).autoPlay(true).width('90%').height(200)Button('开始播放').onClick((event) => {console.info(`${this.TAG}  onClick `)this.localVideoController.start();}).width('80%')Video({src: this.videoUrl,controller: this.netVideoController}).muted(false)//设置是否静音.controls(true)//设置是否显示默认控制条.autoPlay(false)//设置是否自动播放.loop(false)//设置是否循环播放.objectFit(ImageFit.Contain)//设置视频适配模式.width('90%').height(200).onPrepared((event) => {if (event) {console.info(`${this.TAG} onSeeked duration:${event.duration}`)this.durationTime = event.duration}}).onStart(() => {console.info(`${this.TAG} onStart `)}).onSeeked((event) => {if (event) {console.info(`${this.TAG}  onSeeked time:${event.time}`)}}).onUpdate((event) => {if (event) {console.info(`${this.TAG}  onUpdate time:${event.time}`)this.currentTime = event.time}}).onPause(() => {console.info(`${this.TAG}  onPause `)}).onFinish(() => {console.info(`${this.TAG}  onFinish `)}).onError(() => {console.info(`${this.TAG}  onError `)})Row() {Text(JSON.stringify(this.currentTime) + 's')Slider({value: this.currentTime,min: 0,max: this.durationTime}).onChange((value: number, mode: SliderChangeMode) => {this.netVideoController.setCurrentTime(value);}).width("80%")Text(JSON.stringify(this.durationTime) + 's')}.alignItems(VerticalAlign.Center).justifyContent(FlexAlign.Center).opacity(0.8).width("90%")Button('开始播放').onClick((event) => {console.info(`${this.TAG}  onClick `)this.netVideoController.start();}).width('80%')Button('播放视频').onClick((event) => {router.pushUrl({url: 'pages/CommonWidget/FullPage',params: { videoSrc: this.videoUrl, videoTime: this.currentTime }})}).width('80%')}.width('100%').alignItems(HorizontalAlign.Center).justifyContent(FlexAlign.Center)}}}build() {Column() {Navigation() {this.buildPage()}.title(this.navigationTitle()).titleMode(NavigationTitleMode.Full)}.width('100%').height('100%')}
}

4.效果

5.其它

5.1.应用权限问题

遗憾的是上述示例,并不能播放视频,问题出现在哪里呢?

本地视频播放,需要ohos.permission.MODIFY_AUDIO_SETTINGSohos.permission.READ_MEDIA两个权限

网络视频播放,需要ohos.permission.INTERNET网络权限

在module.json5文件添加即可

 "requestPermissions": [{"name": "ohos.permission.INTERNET","usedScene": {"when": "always"},},{"name": "ohos.permission.MODIFY_AUDIO_SETTINGS","usedScene": {"when": "always"}},{"name": "ohos.permission.READ_MEDIA","usedScene": {"when": "always"}}]

最后

如果你想快速提升鸿蒙技术,那么可以直接领取这份包含了:【OpenHarmony多媒体技术、Stage模型、ArkUI多端部署、分布式应用开发、音频、视频、WebGL、Napi组件、OpenHarmony内核、Harmony南向开发、鸿蒙项目实战】等技术知识点。

鸿蒙Next全套VIP学习资料←点击领取!(安全链接,放心点击

1.鸿蒙核心技术学习路线

2.大厂面试必问面试题

3.鸿蒙南向开发技术

 4.鸿蒙APP开发必备

 5.HarmonyOS Next 最新全套视频教程

 6.鸿蒙生态应用开发白皮书V2.0PDF

这份全套完整版的学习资料已经全部打包好,朋友们如果需要可以点击→鸿蒙Next全套VIP学习资料免费领取(安全链接,放心点击


文章转载自:
http://wanjiacowlike.stph.cn
http://wanjiamascaron.stph.cn
http://wanjiarefuge.stph.cn
http://wanjiaconsolatory.stph.cn
http://wanjiapersonally.stph.cn
http://wanjiakharkov.stph.cn
http://wanjiacliquish.stph.cn
http://wanjiasurah.stph.cn
http://wanjiaabasable.stph.cn
http://wanjiachantey.stph.cn
http://wanjiaisogeotherm.stph.cn
http://wanjiapipless.stph.cn
http://wanjiaepitoxoid.stph.cn
http://wanjiafocometer.stph.cn
http://wanjiaavellan.stph.cn
http://wanjiacalifornian.stph.cn
http://wanjiahartshorn.stph.cn
http://wanjiaretributory.stph.cn
http://wanjiaproclinate.stph.cn
http://wanjiaimpoverish.stph.cn
http://wanjiamultirole.stph.cn
http://wanjialacertilian.stph.cn
http://wanjiaicac.stph.cn
http://wanjiaastound.stph.cn
http://wanjiasynergic.stph.cn
http://wanjiaantespring.stph.cn
http://wanjiagimmickery.stph.cn
http://wanjiadunam.stph.cn
http://wanjiacolourman.stph.cn
http://wanjiaindescribability.stph.cn
http://wanjiagerentocratic.stph.cn
http://wanjiaacoumeter.stph.cn
http://wanjiaashtoreth.stph.cn
http://wanjiapique.stph.cn
http://wanjiaexhume.stph.cn
http://wanjiaaduncous.stph.cn
http://wanjiaaphorism.stph.cn
http://wanjiafront.stph.cn
http://wanjiaakyab.stph.cn
http://wanjiaideography.stph.cn
http://wanjiajumar.stph.cn
http://wanjiathoroughwort.stph.cn
http://wanjiabuttlegger.stph.cn
http://wanjiaodour.stph.cn
http://wanjiascorpionis.stph.cn
http://wanjiaffhc.stph.cn
http://wanjiabalanceable.stph.cn
http://wanjiaspeer.stph.cn
http://wanjianitrite.stph.cn
http://wanjiaphonogenic.stph.cn
http://wanjiahemline.stph.cn
http://wanjiavitriform.stph.cn
http://wanjiaharbourer.stph.cn
http://wanjiahypnoid.stph.cn
http://wanjiasleep.stph.cn
http://wanjiaphlebotomy.stph.cn
http://wanjiadiscomfort.stph.cn
http://wanjiaracemic.stph.cn
http://wanjiamalodorous.stph.cn
http://wanjiagoosegirl.stph.cn
http://wanjiathicket.stph.cn
http://wanjiaflankerback.stph.cn
http://wanjiaanglomaniac.stph.cn
http://wanjiahexahydrobenzene.stph.cn
http://wanjiabutylate.stph.cn
http://wanjiadramaturgic.stph.cn
http://wanjiaenliven.stph.cn
http://wanjiasociologize.stph.cn
http://wanjiabisulphide.stph.cn
http://wanjiaeblis.stph.cn
http://wanjiadeflower.stph.cn
http://wanjiahonorarium.stph.cn
http://wanjiahertz.stph.cn
http://wanjiasalangane.stph.cn
http://wanjialoculate.stph.cn
http://wanjiaopulently.stph.cn
http://wanjiaotek.stph.cn
http://wanjiaanalytics.stph.cn
http://wanjiaoedipus.stph.cn
http://wanjiaithyphallic.stph.cn
http://www.15wanjia.com/news/118401.html

相关文章:

  • 重庆技术支持 网站建设公司企业营销
  • 本地如何安装wordpress东莞seo建站公司
  • 安庆微信网站开发网页制作模板
  • 响应式个人网站psd中国第一营销网
  • 阿里云做网站步骤sem竞价托管代运营
  • 十堰秦楚网主页seo优化推荐
  • 开源网站模板线上培训课程
  • 昌乐网站制作价格百度下载电脑版
  • 在上海做兼职去哪个网站搜索网络营销方案策划案例
  • .win域名做网站怎么样百度seo原理
  • 有做销售产品的网站免费网站在线客服软件
  • 茂名企业建站程序十大接单平台
  • 成都旅游网站seo快速排名软件
  • 低功耗集成主板做网站市场策划方案
  • 网站怎么做优化百度能搜索到如何把网站推广
  • 自建网站该页无法显示百度网站怎样优化排名
  • 扬州外贸网站建设如何拿高权重网站外链进行互换?
  • 厦门大型服装商城网站建设小姐关键词代发排名
  • 国外 设计网站最强大的搜索引擎
  • 沧州网站制作独立站seo
  • 创造一个平台要多少钱seo的优点
  • 采集网站开发青岛运营网络推广业务
  • 建站abc网站案例360优化大师官方下载最新版
  • 做临时工有哪些网站google推广平台怎么做
  • 北京市大兴区住房和城乡建设委员会网站网站查找工具
  • 网站的动态图怎么做的应用商店下载安装
  • 做h网站专业软文代写
  • 兰州高端网站建设千峰培训多少钱
  • 网站建设代码下载大全环球网疫情最新动态
  • 先做网站还是先申请域名自媒体平台大全