Comments (1)
Work great for me with this :
struct PlayerVideoView: UIViewControllerRepresentable {
class Coordinator: NSObject, DMPlayerViewControllerDelegate {
var parent: PlayerVideoView
init(_ parent: PlayerVideoView) {
self.parent = parent
}
func player(_ player: DMPlayerViewController, didReceiveEvent event: PlayerEvent) {
//print("\(#function): \(event)")
}
func player(_ player: DMPlayerViewController, openUrl url: URL) {
print("\(#function): \(url)")
}
func playerDidInitialize(_ player: DMPlayerViewController) {
print("\(#function)")
}
func player(_ player: DMPlayerViewController, didFailToInitializeWithError error: Error) {
print("\(#function): \(error.localizedDescription)")
}
}
typealias UIViewControllerType = DMPlayerViewController
let videoId: String
init(withId videoId: String) {
self.videoId = videoId
}
func makeUIViewController(context: Context) -> DMPlayerViewController {
let player = DMPlayerViewController(parameters: [:])
player.delegate = context.coordinator
return player
}
func updateUIViewController(_ player: DMPlayerViewController, context: Context) {
let parameters = ["autoplay": false]
guard let encoded = try? JSONEncoder().encode(parameters),
let params = String(data: encoded, encoding: .utf8) else { return }
player.load(videoId: videoId, params: params) {
print("[DMPlayerView.updateUIViewController] load completion")
}
}
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
}
from dailymotion-swift-player-sdk-ios.
Related Issues (20)
- Video paused but not the button HOT 1
- Does the iOS SDK support 360 videos? HOT 1
- Is Swift 5 support planned ? HOT 1
- [Not related with the sdk] Scroll is disabled
- Play Video from Playlist
- Video can not play again if be paused when view controller disappears HOT 1
- Allow iOS to set full screen icon manually HOT 1
- Player is not showing the live preview image HOT 1
- Bug with the player control buttons HOT 1
- How to create custom view on video player HOT 3
- start parameter is not working HOT 1
- Fullscreen button HOT 1
- Picture-in-Picture - Mobile
- qualitiesavailable event does not properly work HOT 1
- Multiple player instance in UICollectionView with rejected_inactive_tab error HOT 2
- Fullscreen problem
- There is an issue with two videos playing simultaneously
- The latest version of pod player 4.0.7 does not play videos below iOS 14
- volume change
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dailymotion-swift-player-sdk-ios.