video
This commit is contained in:
57
pages/index/dlna1.nvue
Normal file
57
pages/index/dlna1.nvue
Normal file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div>
|
||||
<button @click="startSearch"> 搜索投屏设备 </button>
|
||||
<button @click="startPush"> 开始投屏 </button>
|
||||
<button @click="stopPush"> 停止投屏 </button>
|
||||
<button @click="pausePush"> 暂停 </button>
|
||||
<button @click="resumePush"> 播放 </button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const ox = uni.requireNativePlugin('Jiang-OxePlayer');
|
||||
var device;
|
||||
export default {
|
||||
onReady() {
|
||||
console.log('44444444');
|
||||
ox.initDlna();
|
||||
var globalEvent = weex.requireModule('globalEvent');
|
||||
globalEvent.addEventListener('dlnaCallback', function(e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
startSearch: function() {
|
||||
ox.startSearch(result => {
|
||||
console.log(result);
|
||||
if(result.code==0){
|
||||
var ds =result.devices;
|
||||
device = ds[0];
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
startPush: function() {
|
||||
ox.startPush({
|
||||
url: 'http://www.easydarwin.org/public/video/3/video.m3u8',
|
||||
device: device
|
||||
});
|
||||
},
|
||||
stopPush: function() {
|
||||
ox.stopPush();
|
||||
},
|
||||
pausePush: function() {
|
||||
ox.pause();
|
||||
},
|
||||
resumePush: function() {
|
||||
ox.resume();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user